· 7 years ago · Apr 27, 2018, 08:16 PM
1[settings]
2DEBUG=True
3TEMPLATE_DEBUG=True
4SECRET_KEY='r-9@#_0@-^1@2&+4!1j-dsg&28jj7!ut6soxkfc@q=l5x_s7g+'
5
6DB_ENGINE=mysql
7DB_NAME=cro
8DB_USER=root
9DB_PASSWORD=
10DB_HOST=localhost
11DB_PORT=3306
12
13
14
15
16// Settings.py
17"""
18Django settings for cro project.
19
20Generated by 'django-admin startproject' using Django 2.0.4.
21
22For more information on this file, see
23https://docs.djangoproject.com/en/2.0/topics/settings/
24
25For the full list of settings and their values, see
26https://docs.djangoproject.com/en/2.0/ref/settings/
27"""
28
29import os
30from decouple import config
31
32# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
33BASE_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.0/howto/deployment/checklist/
38
39# SECURITY WARNING: keep the secret key used in production secret!
40SECRET_KEY = '&%2!v_^mz5w6hn4fzv3ezizw@=+3c3(xi00o+2e&3m4h^evm+u'
41
42# SECURITY WARNING: don't run with debug turned on in production!
43DEBUG = True
44
45ALLOWED_HOSTS = ['*', '127.0.0.1']
46
47PROJECT_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
48
49
50# Application definition
51
52INSTALLED_APPS = [
53 #Django
54 'django.contrib.admin',
55 'django.contrib.auth',
56 'django.contrib.contenttypes',
57 'django.contrib.sessions',
58 'django.contrib.messages',
59 'django.contrib.staticfiles',
60 #apps
61 'apps.fiscalizacao',
62 'django_superform',
63]
64
65MIDDLEWARE = [
66 'django.middleware.security.SecurityMiddleware',
67 'django.contrib.sessions.middleware.SessionMiddleware',
68 'django.middleware.common.CommonMiddleware',
69 'django.middleware.csrf.CsrfViewMiddleware',
70 'django.contrib.auth.middleware.AuthenticationMiddleware',
71 'django.contrib.messages.middleware.MessageMiddleware',
72 'django.middleware.clickjacking.XFrameOptionsMiddleware',
73]
74
75ROOT_URLCONF = 'cro.urls'
76
77TEMPLATES = [
78 {
79 'BACKEND': 'django.template.backends.django.DjangoTemplates',
80 'DIRS': [os.path.join(PROJECT_ROOT, 'templates')],
81 'APP_DIRS': True,
82 'OPTIONS': {
83 'context_processors': [
84 'django.template.context_processors.debug',
85 'django.template.context_processors.request',
86 'django.contrib.auth.context_processors.auth',
87 'django.contrib.messages.context_processors.messages',
88 ],
89 },
90 },
91]
92
93WSGI_APPLICATION = 'cro.wsgi.application'
94
95
96# Database
97# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
98
99DATABASES = {
100 'default': {
101 'ENGINE': 'django.db.backends.%s' % config('DB_ENGINE'),
102 'NAME': config('DB_NAME'),
103 'USER': config('DB_USER'),
104 'PASSWORD': config('DB_PASSWORD'),
105 'HOST': config('DB_HOST', default='localhost'),
106 'PORT': config('DB_PORT'),
107 }
108}
109
110
111# Password validation
112# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
113
114AUTH_PASSWORD_VALIDATORS = [
115 {
116 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
117 },
118 {
119 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
120 },
121 {
122 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
123 },
124 {
125 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
126 },
127]
128
129AUTH_USER_MODEL = 'fiscalizacao.user'
130
131# Internationalization
132# https://docs.djangoproject.com/en/2.0/topics/i18n/
133
134LANGUAGE_CODE = 'pt-br'
135
136TIME_ZONE = 'America/Fortaleza'
137
138USE_I18N = True
139
140USE_L10N = True
141
142USE_TZ = False
143
144DATE_INPUT_FORMATS = ['%d/%m/%Y']
145
146# Static files (CSS, JavaScript, Images)
147# https://docs.djangoproject.com/en/2.0/howto/static-files/
148
149STATIC_URL = '/static/'
150STATIC_ROOT = os.path.join(BASE_DIR, 'static')
151
152MEDIA_URL = '/media/'
153MEDIA_ROOT = os.path.join(BASE_DIR, 'media')