- Add django.contrib.auth to INSTALLED_APPS - Fix URL routing structure for proper API endpoints - Add API root endpoint with endpoint information - Verify all API endpoints working correctly
27 lines
716 B
Python
27 lines
716 B
Python
from django.urls import path, include
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.http import JsonResponse
|
|
|
|
|
|
def api_root(request):
|
|
return JsonResponse({
|
|
'message': 'Poker Card Design System API',
|
|
'version': '1.0',
|
|
'endpoints': {
|
|
'projects': '/api/projects/',
|
|
'templates': '/api/templates/',
|
|
}
|
|
})
|
|
|
|
|
|
urlpatterns = [
|
|
path('', api_root),
|
|
path('api/projects/', include('apps.projects.urls')),
|
|
path('api/templates/', include('apps.templates.urls')),
|
|
path('api/', include('apps.exports.urls')),
|
|
]
|
|
|
|
if settings.DEBUG:
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|