1
0
Fork 0

Enable template caching

merge-requests/208/head
Nikos Roussos 2017-11-13 12:30:39 +02:00
parent fc8e8531e6
commit 3770791865
No known key found for this signature in database
GPG Key ID: BADFF1767BA7C8E1
2 changed files with 12 additions and 6 deletions

View File

@ -97,11 +97,9 @@ TEMPLATES = [
Path('db/templates').resolve(),
],
'OPTIONS': {
'debug': False,
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
@ -111,8 +109,10 @@ TEMPLATES = [
'db.base.context_processors.stage_notice',
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
('django.template.loaders.cached.Loader', [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
]),
],
},
@ -272,3 +272,9 @@ OPBEAT = {
'APP_ID': getenv('OPBEAT_APPID', None),
'SECRET_TOKEN': getenv('OPBEAT_SECRET', None),
}
if ENVIRONMENT == 'dev':
# Disable template caching
for backend in TEMPLATES:
del backend['OPTIONS']['loaders']
backend['APP_DIRS'] = True

View File

@ -19,7 +19,7 @@ services:
- db
- redis
environment:
- ENVIRONMENT=stage
- ENVIRONMENT=dev
- DEBUG=True
- DATABASE_URL=mysql://satnogsdb:satnogsdb@db/satnogsdb
- CACHE_BACKEND=redis_cache.RedisCache
@ -40,7 +40,7 @@ services:
- redis
- celery
environment:
- ENVIRONMENT=stage
- ENVIRONMENT=dev
- DEBUG=True
- DATABASE_URL=mysql://satnogsdb:satnogsdb@db/satnogsdb
- CACHE_BACKEND=redis_cache.RedisCache