forked from microsoft/python-sample-vscode-django-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurls.py
More file actions
18 lines (15 loc) · 599 Bytes
/
urls.py
File metadata and controls
18 lines (15 loc) · 599 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from django.urls import path
from hello import views
from hello.models import LogMessage
home_list_view = views.HomeListView.as_view(
queryset=LogMessage.objects.order_by("-log_date")[:5], # :5 limits the results to the five most recent
context_object_name="message_list",
template_name="hello/home.html",
)
urlpatterns = [
path("", home_list_view, name="home"),
path("hello/<name>", views.hello_there, name="hello_there"),
path("about/", views.about, name="about"),
path("contact/", views.contact, name="contact"),
path("log/", views.log_message, name="log"),
]