Download core/urls.py from ecocyclehub-capstone-dicoding/ecocyclehub-api: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/resolve/main/core/urls.py
- Command line
-
hf download hf://spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/core/urls.py
-
curl -L -o urls.py https://huggingface.co/spaces/ecocyclehub-capstone-dicoding/ecocyclehub-api/resolve/main/core/urls.py
1.49 kB
| """ | |
| URL configuration for core project. | |
| The `urlpatterns` list routes URLs to views. For more information please see: | |
| https://docs.djangoproject.com/en/6.0/topics/http/urls/ | |
| Examples: | |
| Function views | |
| 1. Add an import: from my_app import views | |
| 2. Add a URL to urlpatterns: path('', views.home, name='home') | |
| Class-based views | |
| 1. Add an import: from other_app.views import Home | |
| 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | |
| Including another URLconf | |
| 1. Import the include() function: from django.urls import include, path | |
| 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | |
| """ | |
| from django.contrib import admin | |
| from django.urls import path, include | |
| from django.shortcuts import redirect | |
| from drf_spectacular.views import ( | |
| SpectacularAPIView, | |
| SpectacularSwaggerView, | |
| ) | |
| def home(request): | |
| return redirect("/api/docs/") | |
| urlpatterns = [ | |
| path('', home), | |
| path('admin/', admin.site.urls), | |
| path('api/auth/', include('apps.auths.urls')), | |
| path('api/users/', include('apps.users.urls')), | |
| path('api/categories/', include('apps.categories.urls')), | |
| path('api/transactions/', include('apps.transactions.urls')), | |
| path('api/dashboard/', include('apps.dashboards.urls')), | |
| path('api/gamification/', include('apps.gamification.urls')), | |
| path('api/schema/', SpectacularAPIView.as_view(), name='schema'), | |
| path('api/docs/',SpectacularSwaggerView.as_view(url_name='schema'),name='swagger-ui'), | |
| ] | |