-
Notifications
You must be signed in to change notification settings - Fork 2
Final Notes for Future Development
Alright, so I'm going to write this up pretty informally as there is no reason to make this an overly technical document. The gist of things is that the project is a Django backend using Postgres for it's data storage, and it's hosted on Heroku. There is a normal amount of JavaScript though most of it is legacy (meaning I didn't write it and it's ugly as hell IMHO 🙊). The stuff I did write was mainly to AJAXify the entry edit page so users don't have to get a full page refresh on every CRUD action. Also, I've tried to comment some TODO's into the hairy spots across the codebase so you'll see those around.
One of the more important parts of the project is the fact that we're hosting the site on Heroku, so I'll go into that here. Heroku is a PaaS which allows us to deploy simply and effectively. We have two site environments: Production and Staging. Production is the live site and is running on two dynos so there is no downtime. The staging site is for testing new features and bug fixes before pushing to production. Deploying is as easy as git push, but if you haven't dealt with Heroku before then make sure to checkout their Django getting started guide.
We're keeping all sensitive and environment specific configuration in .env files to follow the 12 factor app pattern. You should create one of these files at the root of the project and it should contain environment variables similar to this:
DJANGO_SETTINGS_MODULE=history.settings.development
HIST_AWS_ACCESS_KEY_ID=get_keys_from_terrence
HIST_AWS_SECRET_ACCESS_KEY=get_keys_from_terrence
S3_BUCKET=histcg-development
Lastly, I suggest looking into virtualenv, virtualenvwrapper, and virtualenvburrito as these tools are really useful for dealing with Django and python libraries.