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