(legacy) Django remote-control database project https://rc-db.ch

Oliver Ladner 03de4963ec commit yes 4 years ago
calc 03de4963ec commit yes 4 years ago
event 836bd56830 remove obsolete apps (registration, django_openid_auth 8 years ago
hardwaredb 836bd56830 remove obsolete apps (registration, django_openid_auth 8 years ago
news 836bd56830 remove obsolete apps (registration, django_openid_auth 8 years ago
rcdb 7e2b817b0a outsource sensitive config data from settings.py 8 years ago
rcdb_core 6ca2980d47 fix django date calculation when using USE_TZ = True (timezone) 8 years ago
scraper 2cc9de8d13 add APC scraping info 8 years ago
software 78cd1deda1 added JQuery tablesorter plugin 10 years ago
static 55cd7068ab add bootstrap input class to unitconverter, cleanup JS 8 years ago
templates 03de4963ec commit yes 4 years ago
userprofile d9be98d64b gravatar configuration 8 years ago
.gitignore 7e2b817b0a outsource sensitive config data from settings.py 8 years ago
.siegerc 6e3381bee7 added siege configuration 7 years ago
README.md 2e74873328 Document timezone changes + pytz requirement 8 years ago
deploy.sh e5393f3087 add "Build" prefix to release version 8 years ago
manage.py 89a63feead manage.py executable 8 years ago
requirements.txt 2e74873328 Document timezone changes + pytz requirement 8 years ago
siege_urls.txt 6e3381bee7 added siege configuration 7 years ago
tag.sh 4683cc0ea0 tag.sh now only shows untagged commits 9 years ago

README.md

RCDB installation instructions for Debian 7.x

Required packages

  • libapache2-mod-wsgi
  • python-dev
  • python-pip
  • libmysqlclient-dev (required for MySQL-python pip module)
  • solr-jetty
  • memcached

Python/Django

virtualenvwrapper & pip

Source: http://www.jeffknupp.com/blog/2013/12/18/starting-a-django-16-project-the-right-way/

As root:

pip install virtualenvwrapper

# Enable MySQL timezone support
# https://docs.djangoproject.com/en/1.8/ref/databases/#time-zone-definitions
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot mysql

As user:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=/var/www/rcdb
source /usr/local/bin/virtualenvwrapper.sh

mkvirtualenv rcdb
git clone user@lugh.ch:/var/www/git/rcdb /var/www/rcdb
cd /var/www/rcdb
pip install -r requirements.txt

Apache

Needed modules

a2enmod wsgi rewrite auth_digest

WSGI/Django specific config bits

Alias /static/admin "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin"
Alias /static "/var/www/virtsrv/rc-db.ch/static"
WSGIDaemonProcess rc-db.ch python-path=/var/www/rcdb:/home/FIXME/.virtualenvs/rcdb/lib/python2.7/site-packages
WSGIScriptAlias / /var/www/rcdb/rcdb/wsgi.py
WSGIProcessGroup rc-db.ch

<Directory /var/www/rcdb/rcdb>
        <Files wsgi.py>
                Order deny,allow
                Allow from all
        </Files>
</Directory>

<LocationMatch "/admin|/FIXME">
        AuthType Digest
        AuthName "lugh"
        AuthDigestProvider file
        AuthUserFile /var/www/.htdigest
        Require user FIXME
</LocationMatch>

<Directory /var/www/rcdb/rcdb>
        <Files wsgi.py>
                Order deny,allow
                Allow from all
        </Files>
</Directory>

Workaround for OpenID module (ImportError: No module named defaults)

Edit ~/.virtualenvs/rcdb/lib/python2.7/site-packages/django_openid_auth/urls.py Change import to

from django.conf.urls import patterns, url, include

See http://stackoverflow.com/questions/19962736/django-import-error-no-module-named-django-conf-urls-defaults

Solr