diff --git a/core/core/urls.py b/core/core/urls.py index cbc52c0..c115026 100644 --- a/core/core/urls.py +++ b/core/core/urls.py @@ -20,7 +20,7 @@ from django.urls import path, include from .version import get_info urlpatterns = [ - path('admin/', admin.site.urls), + path('djangoadmin/', admin.site.urls), path('api/1/', include('inventory.api_v1')), path('api/1/', include('files.api_v1')), path('api/1/', include('files.media_v1')), diff --git a/core/requirements.prod.txt b/core/requirements.prod.txt index 2212d3c..b176517 100644 --- a/core/requirements.prod.txt +++ b/core/requirements.prod.txt @@ -1,30 +1,18 @@ aiosmtpd==1.4.4.post2 aiosmtplib==3.0.1 -anyio==4.0.0 asgiref==3.7.2 -async-timeout==4.0.3 -atpublic==4.0 attrs==23.1.0 certifi==2023.11.17 channels==4.0.0 channels-redis==4.1.0 -charset-normalizer==3.3.2 -click==8.1.7 coreapi==2.3.3 coreschema==0.0.4 -coverage==7.3.2 Django==4.2.7 django-extensions==3.2.3 django-mysql==4.12.0 django-soft-delete==0.9.21 djangorestframework==3.14.0 drf-yasg==1.21.7 -h11==0.14.0 -httptools==0.6.1 -idna==3.4 -inflection==0.5.1 -itypes==1.2.0 -Jinja2==3.1.2 MarkupSafe==2.1.3 msgpack==1.0.7 msgpack-python==0.5.6 @@ -35,11 +23,9 @@ Pillow==10.1.0 python-dotenv==1.0.0 pytz==2023.3.post1 PyYAML==6.0.1 -redis==5.0.1 requests==2.31.0 sdnotify==0.3.2 setproctitle==1.3.3 -six==1.16.0 sniffio==1.3.0 sqlparse==0.4.4 typing_extensions==4.8.0 diff --git a/core/server.py b/core/server.py index ca1853d..621e6fd 100644 --- a/core/server.py +++ b/core/server.py @@ -1,10 +1,14 @@ #!/usr/bin/env python3 -import asyncio import logging import os +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings') + +import django import uvicorn +django.setup() + from helper import init_loop from lmtp.protocol import LMTPHandler from lmtp.socket import UnixSocketLMTPController diff --git a/deploy/ansible/playbooks/templates/nginx.conf.j2 b/deploy/ansible/playbooks/templates/nginx.conf.j2 index 9834392..3484bc6 100644 --- a/deploy/ansible/playbooks/templates/nginx.conf.j2 +++ b/deploy/ansible/playbooks/templates/nginx.conf.j2 @@ -43,7 +43,7 @@ server { proxy_pass http://c3lf-sys3; } - location /admin { + location /djangoadmin { proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; diff --git a/web/public/index.html b/web/public/index.html index efc4b5f..313803b 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -5,7 +5,7 @@ - c3cloc + c3lf