GithubHelp home page GithubHelp logo

zhexiao / kweets Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.1 MB

Using python streaming twitter data

License: Apache License 2.0

Python 8.88% CSS 20.94% HTML 5.63% JavaScript 64.35% Shell 0.19%
django python twitterapi gevent redis mysql uwsgi supervisor

kweets's Introduction

kweets

This is description of kweets

Table of Contents

## Requirements - Django 1.9.* - Django Rest Framework - Mysql && Redis - Gevent - Twitter API - VirtualEnv ```shell $ virtualenv -p python3 env ```
  • Django and Django Rest Framework
    $ pip install django
    $ django-admin startproject kweets

    $ pip install djangorestframework
    $ pip install markdown       # Markdown support for the browsable API.
    $ pip install django-filter  # Filtering support
  • Mysql && redis
    $ sudo apt-get install python3-dev libmysqlclient-dev
    $ sudo apt-get install redis-server

    $ pip install mysqlclient
    $ pip install redis
  • Gevent
    $ pip install wheel
    $ pip install setuptools 'cython>=0.23.4' git+git://github.com/gevent/gevent.git#egg=gevent
  • Twitter API
    $ pip install TwitterAPI
## Application Config - Upstart config ```shell $ sudo vim /etc/init/kweets.conf
description "uWSGI instance to serve kweets"

start on runlevel [2345]
stop on runlevel [!2345]

setuid vagrant
setgid www-data

script
    uwsgi --ini /vagrant/kweets/kweets.ini
end script

# start the service
$ sudo start kweets

# restart the service
$ sudo restart kweets    

- Uwsgi config
```shell
    [uwsgi]
    chdir = /vagrant/kweets
    home = /vagrant/kweets/env
    module = kweets.wsgi:application

    uid = vagrant
    gid = www-data

    master = true
    processes = 5

    socket = /tmp/kweets.sock
    chmod-socket = 664
    vacuum = true  
  • Nginx config
    server {
        listen 82;
        server_name 127.0.0.1;

        location = /favicon.ico { access_log off; log_not_found off; }

        location / {
            include uwsgi_params;
            uwsgi_pass unix:/tmp/kweets.sock;
        }

        location /static/ {
            root /vagrant/kweets;
        }
    }
- Running Web Server ```shell $ sudo start kweets $ sudo service nginx start ```
  • Running Twitter Streaming API
    $ python tweets/scripts/tw_streaming.py 

kweets's People

Contributors

zhexiao avatar

Watchers

 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.