Giter Site home page Giter Site logo

jooddang / pokr.kr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teampopong/pokr.kr

0.0 2.0 0.0 43.39 MB

Pokr [ˈpō-kər] - Politics in Korea

Home Page: pokr.kr

License: Apache License 2.0

Shell 0.14% Python 35.84% CSS 9.53% JavaScript 28.15% Makefile 0.12% Mako 0.08% HTML 26.12%

pokr.kr's Introduction

Pokr - Politics in Korea

Pull requests are always welcome.

Installation

  1. Install dependencies

    • Ubuntu

        $ sudo apt-get install nodejs postgresql-9.3 npm python-psycopg2 node-less node-uglify
        $ sudo pip install -r requirements.txt
        $ sudo make install
      

<<<<<<< HEAD - Mac OS X

        $ brew install node postgresql
        $ npm install less uglify-js -g
        $ pip install -r requirements.txt
        $ pip install psycopg2
        $ make install

======= Install postgresql (http://www.postgresql.org/download/) Install nodejs to use npm (http://nodejs.org/download/) Install Redis (http://redis.io/download) (sudo)# apt-get update (sudo)# apt-get install python python-dev python2.7 libpq-dev libevent-dev (sudo)# npm install less uglify-js@1 -g - Mac OS X:

        Install Homebrew (http://mxcl.github.com/homebrew/)
        Install nodejs to use npm (http://nodejs.org/download/)
        Install Redis (http://redis.io/download)
        (sudo)# brew install python postgresql libevent
        (sudo)# initdb /usr/local/var/postgres -E utf8
        (sudo)# npm install less uglify-js@1 -g

added troubleshooting for macosx

  1. Create & modify configuration files

     $ make init
     $ createuser postgres
    
    • Set password for user "postgres" in PostgreSQL
    • Modify alembic.ini
      • ID_HERE: postgres id (ex: postgres)
      • PASSWD_HERE: postgres pw
      • HOST_HERE: postgres host (ex: localhost)
  2. Create & init DB (You should first obtain a pokrdb.dump from here)

<<<<<<< HEAD $ sudo -u postgres psql -h localhost -U postgres -c 'CREATE DATABASE pokrdb;' $ sudo -u postgres psql -d pokrdb -f pokrdb.dump $ ./shell.py db init $ alembic stamp head

  1. Install python packages

  2. Create & modify configuration files:

    • Do make init
    • Then, settings.py should be created.
    • In alembic.ini, modify as below.
      • ID_HERE: postgres id
      • PASSWD_HERE: postgres pw
      • HOST_HERE: postgres host

added troubleshooting for macosx

Run Server

<<<<<<< HEAD $ ./run.py [-d] [-l LOCALE] [--port PORT]

    $ make init_db

added troubleshooting for macosx

Update Data

  1. Bills

     $ ./shell.py bill update "some/where/*.json" # from files
     $ ./shell.py bill update --source redis  # from Redis queue
     $ ./shell.py bill update --source db  # existing bills of the current session
    
  2. Bill Keywords

     $ ./shell.py bill_keyword update "some/where/*.txt"
    
  3. Candidacies

     $ ./shell.py candidacy update "some/where/*.json"
    

<<<<<<< HEAD

Run Server

$ ./run.py [-d] [-l LOCALE] [--port PORT]

Troubleshooting

  • Mac OS X:
    • Trouble with installing psycopg2 -> install postgresql first.
      • brew install postgresql
    • Trouble with installing gevent -> install libevent first.
      • brew install libevent
      • export LDFLAGS=-L/usr/local/lib/
      • export CFLAGS=-I/usr/local/include/
      • sudo pip install gevent
    • Before doing createdb (postgres), do:
      • postgres -D /usr/local/var/postgres
    • env: python2: No such file or directory
      • sudo ln -s /usr/bin/python /usr/bin/python2
      • On Mac, you don't have python2. Thus, make a symbolic link.
    • You need latest version of sqlalchemy before doing make init_db
      • sudo pip install --upgrade sqlalchemy
    • Trouble with installing konlpy (Mac OS X version >= 10.9)
      1. It requires JPype1 before installing konlpy.
      2. Download latest version of jpype from here
      3. setup.py of JPype1 has an error to locate jdk path. You should correct it first.
        1. java_home in line 52~54 should be '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/'
        2. Insert this at the first line of def getJDKIncludes(java_home):
          • java_home = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/'
        3. Yes, you should have Xcode.app first. (It's free!)

added troubleshooting for macosx

License

Apache v2.0

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.