-
Notifications
You must be signed in to change notification settings - Fork 0
installing
Ubuntu linux - recommended. Known to run on FreeBSD as well
- MySQL 5.1+ for RDBMS
- Python 2.7.x for runtime
- NGINX is used as a reverse proxy & caching backend
- memcached is used to cache common requests
sudo apt-get install mysql, libmysqlclient-dev, nginx, uwsgi, memcached
sudo easy_install Django, South, MySQL-python
We need API Key, to allow other tools to talk to the main server. Generate it using openssl rand -hex 16 And define database connections - they are intentionally separated and can basically be managed by multiple servers.
SYNET_API_KEY = '5d637c8b98ffd1c4d4f9cc3c8bf33884'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'synet',
'USER': 'synet',
'PASSWORD': 'synet',
'HOST': 'localhost',
'PORT': '',
},
'epg': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'epg',
'USER': 'synet',
'PASSWORD': 'synet',
'HOST': 'localhost',
'PORT': '',
}
}
During this process, you'll be prompted to enter an admin user name. python manage.py syncdb --database=default python manage.py migrate --all --database=default python manage.py syncdb --database=epg
python manage.py runserver
you should be able to access the admin site via http://localhost:8000/synet/admin
-
NGINX is a powerful load balancer, static file server and acts as a proxy to an application engine.
-
uWSGI is a container to run the Python and ensure its operational.
-
documentation on NGINX+uWSGI+DJANGO
description "SYNET backend [uWSGI]"
start on runlevel [2345] stop on runlevel [!2345]
respawn exec /usr/bin/uwsgi
--home /home/router/reference-backend
--socket /var/run/synet.sock
--chmod-socket
--module synet_wsgi
--pythonpath /home/router/reference-backend