urls.py 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. from django.contrib import admin
  2. from django.conf import settings
  3. from django.urls import path, include, re_path
  4. from django.views.generic.base import TemplateView
  5. from django.contrib.staticfiles.views import serve
  6. from django.views.static import serve as static_serve
  7. from drf_spectacular.views import SpectacularAPIView, SpectacularRedocView, SpectacularSwaggerView
  8. from . import views
  9. def return_static(request, path, insecure=True, **kwargs):
  10. return serve(request, path, insecure, **kwargs)
  11. urlpatterns = [
  12. path('login/', include('userlogin.urls')),
  13. path('register/', include('userregister.urls')),
  14. path('user/', include('userprofile.urls')),
  15. path('groupMeeting/',include ('groupMeeting.urls')),
  16. path('invoice/', include('invoice.urls')),
  17. re_path(r'^favicon\.ico$', views.favicon, name='favicon'),
  18. re_path('^css/.*$', views.css, name='css'),
  19. re_path('^js/.*$', views.js, name='js'),
  20. re_path('^statics/.*$', views.statics, name='statics'),
  21. re_path('^fonts/.*$', views.fonts, name='fonts'),
  22. re_path(r'^robots.txt', views.robots, name='robots'),
  23. re_path(r'^media/(?P<path>.*)$', static_serve, {'document_root': settings.MEDIA_ROOT}),
  24. re_path(r'^static/(?P<path>.*)$', return_static, name='static')
  25. ]
  26. urlpatterns += [
  27. path('api/', SpectacularAPIView.as_view(), name='schema'),
  28. # Optional UI:
  29. path('api/debug/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
  30. path('api/docs/', SpectacularRedocView.as_view(url_name='schema'), name='docs'),
  31. ]