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