|
9 | 9 | """ |
10 | 10 |
|
11 | 11 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
12 | | -import os |
13 | | -BASE_DIR = os.path.dirname(os.path.dirname(__file__)) |
| 12 | +from unipath import Path |
14 | 13 |
|
15 | 14 |
|
| 15 | +BASE_DIR = Path(__file__).ancestor(2) |
| 16 | +print BASE_DIR |
| 17 | + |
16 | 18 | # Quick-start development settings - unsuitable for production |
17 | 19 | # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ |
18 | 20 |
|
|
26 | 28 |
|
27 | 29 | ALLOWED_HOSTS = [] |
28 | 30 |
|
| 31 | +TEMPLATE_CONTEXT_PROCESSORS = ( |
| 32 | + 'django.contrib.auth.context_processors.auth', |
| 33 | + 'django.core.context_processors.debug', |
| 34 | + 'django.core.context_processors.i18n', |
| 35 | + 'django.core.context_processors.media', |
| 36 | + 'django.core.context_processors.static', |
| 37 | + 'django.core.context_processors.tz', |
| 38 | + 'django.contrib.messages.context_processors.messages', |
| 39 | + 'django.core.context_processors.request', |
| 40 | +) |
| 41 | + |
| 42 | +TEMPLATE_LOADERS = ( |
| 43 | + 'django.template.loaders.filesystem.Loader', |
| 44 | + 'django.template.loaders.app_directories.Loader', |
| 45 | +) |
| 46 | + |
| 47 | +TEMPLATE_DIRS = ( |
| 48 | + BASE_DIR.child("templates"), |
| 49 | +) |
29 | 50 |
|
30 | 51 | # Application definition |
31 | 52 |
|
|
59 | 80 | DATABASES = { |
60 | 81 | 'default': { |
61 | 82 | 'ENGINE': 'django.db.backends.sqlite3', |
62 | | - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
| 83 | + 'NAME': 'db.sqlite3', |
63 | 84 | } |
64 | 85 | } |
65 | 86 |
|
|
0 commit comments