My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
Installation  
Installation of openpolitics
Updated Mar 4, 2010 by zbigniew...@gmail.com

Introduction

Openpolitics is a set of reusable django apps that can be deployed in any django project.

Dependencies

Openpolitics depends on Django 1.2

Promise check depends on django-registration

Details

Below I will describe an example setup, but you can use any of the common django approaches.

Lay out directory structure:

  • ./source
  • ./apps
  • ./projects
  • ./vendor

  • ./source/django is where I put latest django (1.2) used for this project
  • ./apps is where you put your apps, so you can just make it a clone of this repository
  • ./projects is where you can create your projects
  • ./vendor is where I deploy external projects that I use

In a simplest case, in order to run plain openpolitics app, it looks like this:

  • ./source/django
  • ./apps/openpolitics
  • ./projects/gov20pl

You should replace the last one with your project, but you can look at http://hg.braniecki.net/gov20pl to see an example of a project that uses openpolitics.

Make sure your project uses proper django installation (hint: in manage.py add path to source/django to sys.path on the first position)

Steps

Once you have everything downloaded, you can proceed to deployment. Enter your project dir, add openpolitics, openpolitics.browser and openpolitics.feedreader to INSTALLED_APPS and:

  • python manage.py syncdb
  • python manage.py loaddata legislature
  • python manage.py loaddata poland
  • python manage.py loaddata sejmgovpl
  • python manage.py loaddata senatgovpl

If you're working on a project for another country, you don't need anything except of legislature dataset and even this one you can plan as you like. All structures are used to describe relations between institutions and people.

Once you have this, and you have some templates to match views you have to plan your urls. You can look at gov20pl example if you just wish to copy url patterns from application.

Loading data from sources

In order to load data from two sources we have so far you have to launch python manage.py cron (later, you may want to put it to cron once we have it working better ;))

This will load the data from two sources and link them together.

That's all for now. It should work

Comment by s.pas...@gmail.com, Mar 6, 2010

I think it's worth to mention steps needed to run gov20pl example:

  • change sys.path to appropriate openpolitics directory in manage.py, settings.py and settings-api.py
  • in settings.py and settings-api.py modify DATABASE_NAME
  • install (if not installed) Graphviz library and pydot module
  • run python manage.py runserver and enjoy

Powered by Google Project Hosting