virtualenv
andvirtualenvwrapper
Please note – this guide assumes you are using OS X. If you aren't, you hopefully know the equivalent commands to make these things happen. If you don't, find someone to help you!
First, clone this project.
git clone [email protected]:northbynorthwestern/nbn-elections.git
cd nbn-elections
Then, create the virtual environment for your project.
mkvirtualenv nbn-elections
add2virtualenv .
Add this to your ~/.virtualenvs/nbn-elections/bin/postactivate
file:
export DJANGO_SETTINGS_MODULE=elections.config.settings.development
And install the requirements:
pip install Django==1.7
pip install -r requirements.txt
Note: Django is not in the requirements because django-faker requires it to be installed before it can be installed.
Now create the database (this assumes you have postgres installed) and run Postgres:
createdb nbn_elections
pgup
export DJANGO_SETTINGS_MODULE=elections.config.settings.development
You should be able to run your first migrate
now:
django-admin makemigrations
django-admin migrate
To get the political race models filled, run:
django-admin create_races
You will also need to install Grunt and other Node dependencies to compile the Sass (this assumes you already have node
and grunt-cli
installed).
npm install
grunt dev
Do some things for Django static files:
sudo mkdir -p /var/www/nbn-elections/static/ && sudo chmod -R 777 /var/www/nbn-elections/static/
django-admin collectstatic
Then, you should be able to run the server:
django-admin runserver