problem with url

7 views
Skip to first unread message

randmw...@gmail.com

unread,
May 2, 2019, 9:44:06 AM5/2/19
to Django users
new to django. so i have an app that displays an html page. i also have a menu on that page that will load up other html pages.
however, when i add the path to urls.py and then the class def in views, it fails. i know it's something simple, what am i missing. 

As I said, the dashboard.html works, i just want another menu option to load the other html file. i have commented this out as it causes my app to break.



urls.py

from django.conf.urls import url
from django.contrib import admin
from django.urls import path

from vr_reporting_app.views import HomeView
from vr_reporting_app.views import Map

urlpatterns = [
    path('', HomeView.as_view(), name='home'),    #points to the view in views.py 
    #path('map/', Map.as_view(), name='map'),                                                          
    path('admin/', admin.site.urls),
]


views.py

from django.shortcuts import render
from django.views.generic.base import TemplateView

class HomeView(TemplateView):
template_name = 'dashboard.html'

class Map(TemplateView):
template_name = 'map.html'

Reply all
Reply to author
Forward
0 new messages