Coder Social home page Coder Social logo

pserwylo / electionleaflets Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openaustralia/electionleaflets

0.0 1.0 0.0 30.38 MB

Live election leaflet monitoring for Australia.

Home Page: http://www.electionleaflets.org.au/

Ruby 0.07% Python 1.02% PHP 84.79% JavaScript 12.65% Perl 1.45% Shell 0.02%

electionleaflets's Introduction

Setup Instructions

The electionleaflets folder has to be hosted on an Apache HTTP server. A sample Apache configuration file is supplied in electionleaflets/config/dev.electionleaflets.org.au.

The includes, includes/PEAR and config folders must be added to the PHP include_path variable which is set in the example Apache configuration file or can be set in an Apache .htaccess file eg. https://groups.google.com/d/topic/openaustralia-dev/fg1dENEjm18/discussion

The timezone must also be set as a PHP variable eg. php_value date.timezone "America/Chicago" in a .htaccess file.

PHP

Requires cURL, php5-imap, php5-gd, php-mbstring

Database

Create a MySQL database using the script in schema/electionleaflets.sql and schema/australian_postcodes.sql

echo "CREATE DATABASE electionleaflets" | mysql
cat schema/electionleaflets.sql | mysql electionleaflets
cat schema/australian_postcodes.sql | mysql electionleaflets

Config file

Make a copy of config/general.php.example as config/general.php then edit the variables for you local setup.

You must point it to the MySQL database you just created and set ROOT_DIR, VHOST_DIR, WWW_SERVER, ADMIN_SERVER, and DOMAIN appropriately.

Folder structure

Run these commands to create the following folders:

mkdir -p data/smarty_compile
mkdir -p data/cache
mkdir -p data/temp
mkdir -p data/images
mkdir -p data/images/small
mkdir -p data/images/original
mkdir -p data/images/large
mkdir -p data/images/medium
mkdir -p data/images/thumbnail

Also ensure they are writable by the webserver.

On a SELinux based distro (Fedora, RHEL, CentOS etc.) you will also have to give these folders the correct security context

chcon -Rv -t httpd_sys_content_t data

Setting up an election

To run Election Leaflets you need to collect and upload some data about the election, things like its name and what parties are running candidates.

Requirements

You'll need to collect the following data before you begin:

  • Election name and date
  • A list of parties running candidates
  • A list of categories important to this election
  • A list of constituency names
  • Mappings between postcodes and constituency names (e.g. 2042, Sydney)

Set up

There is an admin interface available at /admin/ of every Election Leaflets install. To access it you need to set a username password in the general.php configuration file. From there it should be pretty self-explanatory.

It's important to note that elections created via this interface are not immediately visible. In the election table you will need to set the enabled field to '1' for it to go live - think of this as a final sanity check.

DANGER

You have the ability to edit elections. If there are already leaflets uploaded for an election this is probably Not A Good Idea as you can remove parties and categories that may already have data uploaded.

With great power...

Help

If you need any help, contact the OpenAustralia Community list.

map (django application)

The map is actually a separate django application. To get this working you will need the following installed:

python-django
python-mysqldb
libgeos-c1
python-gdal
proj
libapache2-mod-python
python-imaging

electionleaflets's People

Watchers

 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.