install final

This commit is contained in:
2026-04-26 13:08:22 +02:00
parent 648ead3a99
commit 3fa80819ee
13 changed files with 115 additions and 55 deletions
+9 -5
View File
@@ -20,7 +20,7 @@ print("Django BASE_DIR:", BASE_DIR)
PACKAGE_DIR = BASE_DIR.parent
APP_DATAS = PACKAGE_DIR / config('APP_DATAS')
print("Django application data:", APP_DATAS)
# Quick-start development settings - unsuitable for production
@@ -215,9 +215,13 @@ LOCALE_PATHS = (
STATIC_URL = '/static/'
STATIC_ROOT = APP_DATAS / 'staticfiles'
print("Django application STATIC_ROOT:", STATIC_ROOT)
MEDIA_URL = '/media/'
MEDIA_ROOT = APP_DATAS / 'media'
print("Django application MEDIA_ROOT:", MEDIA_ROOT)
"""
STATICFILES_DIRS = [
@@ -259,7 +263,7 @@ LOGGING = None if not IS_LOGGING else {
"encoding" : "utf-8",
},
'file': {
'level': 'INFO',
'level': 'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': BASE_DIR / "logs" / LOGGING_FILE,
'maxBytes': 1024*1024*15, # 15MB
@@ -270,9 +274,9 @@ LOGGING = None if not IS_LOGGING else {
'console': {'class': 'logging.StreamHandler',},
},
'loggers': {
"django": {"handlers": ["null"], "level": "ERROR", "propagate": False,},
"uvicorn": {"handlers": ["null"], "level": "ERROR", "propagate": False,},
"daphne": {"handlers": ["null"], "level": "ERROR", "propagate": False,},
"django": {"handlers": ["file"], "level": "ERROR", "propagate": False,},
"uvicorn": {"handlers": ["file"], "level": "ERROR", "propagate": False,},
"daphne": {"handlers": ["file"], "level": "ERROR", "propagate": False,},
'axes': {"handlers": ['file',],"level": "INFO", "propagate": True, },
"celery": {"handlers": ["celery_file"], "level": "INFO", "propagate": False,},
"celery.task": {"handlers": ["celery_file"], "level": "INFO", "propagate": False, },
@@ -1,7 +1,7 @@
{% extends 'dashboard/base.html' %}
{% extends 'layout.html' %}
{% load i18n %}
{% block main_content %}
{% block content %}
<div class="w3-black w3-border w3-div-center" style="margin: 10em; height: 20em">
{% block main-bar %}
<div class="w3-orange">
@@ -1,7 +1,7 @@
{% extends 'dashboard/base.html' %}
{% extends 'layout.html' %}
{% load i18n %}
{% block main_content %}
{% block content %}
<div class="w3-black w3-border w3-div-center" style="margin: 10em; height: 20em">
{% block main-bar %}
<div class="w3-orange">
+1 -1
View File
@@ -36,7 +36,7 @@ urlpatterns += i18n_patterns(
path('login/', auth_views.LoginView.as_view(template_name='admin/login.html'), name='login'),
path('logout/', auth_views.LogoutView.as_view(), name='logout'),
path('', RedirectView.as_view(url='/scanner/main/', permanent=True), name='redirect_to_mainboard'),
path('', RedirectView.as_view(url='/scanner/calibration/', permanent=True), name='redirect_to_mainboard'),
path('scanner/', include('scanner.urls', namespace='scanner')),
)
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
echo "start workers"
../.venv/bin/python manage.py start_workers
echo "start celery"
../.venv/bin/celery -A home worker -l info
@@ -77,10 +77,10 @@
<a href="{% url 'scanner:reductstore' %}" class="w3-bar-item w3-btn w3-hover-opacity w3-margin-left">
<img class="w3-no-padding" src="/static/img/reductstore.png" style="width: 24px"> {% trans "Base de données Reductstore" %}
</a>
<a href="{% url 'scanner:adminer' %}" class="w3-bar-item w3-btn w3-hover-opacity w3-margin-left">
<a href="{% url 'scanner:adminer' %}" class="w3-bar-item w3-btn w3-hover-opacity w3-margin-left" target="_blank">
<img class="w3-no-padding" src="/static/img/adminer.png" style="width: 28px"> {% trans "Base de données mariadb" %}
</a>
<!--a href="{% url 'scanner:portainer' %}" class="w3-bar-item w3-btn w3-hover-opacity" w3-margin-left>
<!--a href="{% url 'scanner:portainer' %}" class="w3-bar-item w3-btn w3-hover-opacity" w3-margin-left target="_blank">
<img class="w3-no-padding" src="/static/img/portainer.png" style="width: 28px"> {% trans "Portainer" %}
</a-->
<a href="{% url 'scanner:supervisor' %}" class="w3-bar-item w3-btn w3-hover-opacity w3-margin-left">
+10 -10
View File
@@ -5,18 +5,18 @@ from . import views
app_name = "scanner"
urlpatterns = [
path('scanner/admin/', views.admin_view, name='admin'),
path('scanner/reductstore/', views.reductstore_view, name='reductstore'),
path('scanner/adminer/', views.adminer_view, name='adminer'),
path('scanner/portainer/', views.portainer_view, name='portainer'),
path('scanner/calibration/', views.calibration_view, name='calibration'),
path('scanner/supervisor/', views.supervisor_view, name='supervisor'),
path('scanner/logs/worker', views.supervisor_worker, name='logs_worker'),
path('scanner/logs/scheduler', views.supervisor_scheduler, name='logs_scheduler'),
path('admin/', views.admin_view, name='admin'),
path('reductstore/', views.reductstore_view, name='reductstore'),
path('adminer/', views.adminer_view, name='adminer'),
path('portainer/', views.portainer_view, name='portainer'),
path('calibration/', views.calibration_view, name='calibration'),
path('supervisor/', views.supervisor_view, name='supervisor'),
path('logs/worker', views.supervisor_worker, name='logs_worker'),
path('logs/scheduler', views.supervisor_scheduler, name='logs_scheduler'),
path('main/', views.main_view, name='main'),
path('scanner/images/', views.images_view, name='images'),
path('scanner/replay/', views.replay_view, name='replay'),
path('images/', views.images_view, name='images'),
path('replay/', views.replay_view, name='replay'),
path('api/stats/', views.stats_view, name='api_stats'),
path('api/video/', views.download_api, name='download_api'),
path('api/export/', views.export_api, name='export_api'),
+1 -1
View File
@@ -54,7 +54,7 @@ def reductstore_view(request):
@login_required
def adminer_view(request):
return render(request, "scanner/iframe.html", context=global_context(request, link=f'http://{settings.DOMAIN_SERVER}:81/'))
return render(request, "scanner/redirection.html", context=global_context(request, link=f'http://{settings.DOMAIN_SERVER}/adminer/'))
@login_required
def portainer_view(request):