forked from DGNum/gestioCOF
Ajout de MEDIA_{ROOT,URL}
This commit is contained in:
parent
58cade22d3
commit
cd73d4e96d
3 changed files with 17 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,3 +7,4 @@ settings.py
|
||||||
venv/
|
venv/
|
||||||
.vagrant
|
.vagrant
|
||||||
/src
|
/src
|
||||||
|
media/
|
||||||
|
|
|
@ -116,6 +116,12 @@ USE_TZ = True
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/static/'
|
||||||
|
|
||||||
|
# Media upload (through ImageField, SiteField)
|
||||||
|
# https://docs.djangoproject.com/en/1.9/ref/models/fields/
|
||||||
|
|
||||||
|
MEDIA_ROOT = './media/'
|
||||||
|
MEDIA_URL = '/media/'
|
||||||
|
|
||||||
# Various additional settings
|
# Various additional settings
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
|
||||||
|
|
11
cof/urls.py
11
cof/urls.py
|
@ -1,4 +1,8 @@
|
||||||
|
# -*-coding:utf-8 -*
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import patterns, include, url
|
||||||
|
from django.conf.urls.static import static
|
||||||
|
|
||||||
import autocomplete_light
|
import autocomplete_light
|
||||||
|
|
||||||
|
@ -69,4 +73,9 @@ urlpatterns = patterns(
|
||||||
url(r'^utile_bda/bda_diff$', 'gestioncof.views.liste_bdadiff'),
|
url(r'^utile_bda/bda_diff$', 'gestioncof.views.liste_bdadiff'),
|
||||||
url(r'^utile_cof/diff_cof$', 'gestioncof.views.liste_diffcof'),
|
url(r'^utile_cof/diff_cof$', 'gestioncof.views.liste_diffcof'),
|
||||||
url(r'^utile_bda/bda_revente$', 'gestioncof.views.liste_bdarevente'),
|
url(r'^utile_bda/bda_revente$', 'gestioncof.views.liste_bdarevente'),
|
||||||
)
|
) + \
|
||||||
|
(static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
if settings.DEBUG
|
||||||
|
else [])
|
||||||
|
# Si on est en production, MEDIA_ROOT est servi par Apache.
|
||||||
|
# Il faut dire à Django de servir MEDIA_ROOT lui-même en développement.
|
||||||
|
|
Loading…
Reference in a new issue