· 6 years ago · Jun 26, 2019, 11:50 AM
1"""
2Django settings for funfind project.
3
4Generated by 'django-admin startproject' using Django 2.1.1.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/2.1/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/2.1/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
18ENV_PATH = os.path.abspath(os.path.dirname(__file__))
19
20# Quick-start development settings - unsuitable for production
21# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
22
23# SECURITY WARNING: keep the secret key used in production secret!
24SECRET_KEY = 'c%cj56^*vtr@@k-d)^yr4!zt-1ox@(f$hdffin=h@vz-a5+_c-'
25
26# SECURITY WARNING: don't run with debug turned on in production!
27DEBUG = True
28
29ALLOWED_HOSTS = ['localhost', '127.0.0.1']
30
31
32# Application definition
33
34INSTALLED_APPS = [
35 'grappelli',
36 'modeltranslation',
37 'django.contrib.admin',
38 'django.contrib.auth',
39 'django.contrib.contenttypes',
40 'django.contrib.sessions',
41 'django.contrib.messages',
42 'django.contrib.staticfiles',
43 'province',
44]
45
46MIDDLEWARE = [
47 'django.middleware.security.SecurityMiddleware',
48 'django.contrib.sessions.middleware.SessionMiddleware',
49 'django.middleware.common.CommonMiddleware',
50 'django.middleware.csrf.CsrfViewMiddleware',
51 'django.contrib.auth.middleware.AuthenticationMiddleware',
52 'django.contrib.messages.middleware.MessageMiddleware',
53 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54]
55
56ROOT_URLCONF = 'numportal.urls'
57
58TEMPLATES = [
59 {
60 'BACKEND': 'django.template.backends.django.DjangoTemplates',
61 'DIRS': [os.path.join(BASE_DIR, 'templates')]
62 ,
63 'APP_DIRS': True,
64 'OPTIONS': {
65 'context_processors': [
66 'django.template.context_processors.debug',
67 'django.template.context_processors.request',
68 'django.contrib.auth.context_processors.auth',
69 'django.contrib.messages.context_processors.messages',
70 ],
71 },
72 },
73]
74
75WSGI_APPLICATION = 'numportal.wsgi.application'
76
77
78# Database
79# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
80
81DATABASES = {
82 'default': {
83 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
84 'NAME': 'sqlite3.db', # Or path to database file if using sqlite3.
85 'USER': '', # Not used with sqlite3.
86 'PASSWORD': '', # Not used with sqlite3.
87 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
88 'PORT': '', # Set to empty string for default. Not used with sqlite3.
89 }
90}
91
92
93# Password validation
94# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
95
96AUTH_PASSWORD_VALIDATORS = [
97 {
98 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
99 },
100 {
101 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
102 },
103 {
104 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
105 },
106 {
107 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
108 },
109]
110
111
112# Internationalization
113# https://docs.djangoproject.com/en/2.1/topics/i18n/
114
115LANGUAGE_CODE = 'pl-pl'
116
117TIME_ZONE = 'UTC'
118
119USE_I18N = True
120
121USE_L10N = True
122
123USE_TZ = True
124
125
126# Static files (CSS, JavaScript, Images)
127# https://docs.djangoproject.com/en/2.1/howto/static-files/
128
129STATIC_URL = '/static/'
130STATIC_ROOT = os.path.join(ENV_PATH, '../public/')
131
132STATICFILES_DIRS = [
133 os.path.join(BASE_DIR, "static"),
134]
135MEDIA_ROOT = os.path.join(STATIC_ROOT, 'media/')