ev6 commited on
Commit
8e9c08f
·
verified ·
1 Parent(s): b705b36

Update app/django_app/settings.py

Browse files
Files changed (1) hide show
  1. app/django_app/settings.py +148 -147
app/django_app/settings.py CHANGED
@@ -1,147 +1,148 @@
1
- """
2
- Django settings for django_app project.
3
-
4
- Generated by 'django-admin startproject' using Django 4.0.4.
5
-
6
- For more information on this file, see
7
- https://docs.djangoproject.com/en/4.0/topics/settings/
8
-
9
- For the full list of settings and their values, see
10
- https://docs.djangoproject.com/en/4.0/ref/settings/
11
- """
12
- import os
13
- from pathlib import Path
14
-
15
- # Build paths inside the project like this: BASE_DIR / 'subdir'.
16
- BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
-
18
-
19
- # Quick-start development settings - unsuitable for production
20
- # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
21
-
22
- SECRET_KEY = os.environ.get('SECRET_KEY', 'your-default-secret-key')
23
-
24
- # SECURITY WARNING: don't run with debug turned on in production!
25
- DEBUG = True
26
-
27
- ALLOWED_HOSTS = []
28
-
29
-
30
- # Application definition
31
-
32
- INSTALLED_APPS = [
33
- 'django.contrib.admin',
34
- 'django.contrib.auth',
35
- 'django.contrib.contenttypes',
36
- 'django.contrib.sessions',
37
- 'django.contrib.messages',
38
- 'django.contrib.staticfiles',
39
- 'django_extensions',
40
- 'django.contrib.humanize',
41
- 'rest_framework',
42
-
43
- 'apps.emotion_recognition',
44
-
45
- 'crispy_forms',
46
- 'crispy_bootstrap5',
47
- ]
48
-
49
- MIDDLEWARE = [
50
- 'django.middleware.security.SecurityMiddleware',
51
- 'whitenoise.middleware.WhiteNoiseMiddleware',
52
- 'django.contrib.sessions.middleware.SessionMiddleware',
53
- 'django.middleware.common.CommonMiddleware',
54
- 'django.middleware.csrf.CsrfViewMiddleware',
55
- 'django.contrib.auth.middleware.AuthenticationMiddleware',
56
- 'django.contrib.messages.middleware.MessageMiddleware',
57
- 'django.middleware.clickjacking.XFrameOptionsMiddleware',
58
- ]
59
-
60
- ROOT_URLCONF = 'django_app.urls'
61
-
62
- TEMPLATES = [
63
- {
64
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
65
- 'DIRS': [
66
- os.path.join(BASE_DIR, 'templates')
67
- ],
68
- 'APP_DIRS': True,
69
- 'OPTIONS': {
70
- 'context_processors': [
71
- 'django.template.context_processors.debug',
72
- 'django.template.context_processors.request',
73
- 'django.contrib.auth.context_processors.auth',
74
- 'django.contrib.messages.context_processors.messages',
75
- ],
76
- },
77
- },
78
- ]
79
-
80
- WSGI_APPLICATION = 'django_app.wsgi.application'
81
-
82
-
83
- # Database
84
- # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
85
-
86
- DATABASES = {
87
- 'default': {
88
- 'ENGINE': 'django.db.backends.sqlite3',
89
- 'NAME': str(os.path.join(BASE_DIR, "db.sqlite3")),
90
- }
91
- }
92
-
93
-
94
- # Password validation
95
- # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
96
-
97
- AUTH_USER_MODEL = 'auth.User'
98
-
99
- AUTH_PASSWORD_VALIDATORS = [
100
- {
101
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
102
- },
103
- {
104
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
105
- },
106
- {
107
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
108
- },
109
- {
110
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
111
- },
112
- ]
113
-
114
-
115
- # Internationalization
116
- # https://docs.djangoproject.com/en/4.0/topics/i18n/
117
-
118
- LANGUAGE_CODE = 'en-us'
119
-
120
- TIME_ZONE = 'UTC'
121
-
122
- USE_I18N = True
123
-
124
- USE_TZ = True
125
-
126
-
127
- CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
128
- CRISPY_TEMPLATE_PACK = "bootstrap5"
129
-
130
- # Static files (CSS, JavaScript, Images)
131
- # https://docs.djangoproject.com/en/4.0/howto/static-files/
132
-
133
-
134
- MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
135
- MEDIA_URL = "/media/"
136
-
137
- STATIC_URL = '/static/'
138
- STATICFILES_DIRS = [
139
- os.path.join(BASE_DIR, 'static')
140
- ]
141
-
142
- # Default primary key field type
143
- # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
144
-
145
- DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
146
-
147
-
 
 
1
+ """
2
+ Django settings for django_app project.
3
+
4
+ Generated by 'django-admin startproject' using Django 4.0.4.
5
+
6
+ For more information on this file, see
7
+ https://docs.djangoproject.com/en/4.0/topics/settings/
8
+
9
+ For the full list of settings and their values, see
10
+ https://docs.djangoproject.com/en/4.0/ref/settings/
11
+ """
12
+ import os
13
+ from pathlib import Path
14
+
15
+ # Build paths inside the project like this: BASE_DIR / 'subdir'.
16
+ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
+
18
+
19
+ # Quick-start development settings - unsuitable for production
20
+ # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
21
+
22
+ SECRET_KEY = os.environ.get('SECRET_KEY', 'your-default-secret-key')
23
+
24
+ # SECURITY WARNING: don't run with debug turned on in production!
25
+ DEBUG = True
26
+
27
+ ALLOWED_HOSTS = ['*']
28
+ X_FRAME_OPTIONS = 'ALLOW-FROM https://huggingface.co/'
29
+
30
+
31
+ # Application definition
32
+
33
+ INSTALLED_APPS = [
34
+ 'django.contrib.admin',
35
+ 'django.contrib.auth',
36
+ 'django.contrib.contenttypes',
37
+ 'django.contrib.sessions',
38
+ 'django.contrib.messages',
39
+ 'django.contrib.staticfiles',
40
+ 'django_extensions',
41
+ 'django.contrib.humanize',
42
+ 'rest_framework',
43
+
44
+ 'apps.emotion_recognition',
45
+
46
+ 'crispy_forms',
47
+ 'crispy_bootstrap5',
48
+ ]
49
+
50
+ MIDDLEWARE = [
51
+ 'django.middleware.security.SecurityMiddleware',
52
+ 'whitenoise.middleware.WhiteNoiseMiddleware',
53
+ 'django.contrib.sessions.middleware.SessionMiddleware',
54
+ 'django.middleware.common.CommonMiddleware',
55
+ 'django.middleware.csrf.CsrfViewMiddleware',
56
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
57
+ 'django.contrib.messages.middleware.MessageMiddleware',
58
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
59
+ ]
60
+
61
+ ROOT_URLCONF = 'django_app.urls'
62
+
63
+ TEMPLATES = [
64
+ {
65
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
66
+ 'DIRS': [
67
+ os.path.join(BASE_DIR, 'templates')
68
+ ],
69
+ 'APP_DIRS': True,
70
+ 'OPTIONS': {
71
+ 'context_processors': [
72
+ 'django.template.context_processors.debug',
73
+ 'django.template.context_processors.request',
74
+ 'django.contrib.auth.context_processors.auth',
75
+ 'django.contrib.messages.context_processors.messages',
76
+ ],
77
+ },
78
+ },
79
+ ]
80
+
81
+ WSGI_APPLICATION = 'django_app.wsgi.application'
82
+
83
+
84
+ # Database
85
+ # https://docs.djangoproject.com/en/4.0/ref/settings/#databases
86
+
87
+ DATABASES = {
88
+ 'default': {
89
+ 'ENGINE': 'django.db.backends.sqlite3',
90
+ 'NAME': str(os.path.join(BASE_DIR, "db.sqlite3")),
91
+ }
92
+ }
93
+
94
+
95
+ # Password validation
96
+ # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators
97
+
98
+ AUTH_USER_MODEL = 'auth.User'
99
+
100
+ AUTH_PASSWORD_VALIDATORS = [
101
+ {
102
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
103
+ },
104
+ {
105
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
106
+ },
107
+ {
108
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
109
+ },
110
+ {
111
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
112
+ },
113
+ ]
114
+
115
+
116
+ # Internationalization
117
+ # https://docs.djangoproject.com/en/4.0/topics/i18n/
118
+
119
+ LANGUAGE_CODE = 'en-us'
120
+
121
+ TIME_ZONE = 'UTC'
122
+
123
+ USE_I18N = True
124
+
125
+ USE_TZ = True
126
+
127
+
128
+ CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
129
+ CRISPY_TEMPLATE_PACK = "bootstrap5"
130
+
131
+ # Static files (CSS, JavaScript, Images)
132
+ # https://docs.djangoproject.com/en/4.0/howto/static-files/
133
+
134
+
135
+ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
136
+ MEDIA_URL = "/media/"
137
+
138
+ STATIC_URL = '/static/'
139
+ STATICFILES_DIRS = [
140
+ os.path.join(BASE_DIR, 'static')
141
+ ]
142
+
143
+ # Default primary key field type
144
+ # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field
145
+
146
+ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
147
+
148
+