Giter Site home page Giter Site logo

ewatch's Introduction

Election Watch

To enable responsive governance and informed engagement with presidential elections, Election Watch project will raise awareness about electoral processes and enable informed engagement with presidential elections, through independent, credible and accessible educational content hosted on an this platform, including:

  • Developing voter educational materials to facilitate improved understanding of electoral processes, and the powers and constraints of the president,
  • Election monitoring to enable informed engagement with the presidential elections.

This repository contains the Web Server backend of the system. The platform backend is written in Django and provides admin access as well as API end points.

Running Django Locally

1 Django APIs

1.2 Setup

The backend engine is built on top of Django which we recommend to run it inside a virtual environment. In order to install the dependencies, use pip command and read all the dependencies from requirements.txt file:

pip install -r requirements.txt

1.3 Structure

There are three main applications inside the project directory (listed below).

  • ewatch: Main app to contain project configurations and settings
  • blog: Contains a simple and customized pseudo-blog application to take care of the blog-type content.
  • candidate: App to take care of Candidate profiles
  • timeline: App to take care of News timeline
  • preferences: Holds preferences data for the site

Other directories are:

  • locale: to take care of translations
  • STATIC: to hold static content for dev site, on production site they get stored on S3
  • MEDIA: to hold media uploads for the blog, on production site they get stored on S3
  • logs: to hold application, gunicorn, nginx and supervisor logs

2 Database

It's highly recommended to use PostgreSQL as your database since django fully supports it. However, using MySQL and other databases should be fine too. The current project works with Postgres as its default.

3 Configuration

Configuration of sensitive secrets inside the app should be handled through environment variables

Save the following into a file named environment

export BASE_DIR=<Absolute path of the project root directory>
export BUILD_ENV=<development|production>
export DATABASE_HOST=<host>
export DATABASE_USER=<username>

then run source environment to set the variables

4 Serving the application

Choosing Webserver depends on your previous experiences. The most straightforward webserver to test the application is Apache mod_wsgi.

In the Django root:

python manage.py runserver

ewatch's People

Contributors

aurangz avatar

Stargazers

saeed sajadi avatar

Watchers

James Cloos avatar  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.