mirror of
https://github.com/MOIS3Y/logs-collector.git
synced 2025-09-13 13:13:01 +02:00
Refactoring: new multi app structure
This commit is contained in:
@@ -35,8 +35,8 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'collector.apps.CollectorConfig', # main app
|
||||
'account.apps.AccountConfig', # account app
|
||||
'apps.collector.apps.CollectorConfig', # main app
|
||||
'apps.account.apps.AccountConfig', # account app
|
||||
'rest_framework',
|
||||
'rest_framework_simplejwt',
|
||||
'django_filters',
|
||||
@@ -129,6 +129,9 @@ USE_TZ = True
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATICFILES_DIRS = [
|
||||
BASE_DIR / "static",
|
||||
]
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
|
@@ -11,7 +11,7 @@ from drf_spectacular.views import (
|
||||
from two_factor.urls import urlpatterns as tf_urls
|
||||
|
||||
from logs_collector import settings
|
||||
from account.utils import AdminSiteOTPRequiredMixinRedirectSetup
|
||||
from apps.account.utils import AdminSiteOTPRequiredMixinRedirectSetup
|
||||
|
||||
|
||||
# ? 2FA patch (Admin site protection)
|
||||
@@ -19,12 +19,29 @@ admin.site.__class__ = AdminSiteOTPRequiredMixinRedirectSetup
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
path('', include('collector.urls', namespace='collector')),
|
||||
path('', include(tf_urls)),
|
||||
path('', include('account.urls', namespace='account'))
|
||||
path(
|
||||
'admin/',
|
||||
admin.site.urls
|
||||
),
|
||||
path(
|
||||
'',
|
||||
include('apps.collector.urls', namespace='collector')
|
||||
),
|
||||
path(
|
||||
'',
|
||||
include(tf_urls)
|
||||
),
|
||||
path(
|
||||
'',
|
||||
include('apps.account.urls', namespace='account')
|
||||
),
|
||||
path(
|
||||
'api/',
|
||||
include('apps.collector.api.urls', namespace='collector_api')
|
||||
),
|
||||
]
|
||||
|
||||
# SWAGGER URLS:
|
||||
urlpatterns += [
|
||||
# API PATTERNS
|
||||
path('api/v1/schema/', SpectacularAPIView.as_view(), name='schema'),
|
||||
|
Reference in New Issue
Block a user