GithubHelp home page GithubHelp logo

tomas1905 / candidatos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freedomvote/freedomvote

0.0 2.0 0.0 5.36 MB

A tool to represent the views of politicians and parties as a help to the voters.

Home Page: http://freedomvote.ch

License: GNU General Public License v3.0

Makefile 1.11% Python 46.20% HTML 25.48% CSS 18.52% JavaScript 8.66% Shell 0.04%

candidatos's Introduction

Freedomvote

A tool to represent the views of politicans as a help to the voters.

Used in

How does it look?

This is how Freedomvote looked for the Swiss Election in 2015 - freedomvote.ch

freedomvote.ch

Installation

The "hard" way

Requirements:

  • python 2.7
  • postgresql
  • libjpeg
  • zlib
  • python-pip

Run pip install -r requirements.txt to install all requirements.

Configure your DB settings and Secret in app/settings.ini: There is an example in the app/example.settings.ini

Please generate a new SECRET and don't commit it to your repository!

More infos about the Django Secret Django Secret

[DB]
NAME = freedomvote
USER = freedomvote
PASS = ***********
PORT = 5432
HOST = 127.0.0.1

[GLOBAL]
SECRET = GENERATE A SECRET

Edit the tools/docker/cache_table.sql file to change your database user, and then run:

$ psql -h <db_host> -U <db_user> <db_name> < tools/docker/cache_table.sql
$ python app/manage.py migrate
$ python app/manage.py createsuperuser
$ python app/manage.py runserver

Now you can access the frontend on http://localhost:8000

The easy way - Docker

To run Freedomvote in a docker container, you need to install docker and docker-compose and execute those commands:

$ make docker-init docker

Default user is admin with password 123qwe, to change this, run make docker-pw

Now you can access the frontend on http://localhost:8000

Django management

Django already provides a number of management commands out of the box. Other parts of this document already lists the usages of some of these commands. Freedomvote provides a couple of custom commands to ease the setup process:

$ python app/manage.py help
$ python app/manage.py help <command>
$ python app/manage.py generate_politicians 42
$ python app/manage.py politician_import examples/politician_import.json
$ python app/manage.py user_import examples/user_import.json

Languages

The whole application is multilingual. Per default the languages German, Italian and French are installed. The translation are located in app/locale/<lang_code>/LC_MESSAGES/django.po. After editing the translation, run python manage.py compilemessages

To install another language (English in this example) make the following steps:

app/freedomvote/settings.py

LANGUAGES = (
  ...
  ...
  ('en', _('english')),
)

then create a new folder for the language:

$ mkdir app/locale/en

now run those commands in your environment:

$ python manage.py makemigrations
$ python manage.py migrate
$ python manage.py makemessages
$ python manage.py compilemessages

or with docker:

$ make docker-makemigrations
$ make docker-migrate
$ make docker-makemessages
$ make docker-compilemessages

License

GPLv3 see LICENSE

candidatos's People

Contributors

nicorikken avatar andreabettich avatar anehx avatar fujexo avatar winged avatar marado avatar topaxi avatar

Watchers

James Cloos avatar Tomás Queface avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.