Skip to content

v-adhithyan/india-elections

Repository files navigation

india-elections Waffle.io - Columns and their card count

Build Status codecov

Lets visualize India elections 2019 . (UPS vs NDA). [Work in progress.]

Prerequisites

Running in local

  • Clone this repostiory git clone https://github.com/v-adhithyan/india-elections
  • cd to the repo cd india-elections
  • Create virtualenv virtualenv elections
  • Activate virtualenv source elections/bin/activate
  • Install dependencies pip install -r requirements.txt
  • create a .env file and add the following contents and replace secrets with your's
    DJANGO_SETTINGS_MODULE='indiaelections.settings'
    SENTRY_TOKEN='your sentry token'
    TW_CONSUMER_KEY='your twitter consumer key'
    TW_CONSUMER_SECRET='your twitter consumer secret'
    TW_ACCESS_TOKEN='twitter access token'
    TW_ACCESS_TOKEN_SECRET='twitter access token secret'
    DB_HOST = "localhost"
    DB_NAME='indiaelections'
    DB_USERNAME='indiaelections'
    DB_PASSWORD='some password'
    MYSQL='0'
    MEMCACHE_DISTRIBUTED='0'
    MEMCACHE_LOCATION='memcache host'
    MEMCACHE_USERNAME='memcache username'
    MEMCACHE_PASSWORD='memcache password'
    DEV_STATIC='1'
    PC_HOST='localhost'
    
  • Migrate the app python manage.py migrate
  • Bootstrap the server with some data python manage.py setup_dev_env
  • Start server python manage.py runserver
  • Open browser and go to localhost:8000/ - You will see India elections 2k19 - visulizations

Pre commit hooks

At the root directory, run the following command to add pre commit hook.

flake8 --install-hook git
git config --bool flake8.strict true

POC

Contributors

Todo

  • Use pre-commit library for pre-commit hooks
  • Write more unit tests/ fix failing tests
  • Add contributing and Pull request template
  • Refactor code, use wily, rope, improve maintainabilty

License

  • MIT