django-apache
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
django-apache [2014/06/12 14:48] – kobe | django-apache [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Deploy di Django su Apache2 ====== | ||
- | |||
- | Abbiamo deciso di collocare la directory dell' | ||
- | cd /usr/local | ||
- | git clone $url | ||
- | |||
- | Creare un branch locale di deploy: | ||
- | git checkout -b deploy | ||
- | |||
- | Configurare il settings.py in base alle istruzioni e alle singole esigenze dell' | ||
- | cd $nome_progetto | ||
- | cp $nome_progetto/ | ||
- | |||
- | Raccogliere i file statici (la procedura puo' variare a seconda dell' | ||
- | mkdir static | ||
- | python manage.py collectstatic | ||
- | |||
- | Aggiungere in settings.py queste 2 righe: | ||
- | STATIC_URL = '/ | ||
- | STATIC_ROOT = '/ | ||
- | |||
- | Controllare i permessi, impostare il database e installare le dipendenze, facendo riferimento alla documentazione dell' | ||
- | |||
- | Creare il file $nome_progetto/ | ||
- | import os, sys | ||
- | os.environ.setdefault(" | ||
- | sys.path = ['/ | ||
- | from django.core.wsgi import get_wsgi_application | ||
- | application = get_wsgi_application() | ||
- | |||
- | NB: corregge il path assoluto | ||
- | |||
- | Creare il file di deploy di Apache su / | ||
- | < | ||
- | ServerAdmin webmaster@befair.it | ||
- | ServerName $server_name | ||
- | DocumentRoot / | ||
- | WSGIScriptAlias / / | ||
- | Alias /static / | ||
- | < | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | </ | ||
- | < | ||
- | Order allow,deny | ||
- | Allow from all | ||
- | <Files $nome_progetto/ | ||
- | Require all granted | ||
- | </ | ||
- | </ | ||
- | ErrorLog ${APACHE_LOG_DIR}/ | ||
- | # Possible values include: debug, info, notice, warn, error, crit, | ||
- | # alert, emerg. | ||
- | LogLevel warn | ||
- | CustomLog ${APACHE_LOG_DIR}/ | ||
- | </ | ||
- | |||
- | Attivare il virtual host e ricaricare Apache: | ||
- | ln -s / | ||
- | service apache2 reload |
django-apache.1402584491.txt.gz · Last modified: 2014/10/28 11:28 (external edit)