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