Jelajahi Sumber

update settings and urls files

sxoinas12 2 tahun lalu
induk
melakukan
8c410f2d73
2 mengubah file dengan 9 tambahan dan 2 penghapusan
  1. 2 1
      telecaster/telecaster/settings.py
  2. 7 1
      telecaster/telecaster/urls.py

+ 2 - 1
telecaster/telecaster/settings.py

@@ -37,6 +37,7 @@ INSTALLED_APPS = [
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
+    'telecaster',
 ]
 
 MIDDLEWARE = [
@@ -67,7 +68,7 @@ TEMPLATES = [
     },
 ]
 
-WSGI_APPLICATION = 'telecaster.wsgi.application'
+WSGI_APPLICATION = 'wsgi.application'
 
 
 # Database

+ 7 - 1
telecaster/telecaster/urls.py

@@ -14,8 +14,14 @@ Including another URLconf
     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
 """
 from django.contrib import admin
-from django.urls import path
+from django.urls import path, re_path
+from rest_framework import routers
+from .views import XmlGeneratorView
+
+
+router = routers.SimpleRouter(trailing_slash=False)
 
 urlpatterns = [
+    re_path(r'^generate/xml', view=XmlGeneratorView.as_view()),
     path('admin/', admin.site.urls),
 ]