This is a database webserver for storing information on Monarch Butterflies for the Pacific Grove Museum. This project is written with Python and Django. South is used for database migration.
Process flow for project:
- Changes are made to the master branch (or testing branch), committed, and always merged back into master
- For deploying code change to deploy branch and merge changes from master
git merge master
- Next update heroku:
git push heroku deploy:master
- For any changes to the model be in the master branch (below are instructions for updating heroku's model):
-
python manage.py schemamigration some_app --auto git add . git commit -m "Adding new migrations" git checkout deploy git merge master git push heroku deploy:master heroku run python manage.py migrate appname
For running website locally on computer:
- Before running the server make sure to create your database file and setup an admin account using
python manage.py syncdb
- Start the server by navigate to the python database folder and running
python manage.py runserver 8080
- The server is now running and can be viewed at
http://localhost:8080
. The admin page can be accessed athttp://localhost:8080/admin
- For running the server on Heroku. Use the command
python my_django_app/manage.py collectstatic --noinput; gunicorn database.wsgi
Extra commands for Heroku:
- Backing up database
heroku pgbackups:capture
; - Resetting database
heroku pg:reset DATABASE
; however, it will destroy everything.
Also, we're using Python 2.7.3
and Django 1.5
The project is also running on Heroku at http://pgmuseum.herokuapp.com