You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or: add dc-texter to requirements.txt and install.
Step 2. Configure Application Settings
Local Development
For local development, we can configure our settings with a file.
First, add .env.toml to .gitignore to keep it from being published.
Then, create a .env.toml file in your project directory with the following.
In a deployment environment like GitHub Actions, the .env.toml file won't be available. Instead, you'll need to set the configuration variables as environment variables.
First, add the following secrets to your GitHub repository:
Navigate to your repository on GitHub.
Click on Settings > Secrets and variables > Actions.
Click on New repository secret and add the following secrets:
OUTGOING_EMAIL_HOST: Set this to "smtp.gmail.com".
OUTGOING_EMAIL_PORT: Set this to 587.
OUTGOING_EMAIL_ADDRESS: Set this to your gmail address.
OUTGOING_EMAIL_PASSWORD: Set this to your application password.
Once installed and your .env.toml file is ready, you can use it in your code.
fromdc_texterimportsend_textmessage="Testing text alerts from Python."try:
send_text(body=message)
print(f"SUCCESS. Text sent: {message}")
exceptRuntimeErrorase:
print(f"ERROR: Sending failed: {e}")