|
| 1 | +# Django settings for nemo project. |
| 2 | +from os.path import dirname, abspath |
| 3 | + |
| 4 | +DEBUG = True |
| 5 | +TEMPLATE_DEBUG = DEBUG |
| 6 | + |
| 7 | +_PROJECT_ROOT = dirname(abspath(__file__)) |
| 8 | +LOGIN_REDIRECT_URL = '/' |
| 9 | + |
| 10 | +TEMPLATE_CONTEXT_PROCESSORS = ( |
| 11 | + 'django.core.context_processors.request', |
| 12 | + "django.contrib.auth.context_processors.auth", |
| 13 | + "django.core.context_processors.debug", |
| 14 | + "django.core.context_processors.i18n", |
| 15 | + "django.core.context_processors.media", |
| 16 | + "django.core.context_processors.static", |
| 17 | + "django.contrib.messages.context_processors.messages" |
| 18 | +) |
| 19 | + |
| 20 | +ADMINS = ( |
| 21 | + ( 'Snow Hellsing', '[email protected]'), |
| 22 | +) |
| 23 | + |
| 24 | +MANAGERS = ADMINS |
| 25 | + |
| 26 | +DATABASES = { |
| 27 | + 'default': { |
| 28 | + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
| 29 | + 'NAME': _PROJECT_ROOT + '/sqlite3.db', # Or path to database file if using sqlite3. |
| 30 | + 'USER': '', # Not used with sqlite3. |
| 31 | + 'PASSWORD': '', # Not used with sqlite3. |
| 32 | + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
| 33 | + 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +# Local time zone for this installation. Choices can be found here: |
| 38 | +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
| 39 | +# although not all choices may be available on all operating systems. |
| 40 | +# On Unix systems, a value of None will cause Django to use the same |
| 41 | +# timezone as the operating system. |
| 42 | +# If running in a Windows environment this must be set to the same as your |
| 43 | +# system time zone. |
| 44 | +TIME_ZONE = 'Asia/Chongqing' |
| 45 | + |
| 46 | +# Language code for this installation. All choices can be found here: |
| 47 | +# http://www.i18nguy.com/unicode/language-identifiers.html |
| 48 | +LANGUAGE_CODE = 'en-us' |
| 49 | + |
| 50 | +SITE_ID = 1 |
| 51 | + |
| 52 | +# If you set this to False, Django will make some optimizations so as not |
| 53 | +# to load the internationalization machinery. |
| 54 | +USE_I18N = True |
| 55 | + |
| 56 | +# If you set this to False, Django will not format dates, numbers and |
| 57 | +# calendars according to the current locale |
| 58 | +USE_L10N = True |
| 59 | + |
| 60 | +# Absolute filesystem path to the directory that will hold user-uploaded files. |
| 61 | +# Example: "/home/media/media.lawrence.com/media/" |
| 62 | +MEDIA_ROOT = '' |
| 63 | + |
| 64 | +# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
| 65 | +# trailing slash. |
| 66 | +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
| 67 | +MEDIA_URL = '' |
| 68 | + |
| 69 | +# Absolute path to the directory static files should be collected to. |
| 70 | +# Don't put anything in this directory yourself; store your static files |
| 71 | +# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
| 72 | +# Example: "/home/media/media.lawrence.com/static/" |
| 73 | +STATIC_ROOT = '' |
| 74 | + |
| 75 | +# URL prefix for static files. |
| 76 | +# Example: "http://media.lawrence.com/static/" |
| 77 | +STATIC_URL = '/s/' |
| 78 | + |
| 79 | +# URL prefix for admin static files -- CSS, JavaScript and images. |
| 80 | +# Make sure to use a trailing slash. |
| 81 | +# Examples: "http://foo.com/static/admin/", "/static/admin/". |
| 82 | +ADMIN_MEDIA_PREFIX = '/static/admin/' |
| 83 | + |
| 84 | +# Additional locations of static files |
| 85 | +STATICFILES_DIRS = ( |
| 86 | + # Put strings here, like "/home/html/static" or "C:/www/django/static". |
| 87 | + # Always use forward slashes, even on Windows. |
| 88 | + # Don't forget to use absolute paths, not relative paths. |
| 89 | +) |
| 90 | + |
| 91 | +# List of finder classes that know how to find static files in |
| 92 | +# various locations. |
| 93 | +STATICFILES_FINDERS = ( |
| 94 | + 'django.contrib.staticfiles.finders.FileSystemFinder', |
| 95 | + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
| 96 | +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
| 97 | +) |
| 98 | + |
| 99 | +# Make this unique, and don't share it with anybody. |
| 100 | +SECRET_KEY = '-(f3g=n6a930n-$epam62h&9&*rs6(%tc(vqsaxi#@(fyb+jxx' |
| 101 | + |
| 102 | +# List of callables that know how to import templates from various sources. |
| 103 | +TEMPLATE_LOADERS = ( |
| 104 | + 'django.template.loaders.filesystem.Loader', |
| 105 | + 'django.template.loaders.app_directories.Loader', |
| 106 | +# 'django.template.loaders.eggs.Loader', |
| 107 | +) |
| 108 | + |
| 109 | +MIDDLEWARE_CLASSES = ( |
| 110 | + 'django.middleware.common.CommonMiddleware', |
| 111 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 112 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 113 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 114 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 115 | +) |
| 116 | + |
| 117 | +ROOT_URLCONF = 'nemo.urls' |
| 118 | + |
| 119 | +TEMPLATE_DIRS = ( |
| 120 | + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
| 121 | + # Always use forward slashes, even on Windows. |
| 122 | + # Don't forget to use absolute paths, not relative paths. |
| 123 | +) |
| 124 | + |
| 125 | +INSTALLED_APPS = ( |
| 126 | + 'django.contrib.auth', |
| 127 | + 'django.contrib.contenttypes', |
| 128 | + 'django.contrib.sessions', |
| 129 | + 'django.contrib.sites', |
| 130 | + 'django.contrib.messages', |
| 131 | + 'django.contrib.staticfiles', |
| 132 | + # Uncomment the next line to enable the admin: |
| 133 | + # 'django.contrib.admin', |
| 134 | + # Uncomment the next line to enable admin documentation: |
| 135 | + # 'django.contrib.admindocs', |
| 136 | + 'wishlist' |
| 137 | +) |
| 138 | + |
| 139 | +# A sample logging configuration. The only tangible logging |
| 140 | +# performed by this configuration is to send an email to |
| 141 | +# the site admins on every HTTP 500 error. |
| 142 | +# See http://docs.djangoproject.com/en/dev/topics/logging for |
| 143 | +# more details on how to customize your logging configuration. |
| 144 | +LOGGING = { |
| 145 | + 'version': 1, |
| 146 | + 'disable_existing_loggers': False, |
| 147 | + 'formatters': { |
| 148 | + 'custom': { |
| 149 | + 'format': '[%(asctime)-15s][%(levelname)s] %(message)s | %(pathname)s (%(lineno)d)' |
| 150 | + }, |
| 151 | + }, |
| 152 | + 'handlers': { |
| 153 | + 'mail_admins': { |
| 154 | + 'level': 'ERROR', |
| 155 | + 'class': 'django.utils.log.AdminEmailHandler' |
| 156 | + }, |
| 157 | + 'console':{ |
| 158 | + 'level':'DEBUG', |
| 159 | + 'class':'logging.StreamHandler', |
| 160 | + 'formatter': 'custom' |
| 161 | + }, |
| 162 | + }, |
| 163 | + 'loggers': { |
| 164 | + 'django.request': { |
| 165 | + 'handlers': ['mail_admins'], |
| 166 | + 'level': 'ERROR', |
| 167 | + 'propagate': True, |
| 168 | + }, |
| 169 | + 'demo':{ |
| 170 | + 'handlers': ['console'], |
| 171 | + 'level': 'INFO', |
| 172 | + }, |
| 173 | + 'core':{ |
| 174 | + 'handlers': ['console'], |
| 175 | + 'level': 'INFO', |
| 176 | + } |
| 177 | + } |
| 178 | +} |
0 commit comments