|
| 1 | +""" |
| 2 | +Django settings. |
| 3 | +""" |
| 4 | + |
| 5 | +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
1 | 6 | import os
|
2 | 7 |
|
| 8 | +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 9 | + |
| 10 | +# SECURITY WARNING: keep the secret key used in production secret! |
| 11 | +SECRET_KEY = '9%$in^gpdaig@v3or_to&_z(=n)3)$f1mr3hf9e#kespy2ajlo' |
| 12 | + |
| 13 | +# SECURITY WARNING: don't run with debug turned on in production! |
3 | 14 | DEBUG = True
|
4 |
| -TEMPLATE_DEBUG = DEBUG |
5 | 15 |
|
6 |
| -SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) |
| 16 | +ALLOWED_HOSTS = [] |
| 17 | + |
| 18 | +# Application definition |
7 | 19 |
|
8 |
| -ADMINS = ( |
9 |
| - # ('Your Name', 'your_email@example.com'), |
| 20 | +INSTALLED_APPS = ( |
| 21 | + 'fileupload.apps.FileuploadConfig', |
| 22 | + 'django.contrib.admin', |
| 23 | + 'django.contrib.auth', |
| 24 | + 'django.contrib.contenttypes', |
| 25 | + 'django.contrib.sessions', |
| 26 | + 'django.contrib.messages', |
| 27 | + 'django.contrib.staticfiles', |
| 28 | +) |
| 29 | + |
| 30 | +MIDDLEWARE_CLASSES = ( |
| 31 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 32 | + 'django.middleware.common.CommonMiddleware', |
| 33 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 34 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 35 | + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
| 36 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 37 | + 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 38 | + 'django.middleware.security.SecurityMiddleware', |
10 | 39 | )
|
11 | 40 |
|
12 |
| -MANAGERS = ADMINS |
| 41 | +ROOT_URLCONF = 'django-jquery-file-upload.urls' |
| 42 | + |
| 43 | +TEMPLATES = [ |
| 44 | + { |
| 45 | + 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 46 | + #'DIRS': ['django-jquery-file-upload/templates'], |
| 47 | + 'APP_DIRS': True, |
| 48 | + 'OPTIONS': { |
| 49 | + 'context_processors': [ |
| 50 | + 'django.template.context_processors.debug', |
| 51 | + 'django.template.context_processors.request', |
| 52 | + 'django.contrib.auth.context_processors.auth', |
| 53 | + 'django.contrib.messages.context_processors.messages', |
| 54 | + ], |
| 55 | + }, |
| 56 | + }, |
| 57 | +] |
| 58 | + |
| 59 | +WSGI_APPLICATION = 'django-jquery-file-upload.wsgi.application' |
| 60 | + |
| 61 | + |
| 62 | +# Database |
| 63 | +# https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
13 | 64 |
|
14 | 65 | DATABASES = {
|
15 | 66 | 'default': {
|
16 |
| - 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
17 |
| - 'NAME': os.path.join(SITE_ROOT, 'db'), # Or path to database file if using sqlite3. |
18 |
| - 'USER': '', # Not used with sqlite3. |
19 |
| - 'PASSWORD': '', # Not used with sqlite3. |
20 |
| - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
21 |
| - 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
| 67 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 68 | + 'NAME': os.path.join(BASE_DIR, 'db'), |
22 | 69 | }
|
23 | 70 | }
|
24 | 71 |
|
25 |
| -# Local time zone for this installation. Choices can be found here: |
26 |
| -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
27 |
| -# although not all choices may be available on all operating systems. |
28 |
| -# On Unix systems, a value of None will cause Django to use the same |
29 |
| -# timezone as the operating system. |
30 |
| -# If running in a Windows environment this must be set to the same as your |
31 |
| -# system time zone. |
32 |
| -TIME_ZONE = 'America/Chicago' |
33 |
| - |
34 |
| -# Language code for this installation. All choices can be found here: |
35 |
| -# http://www.i18nguy.com/unicode/language-identifiers.html |
| 72 | + |
| 73 | +# Internationalization |
| 74 | +# https://docs.djangoproject.com/en/1.8/topics/i18n/ |
| 75 | + |
36 | 76 | LANGUAGE_CODE = 'en-us'
|
37 | 77 |
|
38 |
| -SITE_ID = 1 |
| 78 | +TIME_ZONE = 'Europe/Oslo' |
39 | 79 |
|
40 |
| -# If you set this to False, Django will make some optimizations so as not |
41 |
| -# to load the internationalization machinery. |
42 | 80 | USE_I18N = True
|
43 | 81 |
|
44 |
| -# If you set this to False, Django will not format dates, numbers and |
45 |
| -# calendars according to the current locale |
46 | 82 | USE_L10N = True
|
47 | 83 |
|
48 |
| -# Absolute filesystem path to the directory that will hold user-uploaded files. |
49 |
| -# Example: "/home/media/media.lawrence.com/media/" |
50 |
| -MEDIA_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/media/' |
| 84 | +USE_TZ = True |
51 | 85 |
|
52 |
| -# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
53 |
| -# trailing slash. |
54 |
| -# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
55 |
| -MEDIA_URL = '/media/' |
56 |
| - |
57 |
| -# Absolute path to the directory static files should be collected to. |
58 |
| -# Don't put anything in this directory yourself; store your static files |
59 |
| -# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
60 |
| -# Example: "/home/media/media.lawrence.com/static/" |
61 |
| -STATIC_ROOT = os.path.abspath(os.path.dirname(__file__)) + '/static/' |
62 | 86 |
|
63 |
| -# URL prefix for static files. |
64 |
| -# Example: "http://media.lawrence.com/static/" |
| 87 | +# Static files (CSS, JavaScript, Images) |
65 | 88 | STATIC_URL = '/static/'
|
66 | 89 |
|
67 |
| -# URL prefix for admin static files -- CSS, JavaScript and images. |
68 |
| -# Make sure to use a trailing slash. |
69 |
| -# Examples: "http://foo.com/static/admin/", "/static/admin/". |
70 |
| -ADMIN_MEDIA_PREFIX = '/static/admin/' |
71 |
| - |
72 |
| -# Additional locations of static files |
73 |
| -STATICFILES_DIRS = ( |
74 |
| - # Put strings here, like "/home/html/static" or "C:/www/django/static". |
75 |
| - # Always use forward slashes, even on Windows. |
76 |
| - # Don't forget to use absolute paths, not relative paths. |
77 |
| -) |
| 90 | +STATICFILES_DIRS = [ |
| 91 | + 'django-jquery-file-upload/static', |
| 92 | +] |
78 | 93 |
|
79 |
| -# List of finder classes that know how to find static files in |
80 |
| -# various locations. |
81 |
| -STATICFILES_FINDERS = ( |
82 |
| - 'django.contrib.staticfiles.finders.FileSystemFinder', |
83 |
| - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
84 |
| -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
85 |
| -) |
86 |
| - |
87 |
| -# Make this unique, and don't share it with anybody. |
88 |
| -SECRET_KEY = '9%$in^gpdaig@v3or_to&_z(=n)3)$f1mr3hf9e#kespy2ajlo' |
89 |
| - |
90 |
| -# List of callables that know how to import templates from various sources. |
91 |
| -TEMPLATE_LOADERS = ( |
92 |
| - 'django.template.loaders.filesystem.Loader', |
93 |
| - 'django.template.loaders.app_directories.Loader', |
94 |
| -# 'django.template.loaders.eggs.Loader', |
95 |
| -) |
96 |
| - |
97 |
| -MIDDLEWARE_CLASSES = ( |
98 |
| - 'django.middleware.common.CommonMiddleware', |
99 |
| - 'django.contrib.sessions.middleware.SessionMiddleware', |
100 |
| - 'django.middleware.csrf.CsrfViewMiddleware', |
101 |
| - 'django.contrib.auth.middleware.AuthenticationMiddleware', |
102 |
| - 'django.contrib.messages.middleware.MessageMiddleware', |
103 |
| - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
104 |
| -) |
105 |
| - |
106 |
| -ROOT_URLCONF = 'django-jquery-file-upload.urls' |
107 |
| - |
108 |
| -TEMPLATE_DIRS = ( |
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. |
112 |
| -) |
113 |
| - |
114 |
| -INSTALLED_APPS = ( |
115 |
| - 'django.contrib.auth', |
116 |
| - 'django.contrib.contenttypes', |
117 |
| - 'django.contrib.sessions', |
118 |
| - 'django.contrib.sites', |
119 |
| - 'django.contrib.messages', |
120 |
| - 'django.contrib.staticfiles', |
121 |
| - 'fileupload', |
122 |
| - # Uncomment the next line to enable the admin: |
123 |
| - 'django.contrib.admin', |
124 |
| - # Uncomment the next line to enable admin documentation: |
125 |
| - # 'django.contrib.admindocs', |
126 |
| -) |
127 |
| - |
128 |
| -# A sample logging configuration. The only tangible logging |
129 |
| -# performed by this configuration is to send an email to |
130 |
| -# the site admins on every HTTP 500 error. |
131 |
| -# See http://docs.djangoproject.com/en/dev/topics/logging for |
132 |
| -# more details on how to customize your logging configuration. |
133 |
| -LOGGING = { |
134 |
| - 'version': 1, |
135 |
| - 'disable_existing_loggers': False, |
136 |
| - 'handlers': { |
137 |
| - 'mail_admins': { |
138 |
| - 'level': 'ERROR', |
139 |
| - 'class': 'django.utils.log.AdminEmailHandler' |
140 |
| - } |
141 |
| - }, |
142 |
| - 'loggers': { |
143 |
| - 'django.request': { |
144 |
| - 'handlers': ['mail_admins'], |
145 |
| - 'level': 'ERROR', |
146 |
| - 'propagate': True, |
147 |
| - }, |
148 |
| - } |
149 |
| -} |
| 94 | +MEDIA_URL = '/media/' |
| 95 | +MEDIA_ROOT = os.path.join(BASE_DIR, 'django-jquery-file-upload', 'media') |
0 commit comments