-
Notifications
You must be signed in to change notification settings - Fork 3
Installing challenge 0.1
mboehn edited this page Oct 12, 2014
·
1 revision
challenge is tested with Apache2, modwsgi and MySQL. It's developed for Django 1.7 and Python 3. See https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/ for more information.
We recommend running it in an virtualenv.
After installing, you need to configure your challenge in the admin interface. Create a new Config and at least give it an event name. Activate the challenge when you are ready. (You need to activate it for testing too currently.)
aptitude install apache2 libapache2-mod-wsgi-py3 mysql-server python-virtualenv python3-pip git
- Set up MySQL-database. Create database and grant privileges.
virtualenv -p /usr/bin/python3 /var/www/ENV-challenge
git clone https://github.com/Pr0jectX/challenge.git /var/www/challenge
cd /var/www/challenge
cp challenge/settings_local.example.py challenge/settings_local.py
- Edit challenge/settings_local.py. Configure database and other settings as needed.
source /var/www/ENV-challenge/bin/activate
pip install -r requirements.txt
./manage.py migrate
./manage.py createsuperuser
./manage.py collectstatic
- Configure Apache 2
- Replace /etc/apache2/sites-available/default with:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
Alias /media/ /var/www/challenge/media/
Alias /static/ /var/www/challenge/static/
WSGIScriptAlias / /var/www/challenge/challenge/wsgi.py
WSGIDaemonProcess challenge python-path=/var/www/challenge:/var/www/ENV-challenge/lib/python3.2/site-packages
WSGIProcessGroup challenge
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
service apache2 restart
While this may not be considered best practice for Django deployments on Debian, it's a quick and dirty way of getting challenge up and running.