-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy path__init__.py
50 lines (44 loc) · 1.16 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
import os
import django
from django.conf import settings
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
template_engines = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
'DIRS': [os.path.join(PROJECT_ROOT, 'templates/django')],
'OPTIONS': {
'context_processors': [
'django.template.context_processors.request',
],
},
},
{
'BACKEND': 'django.template.backends.jinja2.Jinja2',
'APP_DIRS': True,
'DIRS': [os.path.join(PROJECT_ROOT, 'templates/jinja')],
'OPTIONS': {
'environment': 'tests.jinja_config.environment',
},
},
]
config = dict(
ALLOWED_HOSTS=['testserver'],
DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
},
ROOT_URLCONF='tests.urls',
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
},
TEMPLATES=template_engines,
)
settings.configure(**config)
django.setup()