· 8 years ago · Nov 22, 2017, 03:22 PM
1"""
2Django settings for myhome project.
3
4Generated by 'django-admin startproject' using Django 1.8.7.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.8/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.8/ref/settings/
11"""
12
13# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14import os
15
16BASE_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/1.8/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'b0qidh(99584&fdmug0c#+(f(&)h36=cx8bl)f-8c*n=83w&58'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = ['.servidormulti.com.br']
29
30SHARED_APPS = (
31 'tenant_schemas',
32 'tenant',
33 'admin_menu',
34 'django.contrib.contenttypes',
35 'django.contrib.sessions',
36 'django.contrib.messages',
37 'django.contrib.staticfiles',
38 'mptt',
39)
40
41TENANT_APPS = (
42 'django.contrib.contenttypes',
43 'django.contrib.admin',
44 'django.contrib.auth',
45 'category',
46 'contact',
47)
48
49INSTALLED_APPS = list(SHARED_APPS) + ['category', 'contact', 'django.contrib.admin', 'django.contrib.auth']
50
51MIDDLEWARE_CLASSES = (
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.auth.middleware.SessionAuthenticationMiddleware',
57 'django.contrib.messages.middleware.MessageMiddleware',
58 'django.middleware.clickjacking.XFrameOptionsMiddleware',
59 'django.middleware.security.SecurityMiddleware',
60 'tenant_schemas.middleware.TenantMiddleware',
61)
62
63ROOT_URLCONF = 'myhome.urls'
64
65TEMPLATES = [
66 {
67 'BACKEND': 'django.template.backends.django.DjangoTemplates',
68 'DIRS': [],
69 'APP_DIRS': False,
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 'loaders': [
78 'tenant_schemas.template_loaders.FilesystemLoader',
79 'django.template.loaders.filesystem.Loader',
80 'django.template.loaders.app_directories.Loader',
81 ]
82 },
83 },
84]
85
86MULTITENANT_TEMPLATE_DIRS = [
87 'tenant/templates'
88]
89
90WSGI_APPLICATION = 'myhome.wsgi.application'
91
92
93# Database
94# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
95
96DATABASES = {
97}
98
99DATABASE_ROUTERS = (
100 'tenant_schemas.routers.TenantSyncRouter',
101)
102
103# Internationalization
104# https://docs.djangoproject.com/en/1.8/topics/i18n/
105
106LANGUAGE_CODE = 'pt-br'
107
108TIME_ZONE = 'America/Sao_Paulo'
109
110USE_I18N = True
111
112USE_L10N = True
113
114USE_TZ = True
115
116
117# Static files (CSS, JavaScript, Images)
118# https://docs.djangoproject.com/en/1.8/howto/static-files/
119
120STATIC_URL = '/static/'
121STATIC_ROOT = os.path.join(BASE_DIR, "static")
122
123STATICFILES_DIRS = [
124 os.path.join(BASE_DIR, "public"),
125]
126
127ADMIN_LOGO = 'logo.png'
128
129TENANT_MODEL = "tenant.Tenant"
130DEFAULT_FILE_STORAGE = "tenant_schemas.storage.TenantFileSystemStorage"