· 5 years ago · Jun 10, 2020, 04:46 PM
1"""
2Django settings for Userprofile project.
3
4Generated by 'django-admin startproject' using Django 3.0.6.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/3.0/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/3.0/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18# Quick-start development settings - unsuitable for production
19# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
20
21# SECURITY WARNING: keep the secret key used in production secret!
22SECRET_KEY = '%1r*h&60ert^6ruipqeuwg&yislxceb$ss7-#id5vqwedj6e!+'
23
24# SECURITY WARNING: don't run with debug turned on in production!
25DEBUG = True
26
27ALLOWED_HOSTS = []
28
29# Application definition
30
31INSTALLED_APPS = [
32 'django.contrib.admin',
33 'django.contrib.auth',
34 'django.contrib.contenttypes',
35 'django.contrib.sessions',
36 'django.contrib.messages',
37 'django.contrib.staticfiles',
38 'Authenticate',
39 'App',
40 'django_cleanup',
41]
42
43MIDDLEWARE = [
44 'django.middleware.security.SecurityMiddleware',
45 'django.contrib.sessions.middleware.SessionMiddleware',
46 'django.middleware.common.CommonMiddleware',
47 'django.middleware.csrf.CsrfViewMiddleware',
48 'django.contrib.auth.middleware.AuthenticationMiddleware',
49 'django.contrib.messages.middleware.MessageMiddleware',
50 'django.middleware.clickjacking.XFrameOptionsMiddleware',
51]
52
53ROOT_URLCONF = 'Userprofile.urls'
54
55TEMPLATES = [
56 {
57 'BACKEND': 'django.template.backends.django.DjangoTemplates',
58 'DIRS': [os.path.join(BASE_DIR, 'templates')],
59 'APP_DIRS': True,
60 'OPTIONS': {
61 'context_processors': [
62 'django.template.context_processors.debug',
63 'django.template.context_processors.request',
64 'django.contrib.auth.context_processors.auth',
65 'django.contrib.messages.context_processors.messages',
66 ],
67 },
68 },
69]
70
71WSGI_APPLICATION = 'Userprofile.wsgi.application'
72
73# Database
74# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
75
76DATABASES = {
77 'default': {
78 'ENGINE': 'django.db.backends.sqlite3',
79 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
80 }
81}
82
83# Password validation
84# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
85
86AUTH_PASSWORD_VALIDATORS = [
87 {
88 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
89 },
90 {
91 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
92 },
93 {
94 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
95 },
96 {
97 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
98 },
99]
100
101# Internationalization
102# https://docs.djangoproject.com/en/3.0/topics/i18n/
103
104LANGUAGE_CODE = 'en-us'
105
106TIME_ZONE = 'UTC'
107
108USE_I18N = True
109
110USE_L10N = True
111
112USE_TZ = True
113
114# Static files (CSS, JavaScript, Images)
115# https://docs.djangoproject.com/en/3.0/howto/static-files/
116
117STATIC_URL = '/static/'
118STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
119
120MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
121MEDIA_URL = '/media/'