Code Monkey home page Code Monkey logo

govtrack.us-web's Introduction

GovTrack website frontend

This repo contains the source code of the front-end for www.GovTrack.us. The data-gathering scripts are elsewhere.

Installation

GovTrack.us runs on Ubuntu 12.10.

  • Install dependencies via OS package manager:

    apt-get install git python-virtualenv python-lxml python-openid python-oauth2 \
        python-iso8601 python-numpy python-scipy
    
  • Clone the source code. Besides this project, you'll also need @unitedstates/congress-legislators which is where legislator and committee information come from.

    git clone https://github.com/unitedstates/congress-legislators   
    git clone --recursive https://github.com/govtrack/govtrack.us-web.git
    
  • Change directory to the source code root:

    cd ./govtrack.us-web/
    
  • Run the build script to install additional dependencies into a virtual environment:

    ./build/buildenv.sh
    
  • Create a local settings file based on the example file:

    cp settings_local.example.py settings_local.py
    
  • Edit settings_local.py to set up your database. The default configuration uses SQLite as the database and no database configuration is required. Fill in SECRET_KEY though. Here's how you can generate a SECRET_KEY:

    ./manage.py generate_secret_key
    
  • To enable search (for which complete instructions haven't been provided, so really skip this):

  • Initialize the database and minify some files:

    ./manage.py syncdb
    ./minify
    
  • Load some data:

    wget http://www.govtrack.us/data/db/django-fixture-{people,usc_sections,billterms}.json
    ./manage.py loaddata django-fixture-people.json
    ./manage.py loaddata django-fixture-usc_sections.json
    ./manage.py loaddata django-fixture-billterms.json
    
    ./parse.py committee # fails b/c meeting data not available
    
    ./build/rsync.sh
    ./parse.py bill --congress=113 --disable-index --disable-events
    ./parse.py vote --congress=113 --disable-index --disable-events
    

If you configured Solr, you can remove --disable-index. For the sake of speed, --disable-events will skip the creation of the events table for bills, which is the basis for feeds and tracking, so that will be nonfunctional.

  • Check the site works by running the development server and visiting the URL specified by the runserver process.

    ./manage.py runserver
    
  • To update the data in the future, first git-pull the congress-legislators repo to get the latest legislator information. Then:

    build/rsync.sh
    ./parse.py person
    ./parse.py committee --congress=113
    ./parse.py bill --congress=113
    ./parse.py vote --congress=113
    
  • TODO: We haven't set up any search indexing, so all of the search pages will come up empty.

govtrack.us-web's People

Contributors

joshdata avatar lorien avatar gphemsley avatar wpoosanguansit avatar

Watchers

Ivica Nedeljkovic 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.