diff --git a/.env_example b/.env.example similarity index 100% rename from .env_example rename to .env.example diff --git a/.env.production.example b/.env.production.example new file mode 100644 index 0000000..6f421e8 --- /dev/null +++ b/.env.production.example @@ -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 diff --git a/README.md b/README.md index 124a946..1d032d7 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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/):