A Django-based website.
- Install NodeJS v0.10.26:
brew install node
. - Install virtualenv:
pip install virtualenv
oreasy_install virtualenv
. - Install postgresql:
brew install postgresql
. You might encounter some issues with the installation of PostgreSQL, make sure your read every information from brew. - Install foreman package: http://github.com/ddollar/foreman.
- Execute
make install
. - Edit .env file (secret keys, database config).
- Start postgres server.
- Create a famille database in Postgres:
psql -h localhost -d postgres
andcreate database famille;
. - Load application fixtures:
make fixtures
.
- Setup the database:
foreman run ./manage.py syncdb
andforeman run ./manage.py migrate
. - Execute
foreman run ./manage.py runserver
and access to http://localhost:8000.
Whenever changes are pulled from remote repository, both database schema and dependencies might be
updated. You just have to run make up
to be up to date.
Static pages are a good way to make content editable by user.
Some pages are required in the website. To load them (and maybe edit them),
you can perform foreman run ./manage.py loaddata flatpages.json
Once you edited the flatpages in the django admin, and you want to commit
your changes so that every app (heroku app for instance) has the changes,
you can execute foreman run ./manage.py dumpdata flatpages --indent=4 > fixtures/flatpages.json
before commiting your changes to git.
This project uses South. When you modify a model class (adding / removing / modifying column),
you just need to execute make schemamigration
to migrate the database schema. And then
you need to apply it to the database by doing make migrate
. While deploying on servers,
you only need to migrate since the schemamigration files are already there, because they are
versionned.
Some settings are tweakable:
ALLOW_BASIC_PLAN_IN_SEARCH
: set toTrue
to allow basic plans to be in search results.