The lege app to end all lege apps.
- Django 1.7
- virtualenv/virtualenvwrapper
- Node/npm
- Bower
- Sass + Ruby
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 the project.
git clone https://github.com/texastribune/txlege84.git
Then, create the virtual environment for your project.
mkvirtualenv txlege84-dev
Don't forget to activate it!
workon txlege84-dev
Next, install the Python development requirements.
pip install -r requirements/local.txt
Once that finishes, run the initial migration, then try to run the project!
python txlege84/manage.py migrate
python txlege84/manage.py runserver
You should be able to check the site out at http://localhost:8000
, but it's gonna look funky. Time to set up styling!
First, we install all our node
and bower
dependencies.
npm install && bower install
This project uses gulp
to run scss
compiling and other various tasks.
Now here's where the magic happens. Gulp uses BrowserSync to handle live reloading of the page during development. So when you're working on the front end, you'll need two terminal windows or tabs.
In the first, you'll run the Django runserver
command.
python txlege84/manage.py runserver
In the second, you'll run the gulp
serve command.
gulp serve
This routes the Django's development server through BrowserSync's development server, so whenever anything changes with the templates or styles the page reloads automatically.
With both of those running, visit http://localhost:3000
to view the site.
Now get to work!
You'll need a Sunlight Foundation API key to run these steps. Once you have it, you'll need to add it to your environment. There are a number of ways to do that, but the easiest way is:
export SUNLIGHT_API_KEY=<api-key-characters>
Next, you need to prep your database.
python txlege84/manage.py migrate
Then, run the make command to load the data.
make prep_for_development