· 8 years ago · Dec 20, 2017, 03:04 PM
1import os
2
3SETTINGS_DIR = os.path.dirname(__file__)
4
5PROJECT_PATH = os.path.join(SETTINGS_DIR, os.pardir)
6PROJECT_PATH = os.path.abspath(PROJECT_PATH)
7
8TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'templates')
9STATIC_PATH = os.path.join(PROJECT_PATH, 'estatico')
10DATABASE_PATH = os.path.join(PROJECT_PATH, 'directorio1.db')
11
12# Printing paths for sanity's sake
13print "Settings directory:", SETTINGS_DIR
14print "Project root:", PROJECT_PATH
15print "Templates:", TEMPLATE_PATH
16print "estatico:", STATIC_PATH
17print "DB:", DATABASE_PATH
18LOGIN_URL = '/directorio1/login/'
19
20# SECURITY WARNING: don't run with debug turned on in production!
21DEBUG = True
22TEMPLATE_DEBUG = DEBUG
23ALLOWED_HOSTS = []
24ADMINS = (
25 # ('Your Name', 'your_email@example.com'),
26)
27MANAGERS = ADMINS
28
29DATABASES = {
30 'default': {
31 'ENGINE': 'django.db.backends.sqlite3',
32 'NAME': DATABASE_PATH,
33 }
34}
35
36# Hosts/domain names that are valid for this site; required if DEBUG is False
37# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
38ALLOWED_HOSTS = []
39
40# Local time zone for this installation. Choices can be found here:
41# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
42# although not all choices may be available on all operating systems.
43# In a Windows environment this must be set to your system time zone.
44TIME_ZONE = 'America/Chicago'
45
46# Language code for this installation. All choices can be found here:
47# http://www.i18nguy.com/unicode/language-identifiers.html
48LANGUAGE_CODE = 'en-us'
49
50SITE_ID = 1
51
52# If you set this to False, Django will make some optimizations so as not
53# to load the internationalization machinery.
54USE_I18N = True
55
56# If you set this to False, Django will not format dates, numbers and
57# calendars according to the current locale.
58USE_L10N = True
59
60# If you set this to False, Django will not use timezone-aware datetimes.
61USE_TZ = True
62
63# Absolute filesystem path to the directory that will hold user-uploaded files.
64# Example: "/var/www/example.com/media/"
65MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
66
67# URL that handles the media served from MEDIA_ROOT. Make sure to use a
68# trailing slash.
69# Examples: "http://example.com/media/", "http://media.example.com/"
70MEDIA_URL = '/media/'
71
72# Absolute path to the directory static files should be collected to.
73# Don't put anything in this directory yourself; store your static files
74# in apps' "static/" subdirectories and in STATICFILES_DIRS.
75# Example: "/var/www/example.com/static/"
76STATIC_ROOT = ''
77
78# URL prefix for static files.
79# Example: "http://example.com/static/", "http://static.example.com/"
80STATIC_URL = '/estatico/'
81
82# Additional locations of static files
83STATICFILES_DIRS = (
84 # Put strings here, like "/home/html/static" or "C:/www/django/static".
85 # Always use forward slashes, even on Windows.
86 # Don't forget to use absolute paths, not relative paths.
87 STATIC_PATH,
88)
89
90# List of finder classes that know how to find static files in
91# various locations.
92STATICFILES_FINDERS = (
93 'django.contrib.staticfiles.finders.FileSystemFinder',
94 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
95# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
96)
97
98# Make this unique, and don't share it with anybody.
99###SECRET_KEY = 'lzcpau%1br-$31x@ur+1@*uknf%((@qlb008_0oxo&kur&_92e'
100SECRET_KEY = 'ht)zvye-87o8s)uexupd3k&)yo^+5xi5rm5f^^&_$yui-ia2sz'
101# List of callables that know how to import templates from various sources.
102TEMPLATE_LOADERS = (
103 'django.template.loaders.filesystem.Loader',
104 'django.template.loaders.app_directories.Loader',
105
106# 'django.template.loaders.eggs.Loader',
107)
108
109MIDDLEWARE_CLASSES = (
110 'django.middleware.common.CommonMiddleware',
111 'django.contrib.sessions.middleware.SessionMiddleware',
112 'django.middleware.csrf.CsrfViewMiddleware',
113 'django.contrib.auth.middleware.AuthenticationMiddleware',
114 'django.contrib.messages.middleware.MessageMiddleware',
115 # Uncomment the next line for simple clickjacking protection:
116 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
117)
118
119ROOT_URLCONF = 'ProyectoFinalMesa22017.urls'
120
121# Python dotted path to the WSGI application used by Django's runserver.
122WSGI_APPLICATION = 'ProyectoFinalMesa22017.wsgi.application'
123
124TEMPLATE_DIRS = (
125 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
126 # Always use forward slashes, even on Windows.
127 # Don't forget to use absolute paths, not relative paths.
128 TEMPLATE_PATH,
129)
130
131INSTALLED_APPS = (
132 'django.contrib.auth',
133 'django.contrib.contenttypes',
134 'django.contrib.sessions',
135 'django.contrib.sites',
136 'django.contrib.messages',
137 'django.contrib.staticfiles',
138 # Uncomment the next line to enable the admin:
139 'django.contrib.admin',
140 # Uncomment the next line to enable admin documentation:
141 # 'django.contrib.admindocs',
142 'directorio1',
143)
144
145SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
146
147# A sample logging configuration. The only tangible logging
148# performed by this configuration is to send an email to
149# the site admins on every HTTP 500 error when DEBUG=False.
150# See http://docs.djangoproject.com/en/dev/topics/logging for
151# more details on how to customize your logging configuration.
152LOGGING = {
153 'version': 1,
154 'disable_existing_loggers': False,
155 'filters': {
156 'require_debug_false': {
157 '()': 'django.utils.log.RequireDebugFalse'
158 }
159 },
160 'handlers': {
161 'mail_admins': {
162 'level': 'ERROR',
163 'filters': ['require_debug_false'],
164 'class': 'django.utils.log.AdminEmailHandler'
165 }
166 },
167 'loggers': {
168 'django.request': {
169 'handlers': ['mail_admins'],
170 'level': 'ERROR',
171 'propagate': True,
172 },
173 }
174}
175
176from django.conf.urls import include, url
177#from django.conf.urls import patterns
178from django.conf import settings
179from django.contrib import admin
180#from directorio1 import views
181from django.conf.urls.static import static
182
183
184urlpatterns = [
185
186 # url(r'^$', views.index, name='index'),
187 url(r'^directorio1/', include('directorio1.urls')),
188 url(r'^admin/', admin.site.urls),
189 ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)