Debian Codegraph @

examples/django/proj/settings.py

raw
1 import os
2
3 # ^^^ The above is required if you want to import from the celery
4 # library. If you don't have this then `from celery.schedules import`
5 # becomes `proj.celery.schedules` in Python 2.x since it allows
6 # for relative imports by default.
7
8 # Celery settings
9
10 CELERY_BROKER_URL = 'amqp://guest:guest@localhost'
11
12 #: Only add pickle to this list if your broker is secured
13 #: from unwanted access (see userguide/security.html)
14 CELERY_ACCEPT_CONTENT = ['json']
15 CELERY_RESULT_BACKEND = 'db+sqlite:///results.sqlite'
16 CELERY_TASK_SERIALIZER = 'json'
17
18
19 """
20 Django settings for proj project.
21
22 Generated by 'django-admin startproject' using Django 2.2.1.
23
24 For more information on this file, see
25 https://docs.djangoproject.com/en/2.2/topics/settings/
26
27 For the full list of settings and their values, see
28 https://docs.djangoproject.com/en/2.2/ref/settings/
29 """
30
31
32 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
33 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
34
35
36 # Quick-start development settings - unsuitable for production
37 # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
38
39 # SECURITY WARNING: keep the secret key used in production secret!
40 SECRET_KEY = 'l!t+dmzf97rt9s*yrsux1py_1@odvz1szr&6&m!f@-nxq6k%%p'
41
42 # SECURITY WARNING: don't run with debug turned on in production!
43 DEBUG = True
44
45 ALLOWED_HOSTS = []
46
47
48 # Application definition
49
50 INSTALLED_APPS = [
51 'django.contrib.admin',
52 'django.contrib.auth',
53 'django.contrib.contenttypes',
54 'django.contrib.sessions',
55 'django.contrib.messages',
56 'django.contrib.staticfiles',
57 'demoapp',
58 ]
59
60 MIDDLEWARE = [
61 'django.middleware.security.SecurityMiddleware',
62 'django.contrib.sessions.middleware.SessionMiddleware',
63 'django.middleware.common.CommonMiddleware',
64 'django.middleware.csrf.CsrfViewMiddleware',
65 'django.contrib.auth.middleware.AuthenticationMiddleware',
66 'django.contrib.messages.middleware.MessageMiddleware',
67 'django.middleware.clickjacking.XFrameOptionsMiddleware',
68 ]
69
70 ROOT_URLCONF = 'proj.urls'
71
72 TEMPLATES = [
73 {
74 'BACKEND': 'django.template.backends.django.DjangoTemplates',
75 'DIRS': [],
76 'APP_DIRS': True,
77 'OPTIONS': {
78 'context_processors': [
79 'django.template.context_processors.debug',
80 'django.template.context_processors.request',
81 'django.contrib.auth.context_processors.auth',
82 'django.contrib.messages.context_processors.messages',
83 ],
84 },
85 },
86 ]
87
88 WSGI_APPLICATION = 'proj.wsgi.application'
89
90
91 # Database
92 # https://docs.djangoproject.com/en/2.2/ref/settings/#databases
93
94 DATABASES = {
95 'default': {
96 'ENGINE': 'django.db.backends.sqlite3',
97 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
98 }
99 }
100
101
102 # Password validation
103 # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
104
105 AUTH_PASSWORD_VALIDATORS = [
106 {
107 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
108 },
109 {
110 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
111 },
112 {
113 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
114 },
115 {
116 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
117 },
118 ]
119
120
121 # Internationalization
122 # https://docs.djangoproject.com/en/2.2/topics/i18n/
123
124 LANGUAGE_CODE = 'en-us'
125
126 TIME_ZONE = 'UTC'
127
128 USE_I18N = True
129
130 USE_L10N = True
131
132 USE_TZ = True
133
134
135 # Static files (CSS, JavaScript, Images)
136 # https://docs.djangoproject.com/en/2.2/howto/static-files/
137
138 STATIC_URL = '/static/'