##// END OF EJS Templates
Retorno desde el universo borrado previamente, se hace la modificación del pyscopg2 en requirements.txt y comento algunas cosas más de celeery y redis
Renato-TUF -
r365:ae1e52242b94
parent child
Show More
@@ -0,0 +1,42
1 # Generated by Django 4.1.5 on 2023-01-30 08:51
2
3 from django.db import migrations, models
4 import django.db.models.deletion
5
6
7 class Migration(migrations.Migration):
8
9 initial = True
10
11 dependencies = [
12 ('main', '0001_initial'),
13 ('abs', '0001_initial'),
14 ]
15
16 operations = [
17 migrations.CreateModel(
18 name='ABSConfiguration',
19 fields=[
20 ('configuration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.configuration')),
21 ('active_beam', models.PositiveSmallIntegerField(default=0, verbose_name='Active Beam')),
22 ('module_status', models.CharField(default='0000000000000000000000000000000000000000000000000000000000000000', max_length=10000, verbose_name='Module Status')),
23 ('operation_mode', models.PositiveSmallIntegerField(choices=[(0, 'Manual'), (1, 'Automatic')], default=0, verbose_name='Operation Mode')),
24 ('operation_value', models.FloatField(blank=True, default='10', null=True, verbose_name='Periodic (seconds)')),
25 ('module_messages', models.CharField(default='{"1": "Module 1", "2": "Module 2", "3": "Module 3", "4": "Module 4", "5": "Module 5", "6": "Module 6", "7": "Module 7", "8": "Module 8", "9": "Module 9", "10": "Module 10", "11": "Module 11", "12": "Module 12", "13": "Module 13", "14": "Module 14", "15": "Module 15", "16": "Module 16", "17": "Module 17", "18": "Module 18", "19": "Module 19", "20": "Module 20", "21": "Module 21", "22": "Module 22", "23": "Module 23", "24": "Module 24", "25": "Module 25", "26": "Module 26", "27": "Module 27", "28": "Module 28", "29": "Module 29", "30": "Module 30", "31": "Module 31", "32": "Module 32", "33": "Module 33", "34": "Module 34", "35": "Module 35", "36": "Module 36", "37": "Module 37", "38": "Module 38", "39": "Module 39", "40": "Module 40", "41": "Module 41", "42": "Module 42", "43": "Module 43", "44": "Module 44", "45": "Module 45", "46": "Module 46", "47": "Module 47", "48": "Module 48", "49": "Module 49", "50": "Module 50", "51": "Module 51", "52": "Module 52", "53": "Module 53", "54": "Module 54", "55": "Module 55", "56": "Module 56", "57": "Module 57", "58": "Module 58", "59": "Module 59", "60": "Module 60", "61": "Module 61", "62": "Module 62", "63": "Module 63", "64": "Module 64"}', max_length=10000, verbose_name='Modules Messages')),
26 ],
27 options={
28 'db_table': 'abs_configurations',
29 },
30 bases=('main.configuration',),
31 ),
32 migrations.AddField(
33 model_name='absbeam',
34 name='abs_conf',
35 field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='abs.absconfiguration', verbose_name='ABS Configuration'),
36 ),
37 migrations.AddField(
38 model_name='absactive',
39 name='conf',
40 field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='abs.absconfiguration', verbose_name='ABS Configuration'),
41 ),
42 ]
@@ -1,158 +1,158
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': {
90 'ENGINE': 'django.db.backends.sqlite3',
91 'NAME': 'radarsys.sqlite',
92 }
93 # 'default': {
89 # 'default': {
94 # 'ENGINE': 'django.db.backends.postgresql_psycopg2',
90 # 'ENGINE': 'django.db.backends.sqlite3',
95 # 'NAME': os.environ.get('DB_NAME', 'radarsys'),
91 # 'NAME': 'radarsys.sqlite',
96 # 'USER': os.environ.get('DB_USER', 'docker'),
97 # 'PASSWORD': os.environ.get('DB_PASSWORD', 'docker'),
98 # 'HOST': os.environ.get('POSTGRES_PORT_5432_TCP_ADDR', 'localhost'),
99 # 'PORT': os.environ.get('POSTGRES_PORT_5432_TCP_PORT', '5400'),
100 #}
92 # }
93 'default': {
94 'ENGINE': 'django.db.backends.postgresql_psycopg2',
95 'NAME': os.environ.get('DB_NAME', 'radarsys'),
96 'USER': os.environ.get('DB_USER', 'docker'),
97 'PASSWORD': os.environ.get('DB_PASSWORD', 'docker'),
98 'HOST': os.environ.get('POSTGRES_PORT_5432_TCP_ADDR', 'localhost'),
99 'PORT': os.environ.get('POSTGRES_PORT_5432_TCP_PORT', '5432'),
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 LOGIN_URL = 'login'
125 LOGIN_URL = 'login'
126 LOGOUT_URL = 'logout'
126 LOGOUT_URL = 'logout'
127 LOGIN_REDIRECT_URL = '/admin'
127 LOGIN_REDIRECT_URL = '/admin'
128 LOGOUT_REDIRECT_URL = '/'
128 LOGOUT_REDIRECT_URL = '/'
129
129
130 STATICFILES_FINDERS = (
130 STATICFILES_FINDERS = (
131 'django.contrib.staticfiles.finders.FileSystemFinder',
131 'django.contrib.staticfiles.finders.FileSystemFinder',
132 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
132 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
133 )
133 )
134
134
135 # Celery stuff
135 # # Celery stuff
136
136
137 REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost')
137 # REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost')
138 #REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
138 # #REDIS_HOST = os.environ.get('REDIS_HOST', '127.0.0.1')
139 REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
139 # REDIS_PORT = os.environ.get('REDIS_PORT', 6379)
140
140
141 BROKER_TRANSPORT = 'redis'
141 # BROKER_TRANSPORT = 'redis'
142 #BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
142 # #BROKER_URL = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
143 BROKER_URL = 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT)
143 # BROKER_URL = 'redis://{}:{}'.format(REDIS_HOST, REDIS_PORT)
144
144
145 CELERY_RESULT_BACKEND = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
145 # CELERY_RESULT_BACKEND = 'redis://{}:{}/0'.format(REDIS_HOST, REDIS_PORT)
146 CELERY_BROKER_TRANSPORT = BROKER_URL
146 # CELERY_BROKER_TRANSPORT = BROKER_URL
147 CELERY_ACCEPT_CONTENT = ['application/json']
147 # CELERY_ACCEPT_CONTENT = ['application/json']
148 CELERY_TASK_SERIALIZER = 'json'
148 # CELERY_TASK_SERIALIZER = 'json'
149 CELERY_RESULT_SERIALIZER = 'json'
149 # CELERY_RESULT_SERIALIZER = 'json'
150 CELERY_ENABLE_UTC = False
150 # CELERY_ENABLE_UTC = False
151 CELERY_TIMEZONE = 'America/Lima'
151 # CELERY_TIMEZONE = 'America/Lima'
152
152
153 import django
153 import django
154 from django.utils.encoding import force_str
154 from django.utils.encoding import force_str
155 django.utils.encoding.force_text = force_str
155 django.utils.encoding.force_text = force_str
156
156
157 # choose of auto-created primary keys
157 # choose of auto-created primary keys
158 DEFAULT_AUTO_FIELD='django.db.models.AutoField'
158 DEFAULT_AUTO_FIELD='django.db.models.AutoField'
@@ -1,12 +1,12
1 Django==4.1.5
1 Django==4.1.5
2 django-bootstrap5==22.2
2 django-bootstrap5==22.2
3 psycopg[binary]==3.1.8
3 psycopg2-binary==2.9.5
4 django-polymorphic==3.1
4 django-polymorphic==3.1
5 bokeh==3.0.3
5 bokeh==3.0.3
6 numpy==1.24.1
6 numpy==1.24.1
7 matplotlib==3.6.3
7 matplotlib==3.6.3
8 scipy==1.10.0
8 scipy==1.10.0
9 celery==5.2.7
9 celery==5.2.7
10 gunicorn==20.1.0
10 gunicorn==20.1.0
11 requests==2.28.2
11 requests==2.28.2
12 redis==4.4.2
12 redis==4.4.2
General Comments 0
You need to be logged in to leave comments. Login now