Skip to content

Latest commit

 

History

History
146 lines (112 loc) · 2.95 KB

README.md

File metadata and controls

146 lines (112 loc) · 2.95 KB

Install

Installation instructions for Ubuntu. Tested on 12.04.

Install setuptools.

sudo apt-get install python-setuptools

Install virtualenv, to keep the environment isolated.

sudo easy_install virtualenv

Clone the repository.

git clone git@github.com:Teknologforeningen/traffpunkt_aalto.git && cd traffpunkt_aalto/

Install virtualenv to the project.

virtualenv --no-site-packages venv

Activate virtualenv:

source venv/bin/activate

PIL and Python requirements: https://github.com/python-imaging/Pillow

# Ubuntu 12.04
$ sudo apt-get install python-dev python-setuptools libpq-dev
$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms1-dev libwebp-dev

Install requirements:

pip install -r requirements.txt

Virtualenv

To activate:

$ source venv/bin/activate

Now you can use pip without sudo, and run django with pip's isolated packages just like you would normally.

Database

After fresh install:

python manage.py syncdb --all
python manage.py migrate --fake

Heroku

Guide: https://devcenter.heroku.com/articles/django

Add heroku remote to git:

$ heroku git:remote -a <heroku-app-id>

Set the environment variable so the settings use heroku-settings:

$ heroku config:set DJANGO_ENVIRONMENT=heroku

Deploy branch named "heroku" to heroku:

$ git push heroku master

Running commands:

# e.g
$ heroku run python manage.py syncdb

Start/scale the instance:

$ heroku ps:scale web=1

Check the status:

$ heroku ps

Check if database is configured and ready:

$ heroku config | grep DATABASE_URL

If the DATABASE_URL variable is set the db is ready and should work with the default heroku settings.

If the DATABASE_URL is not set you may need to add a db and promote it.

Check if there is a database available already:

$ heroku addons | grep POSTGRES

Add a database:

$ heroku addons:add heroku-postgresql:dev

Promote the database so the settings pick it up:

$ heroku config | grep HEROKU_POSTGRESQL
$ heroku pg:promote <output of previous command>

Reset the database

$ heroku pg:reset DATABASE

More db information here: https://devcenter.heroku.com/articles/heroku-postgresql#provisioning-the-add-on

Credits

Twitter Bootstrap http://getbootstrap.com/

less http://lesscss.org/

Django https://www.djangoproject.com/

Django CMS https://www.django-cms.org/en/

Cover by Flickr user pigliapost https://secure.flickr.com/photos/69621323@N00/238737785/in/photolist-n6AqH-npMCE-sgPpb-sM9r5-tTTNW-xagrN-xSdor-C4Qjf-C5DcP-DtQSs-E7Bwm-JMxaf-KuCys-LyBAr-MsHbZ-NoYBr-Pxc2R-2dQM4b-2B59fq-2NFggq-34BNPm-38n1EA-3995Te-3agcN1-3BmA3R-3HtqMh-47DPma-4b39Ci-4it75W-4jS9jx-4qB8Ee-4wJnUd-4yQtW6-4BMG8r-4CkQke-4H8JKp-4J1wkM-4KhjqG-4NrQSz-4Nw3YU-4U48mS-4U7Ts3-4XJ315-51jmeh-54kbk6-56egm5-594B8n-5au2ka-5buUFz-5gMjXh-5hzMhr