Django application for candidates comparison.
JavaScript CSS Python HTML
Latest commit 935c0a4 Mar 17, 2015 @lfalvarez lfalvarez Merge pull request #286 from ciudadanointeligente/issue-283-button-ch…
…ange-name

fix display embed custom style
Permalink
Failed to load latest commit information.
elections fix display embed custom style Mar 17, 2015
locale Merge pull request #177 from jpmckinney/trans Dec 17, 2012
media/photos Added default photo to all default candidate in initial_data.json Dec 15, 2011
public Arregla anchos en COMPARA. Apr 3, 2013
report_objects admin completed Dec 13, 2011
serializers Addded comments in test file, chmod +x manage.py Nov 15, 2011
smart_profile User Registration: Create automatically a api_key to new users Feb 14, 2013
templates Fixing one uservoice client id missing Dec 21, 2012
.gitignore Adding instructions for coveralls Jun 11, 2013
.travis.yml Adding instructions for coveralls Jun 11, 2013
LICENSE.markdown merges origin dev and adds LICENSE.markdown Dec 20, 2011
README.markdown Adding coveralls badge to the README.markdown Jun 11, 2013
__init__.py initial commit Nov 9, 2011
diagram.png Status of the models Aug 24, 2012
elections_candideitorgs.csv New feature 'no responde'. Oct 3, 2012
local_settings.py.example Adding customizable google analytics Fixes #180 Dec 21, 2012
manage.py Addded comments in test file, chmod +x manage.py Nov 15, 2011
requirements-production.txt Adding requirements for production environment Mar 22, 2013
requirements.txt A candidate can have non utf8 names Feb 24, 2014
settings.py Removing a print and adding a settings to settings so it does not bre… Oct 1, 2013
urls.py First attempt for an API with API client required and a few resources… Feb 8, 2013

README.markdown

Candideit.org

Build Status Coverage Status

Candideit.org is a simple application that aims to provide comparable information about the positions of candidates to any election.

The living application can be found at www.candideit.org

Requirements

If you are using ubuntu 12.04 you can follow this guide.

Instalation instructions

Step 1:

Create a python virtualenvironment

mkvirtualenv candideit

Step 2:

Clone the project from our repo

git clone git@github.com:ciudadanointeligente/candidator.git candidator

Enter the directory

cd candidator

If you are going to be developing candideit you should move to the dev branch

git checkout dev

Step 3:

Install dependencies.

pip install -r requirements.txt

Step 4:

Run tests

python manage test elections

It runs all tests in the elections application

Step 5:

Sync database

python manage syncdb

We are using sqlite3 to store all the data but if you would like to use another database you are free to do so, and it can be changed in 'settings.py'.

Step 6:

Run the application

python manage runserver

Instalation troubleshooting

6 failing tests

It is due to PIL not installed with JPEG support you can follow this guide.

Testing

  • To run all tests

    python manage test elections
    
  • To check code coverage

    python manage.py test_coverage elections
    

Translation and internationalization

Getting started

If you run python manage.py runserver and open http://127.0.0.1:8000/ you should see the Spanish version in your browser.

Create a local_settings.py file, and edit settings as appropriate:

cp local_settings.py.example local_settings.py

Creating a new translation

The following commands assume your locale code is en. Replace it as appropriate with the ISO 639-1 code for your locale. The locale code you choose below must match the LANGUAGE_CODE in local_settings.py.

Manually

First, create or update the django.po file for your locale:

django-admin.py makemessages -l en

You will find the file in locale/en/LC_MESSAGES. You can now edit the .po file by hand or with a variety of editors.

Transifex

You may prefer to use Transifex to translate the .po file:

  • Go to Candideit's Transifex page
  • Click "Add new translation"
  • Select your language and click "Translate online"

Once your translations are done, notify a Candideit maintainer, and they can pull your translations into the project.

Important reminders

  • Keep the same case: translate "NOMBRE DE LA ELECCIÓN:" as "ELECTION NAME:" not "Election name:"
  • Keep all punctuation: translate "NOMBRE DE LA ELECCIÓN:" as "ELECTION NAME:" not "ELECTION NAME"

Using your translations

To use your translation, you need to compile the .po file to a .mo file:

python manage.py compilemessages