1
- """
2
- URL configuration for zeno project.
3
-
4
- The `urlpatterns` list routes URLs to views. For more information please see:
5
- https://docs.djangoproject.com/en/5.2/topics/http/urls/
6
- Examples:
7
- Function views
8
- 1. Add an import: from my_app import views
9
- 2. Add a URL to urlpatterns: path('', views.home, name='home')
10
- Class-based views
11
- 1. Add an import: from other_app.views import Home
12
- 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
13
- Including another URLconf
14
- 1. Import the include() function: from django.urls import include, path
15
- 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
16
- """
17
1
from django .contrib import admin
18
- from django .urls import path ,include
19
- from django .conf import settings
2
+ from django .urls import path , include , re_path
3
+ from rest_framework import permissions
4
+ from drf_yasg .views import get_schema_view
5
+ from drf_yasg import openapi
20
6
7
+ schema_view = get_schema_view (
8
+ openapi .Info (
9
+ title = "Zeno AI API" ,
10
+ default_version = 'v1' ,
11
+ description = "API documentation for Zeno AI - Economic Reasoning System" ,
12
+ contact = openapi .Contact (email = "support@zenoai.com" ),
13
+ license = openapi .License (name = "BSD License" ),
14
+ ),
15
+ public = True ,
16
+ permission_classes = [permissions .AllowAny ],
17
+ )
21
18
22
19
urlpatterns = [
23
20
path ('admin/' , admin .site .urls ),
24
21
path ('api/' , include ('api.urls' )),
25
- ]
22
+ # --- Swagger and Redoc docs ---
23
+ re_path (r'^swagger(?P<format>\.json|\.yaml)$' , schema_view .without_ui (cache_timeout = 0 ), name = 'schema-json' ),
24
+ path ('swagger/' , schema_view .with_ui ('swagger' , cache_timeout = 0 ), name = 'schema-swagger-ui' ),
25
+ path ('redoc/' , schema_view .with_ui ('redoc' , cache_timeout = 0 ), name = 'schema-redoc' ),
26
+ ]
0 commit comments