From f26b1f419a734bbf0261c3359451ddbe59845578 Mon Sep 17 00:00:00 2001 From: zakhy Date: Mon, 21 Oct 2024 12:50:02 +0700 Subject: [PATCH] fixes --- app/Dockerfile | 4 ++++ app/apps/main/tasks.py | 2 ++ app/repcofkk/urls.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index 2e4062e..b1b1097 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -22,6 +22,10 @@ RUN pip install --no-cache /wheels/* && rm -rf /wheels # copy project COPY . $APP_HOME +RUN mkdir $APP_HOME/log +RUN mkdir $APP_HOME/log/error/ +RUN mkdir $APP_HOME/log/log/ +RUN mkdir $APP_HOME/log/mesage/ # create the app user RUN addgroup --system app && adduser --system --group app && \ diff --git a/app/apps/main/tasks.py b/app/apps/main/tasks.py index 683e93b..192c751 100644 --- a/app/apps/main/tasks.py +++ b/app/apps/main/tasks.py @@ -204,6 +204,8 @@ def create_scales_control_data(): def write_scale_control_data_to_redis(): try: data = PostgresScales.get_scales_data(300) + if not data: + return 'No data' with RedisService(host=REDIS_HOST, port=REDIS_PORT, db=1) as redis_service: for row in data: redis_service.hset_value(row[0], key='Value', value=str(row[1])) diff --git a/app/repcofkk/urls.py b/app/repcofkk/urls.py index b4f8e75..9a0b025 100644 --- a/app/repcofkk/urls.py +++ b/app/repcofkk/urls.py @@ -14,7 +14,7 @@ urlpatterns = [ path('main/', include('apps.main.urls')), path('montorem/', include('apps.montorem.urls')), path('accounts/logout/', views.user_logout, name='user_logout'), - path('accounts/', views.user_login, name='user_login'), + path('accounts/login/', views.user_login, name='user_login'), path('admin/', admin.site.urls), path('current_time/', return_current_time, name='current_time') ]