Update to allow running on Heroku

This commit is contained in:
Tyler Hallada 2014-07-28 18:53:30 -04:00
parent 8effdbb1e6
commit 000d63d49b
4 changed files with 40 additions and 1 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: gunicorn laundry.wsgi --log-file -

View File

@ -18,9 +18,13 @@ decided to make this it's own website.
* DATABASE_HOST
* Modify the `ADMINS` variable in `settings.py` so you get emails when the site
errors (happens when eSuds changes something on their site).
* Create and activate a virtualenv: `virtualenv venv` and
`source venv/bin/activate`
* Install the requirements: `pip install -r requirements.txt`
* Run syncdb: `python manage.py syncdb`
* Import the GMU Laundry Hall data: `python manage.py loaddata laundry.json`
* Run the server: `python manage.py runserver`
* Don't forget to set `DEBUG` to `False` when you are production ready.
##Errors##
@ -48,6 +52,24 @@ Sometimes errors happen when eSuds goes down too. Nothing we can really do about
that, but perhaps we can improve our downtime by caching previous results and
showing those in the intrim.
##Backups##
It would be a good idea to periodically dump the database because, right now,
there isn't an automated way of creating the Halls and LaundryMachines. To [save
the
database](https://docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-app-label-app-label-app-label-model)
run:
`python manage.py dumpdata laundry_app > laundry_backup.json`
You can load a backup with:
`python manage.py loaddata laundry_backup.json`
It would be nice of you to keep the `laundry.json` file in this repo up-to-date
as halls' laundry machine configurations change so that anyone setting up this
application will not have errors upon starting up.
##Todo##
Move away from Django to Javascript. There's no real reason to have a backend

View File

@ -25,7 +25,9 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "laundry.settings")
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
from dj_static import Cling
application = Cling(get_wsgi_application())
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication

14
requirements.txt Normal file
View File

@ -0,0 +1,14 @@
BeautifulSoup==3.2.1
Django==1.6.5
MySQL-python==1.2.5
South==1.0
argparse==1.2.1
dj-database-url==0.3.0
dj-static==0.0.6
django-toolbelt==0.0.1
gunicorn==19.1.0
lxml==3.3.5
psycopg2==2.5.3
pygal==1.4.6
static3==0.5.1
wsgiref==0.1.2