See README.heroku for more information.
+
### Celery Queue
Celery uses the Apache Message Queueing Protocol for passing messages to its workers.
-We recommend using Heroku's CloudAMQP add-on, getting your own CloudAMQP account, or
+
+For production, we recommend using Heroku's CloudAMQP add-on, getting your own CloudAMQP account, or
running a queueing system on your own. The `CLOUDAMQP_URL` environment variable must be set correctly
for KarmaNotes to be able to use Celery. The `CELERY_QUEUE_NAME` environment variable
must be set to the name of the queue you wish to use. Settings this to something unique
allows multiple instances of KarmaNotes (or some other software) to share the same queueing server.
+For development on localhost, `RabbitMQ` is the default for `djcelery` and is well supported. Ensure
+`RabbitMQ` is installed for local development.
+
### Amazon S3
The instructions for creating an [S3](http://aws.amazon.com/s3/) bucket may be
[found on Amazon.](http://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html)
You may set the `SSL_REDIRECT` environment variable to `true` to make KarmaNotes
redirect insecure connections to secure ones.
-# Local Install
+# Local
+
+## Install
KarmaNotes is a Heroku application. Download the [Heroku toolbelt](https://toolbelt.heroku.com/).
1. `foreman run python manage.py syncdb --migrate --noinput`
1. `foreman run python manage.py createsuperuser`
1. `foreman run python manage.py fetch_usde_csv ./schools.csv`
- 1. `foreman run python manage.py import_usde _csv ./schools.csv`
+ 1. `foreman run python manage.py import_usde_csv ./schools.csv`
1. `foreman run python manage.py sanitize_usde_schools`
+* `fetch_usde_csv` downloads school records and stores them to `./schools.csv`. This file name
+ and location is arbitrary. As long as the same file is passed into `import_usde_csv` for
+ reading, everything should be fine.
+
+* `fetching_usde_csv` requires `7zip` to be installed for processing compressed
+ archives. On Debian-based systems, this entails `apt-get install p7zip-full`
+
+## Run
+
+Ensure environment variables are available to `foreman` by copying `.env.example`
+to `.env` and update those variables as appropriate for your local system.
+
To run KarmaNotes locally, make sure you are inside your
virtual environment (`source venv/bin/activate`) and run `foreman start`.
+
+`foreman` will load the `.env` file and manage running all processes in a way
+that is similar to that of Heroku. This allows better consistency with local,
+staging, and production deployments.
+
Press ctrl-C to kill foreman. Foreman will run Django's runserver command.
If you wish to have more control over how this is done, you can do
`foreman run python manage.py runserver <options>`. For running any other
1. Fetch USDE schools with
`heroku run python manage.py fetch_usde_csv ./schools.csv`
1. Upload the schools into the database with
- `heroku run python /manage.py import_usde _csv ./schools.csv`
+ `heroku run python /manage.py import_usde_csv ./schools.csv`
1. Clean up redundant information with
`heroku run python /manage.py sanitize_usde_schools`