|
1 | 1 | # Django settings for pythonkc_site project. |
2 | | - |
3 | 2 | import os |
4 | 3 |
|
| 4 | + |
| 5 | +PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) |
| 6 | + |
5 | 7 | DEBUG = True |
6 | 8 | TEMPLATE_DEBUG = DEBUG |
7 | 9 |
|
|
14 | 16 | DATABASES = { |
15 | 17 | 'default': { |
16 | 18 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
17 | | - 'NAME': os.path.join(os.path.abspath(os.path.dirname(__file__)), 'pythonkc.sqlite'), # Or path to database file if using sqlite3. |
| 19 | + 'NAME': os.path.join(PROJECT_ROOT, 'pythonkc.sqlite'), # Or path to database file if using sqlite3. |
18 | 20 | 'USER': '', # Not used with sqlite3. |
19 | 21 | 'PASSWORD': '', # Not used with sqlite3. |
20 | 22 | 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
|
47 | 49 |
|
48 | 50 | # Absolute filesystem path to the directory that will hold user-uploaded files. |
49 | 51 | # Example: "/home/media/media.lawrence.com/media/" |
50 | | -MEDIA_ROOT = '' |
| 52 | +MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media'), |
51 | 53 |
|
52 | 54 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
53 | 55 | # trailing slash. |
54 | 56 | # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
55 | | -MEDIA_URL = '' |
| 57 | +MEDIA_URL = '/media/' |
56 | 58 |
|
57 | 59 | # Absolute path to the directory static files should be collected to. |
58 | 60 | # Don't put anything in this directory yourself; store your static files |
59 | 61 | # in apps' "static/" subdirectories and in STATICFILES_DIRS. |
60 | 62 | # Example: "/home/media/media.lawrence.com/static/" |
61 | | -STATIC_ROOT = '' |
| 63 | +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static'), |
62 | 64 |
|
63 | 65 | # URL prefix for static files. |
64 | 66 | # Example: "http://media.lawrence.com/static/" |
|
105 | 107 | ROOT_URLCONF = 'pythonkc_site.urls' |
106 | 108 |
|
107 | 109 | TEMPLATE_DIRS = ( |
108 | | - os.path.join(os.path.abspath(os.path.dirname(__file__)), 'templates'), |
109 | | - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
110 | | - # Always use forward slashes, even on Windows. |
111 | | - # Don't forget to use absolute paths, not relative paths. |
| 110 | + os.path.join(PROJECT_ROOT, 'templates'), |
112 | 111 | ) |
113 | 112 |
|
114 | 113 | INSTALLED_APPS = ( |
|
0 commit comments