-
-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdjango_router.py
More file actions
19 lines (16 loc) · 784 Bytes
/
Copy pathdjango_router.py
File metadata and controls
19 lines (16 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from reactpy import component, html
from reactpy_router import route
from reactpy_django.router import django_router
@component
def my_component():
return django_router(
route("/router/", html.div("Example 1")),
route("/router/any/<value>/", html.div("Example 2")),
route("/router/integer/<int:value>/", html.div("Example 3")),
route("/router/path/<path:value>/", html.div("Example 4")),
route("/router/slug/<slug:value>/", html.div("Example 5")),
route("/router/string/<str:value>/", html.div("Example 6")),
route("/router/uuid/<uuid:value>/", html.div("Example 7")),
route("/router/two_values/<int:value>/<str:value2>/", html.div("Example 8")),
route("/router/<any:value>", html.div("Fallback")),
)