-
Notifications
You must be signed in to change notification settings - Fork 2
Running the server
Django ships as a framework to run inside a separate (enterprise grade) web server like Apache. However, it also ships with a development server to allow you get up and coding as quickly as possible. Details for getting both running are below.
Once you have got the server running, you should be able to log in and view active use of the server, find details of users registered and congas created.
This is simple. Just change directory to the "server" directory in your repository and run: python manage.py runserver
This should say something like:
Validating models...
0 errors found
July 02, 2013 - 12:28:30
Django version 1.5.1, using settings 'server.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
At this point, you should be able to connect to the server using http://localhost:8000/conga.
The production server uses PostgreSQL+Apache+mod_wsgi+Django to server up the pages. To start this system for the first time, you need to initialize the database as follows.
- cd /<root>/server
- python2.7 manage.py syncdb --settings=server.settings_production
- (Enter admin user of your choice when prompted)
- python2.7 manage.py migrate --settings=server.settings_production
Once the database is ready, you need to configure apache to load your application. Edit the apacahe config file (usually /etc/httpd/conf/httpd.conf or /etc/apache2/apache2.conf) to contain the following (where <root> is the root of your piconga code).
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /<root>/server/server/wsgi.py
<Directory /<root>/server/server>
Order allow,deny
Allow from all
</Directory>
Alias /static/ /<root>/server/static/
<Directory /<root>/server/static>
Order deny,allow
Allow from all
</Directory>
Now edit your application entry point to set up the environment correctly inside mod_wsgi.
- vim <root>/server/server/wsgi.py
- Change "path = '/usr/local/piconga/server'" to "path = '/<root>/server'
Now restart your apacher server.
- service httpd restart (for CentOS)
- service apache2 restart (for R-Pi)
Finally, you need to synchronize your static files from the project into the server.
- cd /<root>/server
- python2.7 manage.py collectstatic --settings=server.settings_production
At this point, you should be able to connect to the server using http://localhost/conga.
TBD - sections on basic login, finding users and congas, blacklisting users.