Commit 7a651be8 authored by Okhin's avatar Okhin

README and requirements \o/

parent 7e2ad058
# Net Neutrality MONitor
This django application is used to collect data about net neutrality violation,
to allow a name and shame policy.
# Setup
You have to clone this branch (django-1.8) to get the latest source code.
The recommended way is to use a virtualenv and to run the app through apache and
uwsgi.
## System dependencies
You need to install some development package to activate al the needed python
modules.
sudo apt-get install libxml2-dev libxslt-dev build-essential python-dev libsqlite3-dev libjpeg-dev zlib1g-dev libapache2-mod-uwsgi libapache2-mod-wsgi uwsgi-plugin-python libfreetype6-dev uwsgi
## Create a virtualenv
The recommended way is to install a python-virtualenv and to run the django
application from there.
virtualenv nnmon-env
source nnmon-env/bin/activate
## Get the source
You need to git clone the repository:
git clone http://git.laquadrature.net/la-quadrature-du-net/respect-my-net.git respect-my-net
## Install the module dependencies
Now, you need to install all the needed python modules, with pip.
pip install --upgrade -r nnmon-requirements.txt
## Configure django
Edit the configuration file for django. Pay special attention to DEBUG, various
path and SECRET_KEY settings. Next you need to setup the database, using the
manage.py tool.
python manage.py migrate
## Set-up uwsgi
You need to create an application for uwsgi. Create a file in
/etc/uwsgi/apps-available with the fllowing content. Adapat to your needs and
read the documentation:
[uwsgi]
plugins = python
uid = www-data
pythonpath = /home/rmn/respect-my-net
module = nnmon.wsgi:application
env = DJANGO_SETTINGS_MODULE=nnmon.settings
chdir = /home/rmn/respect-my-net
home = /home/rmn/nnmon-env
vacuum = True
master = True
max-requests = 5000
pidfile = /run/uwsgi/app/rmn/pid
daemonize = /var/log/uwsgi/rmn.log
socket = /run/uwsgi/app/rmn/socket
PythonPath is where the django app is based (ie: the root of the git
repository), chdir is the same path. Home, is the path of the virtualenv created
above.
Now you need to activate the apps by creating a symoblic link into
/etc/uwsgi/apps-enabled, and to restart uwsgi.
cd /etc/uwsgi/apps-enabled
ln -s ../apps-available/nnmond.conf
service restart uwsgi
## Set-up apache
You need to setup apache (or nginx depending on what you prefer). First, you
need to actvivate the uwsgi module:
a2enmod uwsgi
service apache2 restart
And now you need to create a VirtualHost in
/etc/apache2/sites-availabe/nnmon.conf
<virtualhost *:80>
ServerName rmn.example.com
SetHandler uwsgi-handler
uWSGISocket /run/uwsgi/app/rmn/socket
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %T
%{Host}i" alternc
CustomLog /var/log/apache2/access.log alternc
ErrorLog /var/log/apache2/rmn.error.log
</virtualhost>
You need to activate the website and the to reload apache. Of course, for
production use, you should use a TLS VirtualHost.
a2ensite nnmon
service apache2 reload
Babel==2.1.1
BabelDjango==0.2.2
BeautifulSoup==3.2.1
Django==1.8.6
Pillow==3.0.0
South==1.0.2
argparse==1.2.1
django-ajax-selects==1.4.1
django-contrib-comments==1.6.1
django-registration==2.0a0
django-simple-captcha==0.4.6
django-tastypie==0.12.2
django-tinymce==2.0.6
## FIXME: could not find svn URL in dependency_links for this package:
flup==1.0.3.dev-20110405
httplib2==0.9.2
lxml==3.5.0
oauth2==1.9.0.post1
odslib==1.0.2
pysqlite==2.8.1
python-dateutil==2.4.2
python-mimeparse==0.1.4
python-twitter==0.8.2
simplejson==3.8.1
six==1.10.0
wsgiref==0.1.2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment