Files
Parsa Nazer 337e0723a8 torob
2026-05-18 14:26:00 +03:30

44 lines
1.9 KiB
Python

from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from drf_spectacular.views import SpectacularSwaggerView, SpectacularAPIView
from django.conf import settings
from rest_framework_simplejwt.views import TokenObtainPairView
from product import views
from product.torob_api import TorobProductSyncView
from account.views import CustomTokenObtainPairView, TokenRefreshView
from home.views import HomeView
from .views import FakeAdminLoginView
from azbankgateways.urls import az_bank_gateways_urls
from order.torob_api import TorobOrderTrackingView
admin.autodiscover()
urlpatterns = [
# djoser
# path('auth/', include('djoser.urls')),
# path('auth/', include('djoser.urls.jwt')),
path('home', HomeView.as_view()),
path('token', CustomTokenObtainPairView.as_view(), name='token_obtain_pair'),
path('token/refresh', TokenRefreshView.as_view(), name='token_refresh'),
path('admin/', FakeAdminLoginView.as_view()), # Fake admin
path('secret-admin/', admin.site.urls), # Real admin
path('schema/', SpectacularAPIView.as_view(), name='schema'),
path('torob_api/v3/products', TorobProductSyncView.as_view(), name='torob-product-sync'),
path('torob/v1/orders', TorobOrderTrackingView.as_view(), name='torob-order-tracking-root'),
path('products/', include('product.urls')),
path('accounts/', include('account.urls')),
path('chat/', include('chat.urls')),
path('tickets/', include('ticket.urls')),
path('blogs/', include('blog.urls')),
path('order/', include('order.urls')),
path('home/', include('home.urls')),
path("bankgateways/", az_bank_gateways_urls()),
path('', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)