##// END OF EJS Templates
Se solucionó un problema de redireccionamiento a login
Renato-TUF -
r379:5839796a8bfd
parent child
Show More
@@ -1,169 +1,170
1 1 """
2 2 Django settings for radarsys project.
3 3
4 4 Generated by 'django-admin startproject' using Django 1.8.6.
5 5
6 6 For more information on this file, see
7 7 https://docs.djangoproject.com/en/1.8/topics/settings/
8 8
9 9 For the full list of settings and their values, see
10 10 https://docs.djangoproject.com/en/1.8/ref/settings/
11 11 """
12 12
13 13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 14 import os
15 15
16 16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 17
18 18 # Quick-start development settings - unsuitable for production
19 19 # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
20 20
21 21 # SECURITY WARNING: keep the secret key used in production secret!
22 22 SECRET_KEY = 'xshb$k5fc-+j16)cvyffj&9u__0q3$l!hieh#+tbzqg)*f^km0'
23 23
24 24 # SECURITY WARNING: don't run with debug turned on in production!
25 25 DEBUG = True
26 26
27 27 ALLOWED_HOSTS = ['*']
28 28
29 29 CSRF_TRUSTED_ORIGINS=[
30 30 "http://*.localhost:8030",
31 31 "http://localhost:8030",
32 32 "http://127.0.0.1:8030"
33 33 ]
34 34 #Si se requiere que la aplicación salga de este entorno, para otros usuarios es necesario hacer una API request https://fractalideas.com/blog/making-react-and-django-play-well-together-single-page-app-model/
35 35
36 36 # Application definition
37 37
38 38 INSTALLED_APPS = [
39 39 'django.contrib.admin',
40 40 'django.contrib.auth',
41 41 'django.contrib.contenttypes',
42 42 'django.contrib.sessions',
43 43 'django.contrib.messages',
44 44 'django.contrib.staticfiles',
45 45 'apps.accounts',
46 46 'apps.main',
47 47 'apps.misc',
48 48 'apps.rc',
49 49 'apps.dds',
50 50 'apps.jars',
51 51 'apps.usrp',
52 52 'apps.abs',
53 53 'apps.cgs',
54 54 'apps.dds_rest',
55 55 "django_bootstrap5",
56 56 'polymorphic',
57 'channels',
57 58 ]
58 59
59 60 MIDDLEWARE = [
60 61 'django.middleware.security.SecurityMiddleware',
61 62 'django.contrib.sessions.middleware.SessionMiddleware',
62 63 'django.middleware.common.CommonMiddleware',
63 64 'django.middleware.csrf.CsrfViewMiddleware',
64 65 'django.contrib.auth.middleware.AuthenticationMiddleware',
65 66 'django.contrib.messages.middleware.MessageMiddleware',
66 67 'django.middleware.clickjacking.XFrameOptionsMiddleware',
67 68
68 69 ]
69 70
70 71 ROOT_URLCONF = 'radarsys.urls'
71 72
72 73 TEMPLATES = [
73 74 {
74 75 'BACKEND': 'django.template.backends.django.DjangoTemplates',
75 76 'DIRS': [os.path.join(BASE_DIR, "templates")],
76 77 'APP_DIRS': True,
77 78 'OPTIONS': {
78 79 'context_processors': [
79 80 'django.template.context_processors.debug',
80 81 'django.template.context_processors.request',
81 82 'django.contrib.auth.context_processors.auth',
82 83 'django.contrib.messages.context_processors.messages',
83 84 'apps.main.processors.radarsys_globals',
84 85 ],
85 86 },
86 87 },
87 88 ]
88 89
89 90 WSGI_APPLICATION = 'radarsys.wsgi.application'
90 91 ASGI_APPLICATION = 'radarsys.asgi.application'
91 92
92 93 # Database
93 94 # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
94 95
95 96 DATABASES = {
96 97 # 'default': {
97 98 # 'ENGINE': 'django.db.backends.sqlite3',
98 99 # 'NAME': 'radarsys.sqlite',
99 100 # }
100 101 'default': {
101 102 'ENGINE': 'django.db.backends.postgresql_psycopg2',
102 103 'NAME': os.environ.get('DB_NAME', 'radarsys'),
103 104 'USER': os.environ.get('DB_USER', 'docker'),
104 105 'PASSWORD': os.environ.get('DB_PASSWORD', 'docker'),
105 106 'HOST': os.environ.get('POSTGRES_PORT_5432_TCP_ADDR', 'localhost'),
106 107 'PORT': os.environ.get('POSTGRES_PORT_5432_TCP_PORT', '5432'),
107 108 }
108 109 }
109 110
110 111 # Internationalization
111 112 # https://docs.djangoproject.com/en/1.8/topics/i18n/
112 113
113 114 LANGUAGE_CODE = 'en-us'
114 115
115 116 USE_TZ = False #True
116 117
117 118 TIME_ZONE = os.environ.get('TZ', 'America/Lima')
118 119
119 120 USE_I18N = True
120 121
121 122 USE_L10N = True
122 123
123 124 # Static files (CSS, JavaScript, Images)
124 125 # https://docs.djangoproject.com/en/1.8/howto/static-files/
125 126
126 127 MEDIA_URL = '/media/'
127 128 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
128 129
129 130 STATICFILES_DIRS = [
130 131 os.path.join(BASE_DIR, 'radarsys/static/')
131 132 ]
132 133
133 134 STATIC_URL = '/static/'
134 135 STATIC_ROOT = os.path.join(BASE_DIR, 'static')
135 136
136 LOGIN_URL = 'login'
137 LOGIN_URL = '/accounts/login'
137 138 LOGOUT_URL = 'logout'
138 139 LOGIN_REDIRECT_URL = '/admin'
139 140 LOGOUT_REDIRECT_URL = '/'
140 141
141 142 STATICFILES_FINDERS = (
142 143 'django.contrib.staticfiles.finders.FileSystemFinder',
143 144 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
144 145 )
145 146
146 147 # # Celery stuff
147 148
148 149 # REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost')
149 150 # #REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
150 151 # REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
151 152
152 153 # BROKER_TRANSPORT = 'redis'
153 154 # #BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
154 155 # BROKER_URL = 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT)
155 156
156 157 # CELERY_RESULT_BACKEND = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
157 158 # CELERY_BROKER_TRANSPORT = BROKER_URL
158 159 # CELERY_ACCEPT_CONTENT = ['application/json']
159 160 # CELERY_TASK_SERIALIZER = 'json'
160 161 # CELERY_RESULT_SERIALIZER = 'json'
161 162 # CELERY_ENABLE_UTC = False
162 163 # CELERY_TIMEZONE = 'America/Lima'
163 164
164 165 import django
165 166 from django.utils.encoding import force_str
166 167 django.utils.encoding.force_text = force_str
167 168
168 169 # choose of auto-created primary keys
169 170 DEFAULT_AUTO_FIELD='django.db.models.AutoField'
General Comments 0
You need to be logged in to leave comments. Login now