|
| 1 | +# Django settings for testproject project. |
| 2 | + |
| 3 | +DEBUG = True |
| 4 | +TEMPLATE_DEBUG = DEBUG |
| 5 | +DEBUG_PROPAGATE_EXCEPTIONS = True |
| 6 | + |
| 7 | +ALLOWED_HOSTS = ['*'] |
| 8 | + |
| 9 | +ADMINS = ( |
| 10 | + # ('Your Name', '[email protected]'), |
| 11 | +) |
| 12 | + |
| 13 | +MANAGERS = ADMINS |
| 14 | + |
| 15 | +DATABASES = { |
| 16 | + 'default': { |
| 17 | + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
| 18 | + 'NAME': 'sqlite.db', # Or path to database file if using sqlite3. |
| 19 | + 'USER': '', # Not used with sqlite3. |
| 20 | + 'PASSWORD': '', # Not used with sqlite3. |
| 21 | + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
| 22 | + 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
| 23 | + } |
| 24 | +} |
| 25 | + |
| 26 | +CACHES = { |
| 27 | + 'default': { |
| 28 | + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +# Local time zone for this installation. Choices can be found here: |
| 33 | +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
| 34 | +# although not all choices may be available on all operating systems. |
| 35 | +# On Unix systems, a value of None will cause Django to use the same |
| 36 | +# timezone as the operating system. |
| 37 | +# If running in a Windows environment this must be set to the same as your |
| 38 | +# system time zone. |
| 39 | +TIME_ZONE = 'UTC' |
| 40 | + |
| 41 | +# Language code for this installation. All choices can be found here: |
| 42 | +# http://www.i18nguy.com/unicode/language-identifiers.html |
| 43 | +LANGUAGE_CODE = 'en-us' |
| 44 | + |
| 45 | +SITE_ID = 1 |
| 46 | + |
| 47 | +# If you set this to False, Django will make some optimizations so as not |
| 48 | +# to load the internationalization machinery. |
| 49 | +USE_I18N = True |
| 50 | + |
| 51 | +# If you set this to False, Django will not format dates, numbers and |
| 52 | +# calendars according to the current locale |
| 53 | +USE_L10N = True |
| 54 | + |
| 55 | +USE_TZ = True |
| 56 | + |
| 57 | +# Absolute filesystem path to the directory that will hold user-uploaded files. |
| 58 | +# Example: "/home/media/media.lawrence.com/" |
| 59 | +MEDIA_ROOT = '' |
| 60 | + |
| 61 | +# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
| 62 | +# trailing slash if there is a path component (optional in other cases). |
| 63 | +# Examples: "http://media.lawrence.com", "http://example.com/media/" |
| 64 | +MEDIA_URL = '' |
| 65 | + |
| 66 | +# Make this unique, and don't share it with anybody. |
| 67 | +SECRET_KEY = 'r-4p2y=uc56fmqsncog%3h!7hc=y+g)xtz+9y(prx*1o9dpry0', |
| 68 | + |
| 69 | +# List of callables that know how to import templates from various sources. |
| 70 | +TEMPLATE_LOADERS = ( |
| 71 | + 'django.template.loaders.filesystem.Loader', |
| 72 | + 'django.template.loaders.app_directories.Loader', |
| 73 | +) |
| 74 | + |
| 75 | +MIDDLEWARE_CLASSES = ( |
| 76 | + 'django.middleware.common.CommonMiddleware', |
| 77 | + 'django.contrib.sessions.middleware.SessionMiddleware', |
| 78 | + 'django.middleware.csrf.CsrfViewMiddleware', |
| 79 | + 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 80 | + 'django.contrib.messages.middleware.MessageMiddleware', |
| 81 | +) |
| 82 | + |
| 83 | +ROOT_URLCONF = 'tests.urls' |
| 84 | + |
| 85 | +TEMPLATE_DIRS = ( |
| 86 | + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
| 87 | + # Always use forward slashes, even on Windows. |
| 88 | + # Don't forget to use absolute paths, not relative paths. |
| 89 | +) |
| 90 | + |
| 91 | +INSTALLED_APPS = ( |
| 92 | + 'django.contrib.auth', |
| 93 | + 'django.contrib.contenttypes', |
| 94 | + 'django.contrib.sessions', |
| 95 | + 'django.contrib.sites', |
| 96 | + 'django.contrib.messages', |
| 97 | + 'django.contrib.staticfiles', |
| 98 | + 'tests', |
| 99 | +) |
| 100 | + |
| 101 | +# OAuth is optional and won't work if there is no oauth_provider & oauth2 |
| 102 | +try: |
| 103 | + import oauth_provider # NOQA |
| 104 | + import oauth2 # NOQA |
| 105 | +except ImportError: |
| 106 | + pass |
| 107 | +else: |
| 108 | + INSTALLED_APPS += ( |
| 109 | + 'oauth_provider', |
| 110 | + ) |
| 111 | + |
| 112 | +try: |
| 113 | + import provider # NOQA |
| 114 | +except ImportError: |
| 115 | + pass |
| 116 | +else: |
| 117 | + INSTALLED_APPS += ( |
| 118 | + 'provider', |
| 119 | + 'provider.oauth2', |
| 120 | + ) |
| 121 | + |
| 122 | +STATIC_URL = '/static/' |
| 123 | + |
| 124 | +PASSWORD_HASHERS = ( |
| 125 | + 'django.contrib.auth.hashers.SHA1PasswordHasher', |
| 126 | + 'django.contrib.auth.hashers.PBKDF2PasswordHasher', |
| 127 | + 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher', |
| 128 | + 'django.contrib.auth.hashers.BCryptPasswordHasher', |
| 129 | + 'django.contrib.auth.hashers.MD5PasswordHasher', |
| 130 | + 'django.contrib.auth.hashers.CryptPasswordHasher', |
| 131 | +) |
| 132 | + |
| 133 | +AUTH_USER_MODEL = 'auth.User' |
| 134 | + |
| 135 | +import django |
| 136 | + |
| 137 | +if django.VERSION < (1, 3): |
| 138 | + INSTALLED_APPS += ('staticfiles',) |
0 commit comments