Skip to content

Latest commit

 

History

History
90 lines (69 loc) · 2.84 KB

README.md

File metadata and controls

90 lines (69 loc) · 2.84 KB

Recommended stack

  • Apache2
  • mod-wsgi
  • Python 2.6+
  • PostgreSQL 8.4
  • Django 1.3

Dependancies from aptitide

  • git
  • libapache2-mod-wsgi
  • postgresql-8.4
  • python-psycopg2
  • python-imaging
  • python-simplejson
  • python-httplib2
  • python-simpletools
  • python-twitter

Dependancies from web

Dependancies that require patching

Update apache2 conf

  • /etc/apache2/sites-available/default add >

      WSGIScriptAlias /hidden /<project location>/odp.wsgi
      Alias /media /<project location>/media
      Alias /static /<project location>/static
    
  • create /<project location>/odp.wsgi >

      import os, sys
      sys.path.insert(0, '/home/azavea/NPower_OpenDataPhilly')
      
      import settings
      
      import django.core.management
      django.core.management.setup_environ(settings)
      utility = django.core.management.ManagementUtility()
      command = utility.fetch_command('runserver')
      
      command.validate()
      
      import django.conf
      import django.utils
      
      django.utils.translation.activate(jangod.conf.settings.LANGUAGE_CODE)
      
      import django.core.handlers.wsgi
      
      application = django.core.handlers.wsgi.WSGIHandler()
    

Setup source

  • Clone project
  • Make media directory:
    • mkdir media
    • chmod 775 media
  • Make static directory:
    • mkdir static
    • chmod 775 static
  • Create a symbolic link to admin media:
    • ln -s /usr/local/lib/python2.7/dist-packages/django/contrib/admin admin_media
  • Sync database:
    • python manage.py syncdb
  • Collect static files:
    • python manage.py collectstatic