|
| 1 | +# Django settings for chat project. |
| 2 | +from mongoengine import connect |
| 3 | + |
| 4 | +DEBUG = True |
| 5 | +TEMPLATE_DEBUG = DEBUG |
| 6 | + |
| 7 | +ADMINS = ( |
| 8 | + # ('Your Name', '[email protected]'), |
| 9 | +) |
| 10 | + |
| 11 | +MANAGERS = ADMINS |
| 12 | + |
| 13 | +DATABASES = { |
| 14 | + 'default': { |
| 15 | + 'ENGINE': 'django.db.backends.dummy', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
| 16 | + 'NAME': '', # Or path to database file if using sqlite3. |
| 17 | + # The following settings are not used with sqlite3: |
| 18 | + 'USER': '', |
| 19 | + 'PASSWORD': '', |
| 20 | + 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
| 21 | + 'PORT': '', # Set to empty string for default. |
| 22 | + } |
| 23 | +} |
| 24 | + |
| 25 | +# Hosts/domain names that are valid for this site; required if DEBUG is False |
| 26 | +# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
| 27 | +ALLOWED_HOSTS = [] |
| 28 | + |
| 29 | +# Local time zone for this installation. Choices can be found here: |
| 30 | +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
| 31 | +# although not all choices may be available on all operating systems. |
| 32 | +# In a Windows environment this must be set to your system time zone. |
| 33 | +TIME_ZONE = 'America/Chicago' |
| 34 | + |
| 35 | +# Language code for this installation. All choices can be found here: |
| 36 | +# http://www.i18nguy.com/unicode/language-identifiers.html |
| 37 | +LANGUAGE_CODE = 'en-us' |
| 38 | + |
| 39 | +SITE_ID = 1 |
| 40 | + |
| 41 | +# If you set this to False, Django will make some optimizations so as not |
| 42 | +# to load the internationalization machinery. |
| 43 | +USE_I18N = True |
| 44 | + |
| 45 | +# If you set this to False, Django will not format dates, numbers and |
| 46 | +# calendars according to the current locale. |
| 47 | +USE_L10N = True |
| 48 | + |
| 49 | +# If you set this to False, Django will not use timezone-aware datetimes. |
| 50 | +USE_TZ = True |
| 51 | + |
| 52 | +# Absolute filesystem path to the directory that will hold user-uploaded files. |
| 53 | +# Example: "/var/www/example.com/media/" |
| 54 | +MEDIA_ROOT = '' |
| 55 | + |
| 56 | +# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
| 57 | +# trailing slash. |
| 58 | +# Examples: "http://example.com/media/", "http://media.example.com/" |
| 59 | +MEDIA_URL = '' |
| 60 | + |
| 61 | +# Absolute path to the directory static files should be collected to. |
| 62 | +# Don't put anything in this directory yourself; store your static files |
| 63 | +# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
| 64 | +# Example: "/var/www/example.com/static/" |
| 65 | +STATIC_ROOT = '' |
| 66 | + |
| 67 | +# URL prefix for static files. |
| 68 | +# Example: "http://example.com/static/", "http://static.example.com/" |
| 69 | +STATIC_URL = '/static/' |
| 70 | + |
| 71 | +# Additional locations of static files |
| 72 | +STATICFILES_DIRS = ( |
| 73 | + # Put strings here, like "/home/html/static" or "C:/www/django/static". |
| 74 | + # Always use forward slashes, even on Windows. |
| 75 | + # Don't forget to use absolute paths, not relative paths. |
| 76 | +) |
| 77 | + |
| 78 | +# List of finder classes that know how to find static files in |
| 79 | +# various locations. |
| 80 | +STATICFILES_FINDERS = ( |
| 81 | + 'django.contrib.staticfiles.finders.FileSystemFinder', |
| 82 | + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
| 83 | +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
| 84 | +) |
| 85 | + |
| 86 | +# Make this unique, and don't share it with anybody. |
| 87 | +SECRET_KEY = '%h886c4&)vsb0l)g^2mv+a3@q8_ww8-i110u$v2kontw61kxl)' |
| 88 | + |
| 89 | +# List of callables that know how to import templates from various sources. |
| 90 | +TEMPLATE_LOADERS = ( |
| 91 | + 'django.template.loaders.filesystem.Loader', |
| 92 | + 'django.template.loaders.app_directories.Loader', |
| 93 | +# 'django.template.loaders.eggs.Loader', |
| 94 | +) |
| 95 | + |
| 96 | +MIDDLEWARE_CLASSES = ( |
| 97 | + 'django.middleware.common.CommonMiddleware', |
| 98 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 99 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 100 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 101 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 102 | + # Uncomment the next line for simple clickjacking protection: |
| 103 | + # 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 104 | +) |
| 105 | + |
| 106 | +ROOT_URLCONF = 'chat.urls' |
| 107 | + |
| 108 | +# Python dotted path to the WSGI application used by Django's runserver. |
| 109 | +WSGI_APPLICATION = 'chat.wsgi.application' |
| 110 | + |
| 111 | +TEMPLATE_DIRS = ( |
| 112 | + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
| 113 | + # Always use forward slashes, even on Windows. |
| 114 | + # Don't forget to use absolute paths, not relative paths. |
| 115 | + '/Users/tier/Job/Maxim/projects/chat/chat/templates', |
| 116 | +) |
| 117 | + |
| 118 | +INSTALLED_APPS = ( |
| 119 | + 'django.contrib.auth', |
| 120 | + 'mongoengine.django.mongo_auth', |
| 121 | + 'django.contrib.contenttypes', |
| 122 | + 'django.contrib.sessions', |
| 123 | + # 'django.contrib.sites', |
| 124 | + 'django.contrib.messages', |
| 125 | + 'django.contrib.staticfiles', |
| 126 | + # Uncomment the next line to enable the admin: |
| 127 | + # 'django.contrib.admin', |
| 128 | + # Uncomment the next line to enable admin documentation: |
| 129 | + # 'django.contrib.admindocs', |
| 130 | + 'registration', |
| 131 | +) |
| 132 | + |
| 133 | +# A sample logging configuration. The only tangible logging |
| 134 | +# performed by this configuration is to send an email to |
| 135 | +# the site admins on every HTTP 500 error when DEBUG=False. |
| 136 | +# See http://docs.djangoproject.com/en/dev/topics/logging for |
| 137 | +# more details on how to customize your logging configuration. |
| 138 | +LOGGING = { |
| 139 | + 'version': 1, |
| 140 | + 'disable_existing_loggers': False, |
| 141 | + 'filters': { |
| 142 | + 'require_debug_false': { |
| 143 | + '()': 'django.utils.log.RequireDebugFalse' |
| 144 | + } |
| 145 | + }, |
| 146 | + 'handlers': { |
| 147 | + 'mail_admins': { |
| 148 | + 'level': 'ERROR', |
| 149 | + 'filters': ['require_debug_false'], |
| 150 | + 'class': 'django.utils.log.AdminEmailHandler' |
| 151 | + } |
| 152 | + }, |
| 153 | + 'loggers': { |
| 154 | + 'django.request': { |
| 155 | + 'handlers': ['mail_admins'], |
| 156 | + 'level': 'ERROR', |
| 157 | + 'propagate': True, |
| 158 | + }, |
| 159 | + } |
| 160 | +} |
| 161 | + |
| 162 | +# Email settings. |
| 163 | +EMAIL_HOST = 'smtp.gmail.com' |
| 164 | +EMAIL_PORT = 587 |
| 165 | +EMAIL_HOST_PASSWORD = 'xxxxxxxx' |
| 166 | +EMAIL_HOST_USER = '[email protected]' |
| 167 | +EMAIL_USE_TLS = True |
| 168 | + |
| 169 | +# Django-registration settings. |
| 170 | +ACCOUNT_ACTIVATION_DAYS = 3 |
| 171 | +SITE = {'name': 'Cool Site', 'domain': 'www.coolsite.ru'} |
| 172 | +LOGIN_REDIRECT_URL = "index" |
| 173 | + |
| 174 | +# Mongo settings. |
| 175 | +connect('chat', host='192.168.1.5') |
| 176 | +AUTHENTICATION_BACKENDS = ( |
| 177 | + 'mongoengine.django.auth.MongoEngineBackend', |
| 178 | +) |
| 179 | +AUTH_USER_MODEL = 'mongo_auth.MongoUser' |
| 180 | +MONGOENGINE_USER_DOCUMENT = 'mongoengine.django.auth.User' |
| 181 | +SESSION_ENGINE = 'mongoengine.django.sessions' |
0 commit comments