GithubHelp home page GithubHelp logo

picker's Introduction

Command which you need:

sudo apt-get install python-dev
sudo easy_install -U gunicorn
sudo apt-get install nginx
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.1 
sudo apt-get install python-lxml

Unwrap project:

git clone git://github.com/alexkos/picker.git
pip install -r requirements.txt


Copy and put your settings from local_settings_default.py in local_settings.py and add in git ignore which store into picker of directory: 

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', 
        'NAME': 'name_your_db',                      
        'USER': 'your_user_db',                     
        'PASSWORD': 'your_password',                  
        'HOST': 'localhost',             
        'PORT': '',                      
    }
}


EMAIL_HOST             = 'your_smpt_server'
EMAIL_HOST_USER        = 'your_email'
DEFAULT_FROM_EMAIL     = 'your_email'
EMAIL_HOST_PASSWORD    = 'your_password_email'
EMAIL_PORT             = 'port'

Must be installed PostgreSQL in system, if not then to make command:

sudo -u postgres createuser -P name_user_db
su postgres
psql
CREATE DATABASE database_name OWNER name_admin ENCODING 'UTF8';

Edit the Postgres permissions in /etc/postgresql/9.1/main/pg_hba.conf by adding a line as follows after the postgres user line:

local      database_name   name_user_db   md5
host all all 0.0.0.0/0  md5

Then:
sudo /etc/init.d/postgresql restart

After installing psycopg:

pip install psycopg2 
		or
easy_installed psycopg2

Create tables in django project:
./manage.py syncdb

username: name_admin
email:your_email
password: password

Then to perform command in root project, where is 
./manage.py migrate capturing

./manage.py collectstatic

Put in *.sh script:

#!/bin/bash
  set -e
  #Create file and give it access rights:
  LOGFILE=/var/log/gunicorn/picker.log 
  LOGDIR=$(dirname $LOGFILE)
  NUM_WORKERS=2
  # user/group to run as
  # (username) and (usergroup)
  USER=user  
  GROUP=user
  echo "start service"
  cd /home/user/project/picker
  test -d $LOGDIR || mkdir -p $LOGDIR
  gunicorn_django -w $NUM_WORKERS \
    --user=$USER --group=$GROUP --daemon --log-level=debug \
    --log-file=$LOGFILE 2>>$LOGFILE 


Create conf file for nginx:

server {
    listen   80;
    server_name yourdomain_name.domain;
    # no security problem here, since / is alway passed to upstream
    root /path/to/your/project/;
    # serve directly - analogous for static/staticfiles
    location /media/ {
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }
    location /static/ {
        alias /path/to/your/project/staticfiles/;
        autoindex off;

     }
    location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_read_timeout 10;
        proxy_pass http://localhost:8000/;
    }
    # what to serve if upstream is not available or crashes
    error_page 500 502 503 504 /media/50x.html;
}


If appear problem with database, use command:

./manage.py dbshell

Perform command in:

ALTER TABLE capturing_textsite ADD COLUMN text_tsv tsvector;
CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON capturing_textsite FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(text_tsv, 'pg_catalog.english', text);
CREATE INDEX capturing_textsite_tsv ON capturing_textsite USING gin(text_tsv);
UPDATE capturing_textsite SET text_tsv=to_tsvector(text);

http://se888.wordpress.com/2012/05/26/%D0%BF%D0%BE%D0%BB%D0%BD%D0%BE%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%BE%D0%B2%D1%8B%D0%B9-%D0%BF%D0%BE%D0%B8%D1%81%D0%BA-%D0%B4%D0%BB%D1%8F-django-2/



added in local_setting for django-sphinx:

SPHINX_SERVER = 'localhost'
SPHINX_PORT = 9312
SPHINX_API_VERSION = 0x116

picker's People

Contributors

alexkos avatar

Watchers

 avatar  avatar

Forkers

kurmaev

picker's Issues

markup

must be six pages:
1 Main page when user doesn't logging
2 Registration
3 Where will be entering url
4 My sites (at left url, at right index of number pages)
5 Display index - when user click on url site
6 Page search word in text of site pages

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.