Files
state-corp-backend/src/config/urls.py
Aleksandr Meshchriakov fd2adf9ab4 Refactor project structure and update configurations for State Corp backend
- Updated project description in __init__.py
- Enhanced .gitignore to exclude additional data files
- Modified User model to remove first_name and last_name fields
- Improved instance save method in services.py to include updated_at field
- Added API tokens to .env.example for external services
- Cleaned up test files for better readability
- Updated Dockerfile and docker-compose.yml for improved setup
- Revised README.md to reflect project changes and added changelog
2026-02-17 09:24:42 +01:00

58 lines
1.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
URL Configuration for the project.
The `urlpatterns` list routes URLs to views.
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
# Swagger schema view
schema_view = get_schema_view(
openapi.Info(
title="State Corp API",
default_version="v1",
description="""
## API документация для проекта State Corp
### Авторизация
Для доступа к защищённым эндпоинтам используйте JWT токен:
1. Получите токен через `POST /api/v1/users/login/`
2. Добавьте заголовок: `Authorization: Bearer <access_token>`
### Обновление токена
Используйте `POST /api/v1/users/token/refresh/` с refresh токеном.
### Парсеры
API предоставляет только чтение данных (GET, GET list).
Добавление и удаление записей происходит через парсеры и админку.
""",
contact=openapi.Contact(email="contact@state-corp.local"),
license=openapi.License(name="BSD License"),
),
public=True,
permission_classes=(permissions.AllowAny,),
)
urlpatterns = [
path(
"",
schema_view.with_ui("swagger", cache_timeout=0),
name="schema-swagger-ui",
),
path("admin/", admin.site.urls),
path("health/", include("apps.core.urls")),
path("api/v1/", include("config.api_v1_urls", namespace="api_v1")),
path("auth/", include("rest_framework.urls")),
]
# Serve media files in development
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)