Commit b126aced authored by Daniel Stan's avatar Daniel Stan

[django/nginx] Gestion centralisée des staticfiles

Lancer ./manage.py collectstatic pour peupler var/static/
avec tous les fichiers nécessaires à nginx.
parent 9a3def32
var/*
!var/.keep
*.pyc
*~
*.sqlite
......
# -*- coding: utf-8 -*-
# Django settings for intranet project.
import os
# Imports des secrets (plus tard, mais pas en debug)
import sys
sys.path.append("/etc/crans/secrets")
......@@ -34,6 +35,8 @@ except ImportError:
ROOT_PATH = '/usr/local/django/intranet/'
else:
raise ValueError(u"Location unknown")
STATIC_ROOT = os.path.abspath(os.path.join(ROOT_PATH, 'var/static'))
# Utiliser la base LDAP de test ?
BASE_LDAP_TEST = False
......@@ -85,6 +88,7 @@ else:
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(ROOT_PATH, 'static'),)
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
......@@ -213,6 +217,7 @@ INSTALLED_APPS = (
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.staticfiles',
#'south',
'reversion',
) + tuple( 'apps.%s' % app['name'] for app in INTRANET_APPS )
......
......@@ -29,12 +29,9 @@ server {
}
location /static {
alias /usr/local/django/intranet/static;
alias /usr/local/django/intranet/var/static;
}
location /media {
alias /usr/share/pyshared/django/contrib/admin/media;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment