123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- from django.contrib import admin
- from django.conf import settings
- from django.urls import path, include, re_path
- from django.views.generic.base import TemplateView
- from django.contrib.staticfiles.views import serve
- from django.views.static import serve as static_serve
- from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
- from . import views
- def return_static(request, path, insecure=True, **kwargs):
- return serve(request, path, insecure, **kwargs)
- urlpatterns = [
- path('admin/', admin.site.urls),
- path('', TemplateView.as_view(template_name='dist/spa/index.html')),
- path('myip/', views.myip, name='myip'),
- path('asn/', include('asn.urls')),
- path('dn/', include('dn.urls')),
- path('staff/', include('staff.urls')),
- path('binset/', include('binset.urls')),
- path('binsize/', include('binsize.urls')),
- path('binproperty/', include('binproperty.urls')),
- path('capital/', include('capital.urls')),
- path('driver/', include('driver.urls')),
- path('stock/', include('stock.urls')),
- path('company/', include('company.urls')),
- path('cyclecount/', include('cyclecount.urls')),
- path('dashboard/', include('dashboard.urls')),
- path('supplier/', include('supplier.urls')),
- path('customer/', include('customer.urls')),
- path('warehouse/', include('warehouse.urls')),
- path('goods/', include('goods.urls')),
- path('goodsunit/', include('goodsunit.urls')),
- path('goodsclass/', include('goodsclass.urls')),
- path('goodscolor/', include('goodscolor.urls')),
- path('goodsbrand/', include('goodsbrand.urls')),
- path('goodsshape/', include('goodsshape.urls')),
- path('goodsspecs/', include('goodsspecs.urls')),
- path('goodsorigin/', include('goodsorigin.urls')),
- path('scanner/', include('scanner.urls')),
- path('payment/', include('payment.urls')),
- path('login/', include('userlogin.urls')),
- path('register/', include('userregister.urls')),
- path('uploadfile/', include('uploadfile.urls')),
- path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
- re_path(r'^favicon\.ico$', views.favicon, name='favicon'),
- re_path('^css/.*$', views.css, name='css'),
- re_path('^js/.*$', views.js, name='js'),
- re_path('^statics/.*$', views.statics, name='statics'),
- re_path('^fonts/.*$', views.fonts, name='fonts'),
- re_path(r'^robots.txt', views.robots, name='robots'),
- re_path(r'^media/(?P<path>.*)$', static_serve, {'document_root': settings.MEDIA_ROOT}),
- re_path(r'^static/(?P<path>.*)$', return_static, name='static')
- ]
- urlpatterns += [
- path('api/', SpectacularAPIView.as_view(), name='schema'),
- # Optional UI:
- path('api/debug/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
- path('api/docs/', SpectacularRedocView.as_view(url_name='schema'), name='docs'),
- ]
|