Skip to content

How do I use URL routing? #242

Discussion options

You must be logged in to vote

You need to register the URL endpoints with both Django and ReactPy. Unfortunately there was no way for us to automate this.

For example, if you know that all /example/route/ URLs will need to be handled by ReactPy, then you will need to

  1. Register the URL with Django, as permissively as needed.
    • For example, the following would match all paths starting with /example/route/
    • re_path(r"^/example/route/.*$", my_reactpy_view)
  2. Make sure to handle those routes within ReactPy Router.
django_router(
    route("/exmaple/route/123", html.div("Example 1")),
    route("/router/*", html.div("Fallback")),
)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@danieludokike
Comment options

@Archmonger
Comment options

Answer selected by Archmonger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants