T
T
TheTrace1232019-02-16 23:34:52
Django
TheTrace123, 2019-02-16 23:34:52

How to redirect url from one application to another?

How can I navigate from one url to another? As in the picture 5c6870b460802171198295.png
That is, I have a main page (main page) and from it I can easily go to other 3 applications or urls (project, shop, contacts). And also in each of the 3 applications there is an opportunity to go to other 2 5c687340bddc3663643144.jpeg
But, when I want to go from the application for example 127.0.0.1:8000/shop to contacts/ my page is not found (404). It makes sense because I went to 127.0.0.1:8000/shop/contacts. And I need to go exactly to the application 127.0.0.1:8000/contacts Please tell me an article or documentation on how to do this or describe it with an example. That is, it is from the shop directory that I need to go to the contacts directory.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor, 2019-02-17
@DeadUnicorn

This is done in HTML. In the tag , specify href=''/contacts". Then, when clicked, it will redirect to the contact page <a>

Z
Zanak, 2019-02-17
@Zanak

In one tab, open the page you can't navigate to another page that has a link. Compare what it is and what it should be. It is possible that some variable is not defined in the template context, and the link is collected incorrectly. If so, then the problem will be solved as soon as you give the template all the data.
If you collect links manually, then you can correct the code so that it becomes correct, but this is not the right approach.
Do not listen to bad advice, use url in templates and reverse in the controller, instead of manually building links. This saves you a lot of work if you decide to change the settings of your application, or reuse it in another project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question