Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
12 changes: 12 additions & 0 deletions .env.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Environment variables for server-notifications-django

# Django settings to use in this environment
export DJANGO_SETTINGS_MODULE=twilio_sample_project.settings.production
export DJANGO_SECRET_KEY=YOUR_SECRET_KEY

# Twilio API credentials
export TWILIO_ACCOUNT_SID=ACXXXXXXXXXXXXXXXXX
export TWILIO_AUTH_TOKEN=YYYYYYYYYYYYYYYYYY

# Twilio sending number
export TWILIO_NUMBER=+1555555505
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To run the app locally, first clone this repository and `cd` into its directory.
pip install -r requirements.txt
```

1. Copy the `.env_example` file to `.env`, and edit it to include your Twilio API credentials (found at https://www.twilio.com/user/account/voice)
1. Copy the `.env.example` file to `.env`, and edit it to include your Twilio API credentials (found at https://www.twilio.com/user/account/voice)
1. For the TWILIO_NUMBER variable you'll need to provision a new number in the [Manage Numbers page](https://www.twilio.com/user/account/phone-numbers/incoming) under your account. The phone number should be in E.164 format
1. (Optional) This project integrate [python-dotenv](https://github.com/theskumar/python-dotenv) to automatically load the `.env` file. Alternatively, you can run `source .env` to apply the environment variables (or even use [autoenv](https://github.com/kennethreitz/autoenv))
1. Customize `config/administrators.json` with your phone number.
Expand All @@ -44,6 +44,12 @@ To run the app locally, first clone this repository and `cd` into its directory.
```
1. Go to [http://localhost:8000/error](http://localhost:8000/error/). You'll receive a text shortly with details on the exception.

### Use Production Environment

Follow previous guide and in step 3 do:

1. Copy the `.env.production.example` file to `.env`, and edit it to include your Twilio API credentials (found at https://www.twilio.com/user/account/voice) and add the `DJANGO_SECRET_KEY`

## Run the tests

You can run the tests locally through [coverage](http://coverage.readthedocs.org/):
Expand Down