Skip to content

Commit 4c6c3e2

Browse files
committed
Update plain, new Router for urls
1 parent d9e2cb7 commit 4c6c3e2

File tree

2 files changed

+37
-15
lines changed

2 files changed

+37
-15
lines changed

app/urls.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from plain.urls import path
1+
from plain.urls import path, RouterBase, register_router
22
from plain.views import TemplateView, View
33

44

@@ -21,8 +21,10 @@ def get(self):
2121
return "Hello World!"
2222

2323

24-
urlpatterns = [
25-
path("json/", ExampleJsonView),
26-
path("text/", ExamplePlaintextView),
27-
path("", ExampleTemplateView),
28-
]
24+
@register_router
25+
class Router(RouterBase):
26+
urls = [
27+
path("json/", ExampleJsonView),
28+
path("text/", ExamplePlaintextView),
29+
path("", ExampleTemplateView),
30+
]

uv.lock

Lines changed: 29 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)