W
W
Workguy2020-08-14 21:59:35
Django
Workguy, 2020-08-14 21:59:35

How to set the path to an HTML template located in another application (django)?

After this branch of the if loop , I want to make the user, after clicking the button, display an HTML template located in another application of the same project. The problem is that I can't get the path to this HTML template.

if the_user.nick == nick and the_user.password == password:
            current_person = {
               'current_person_id': the_user.id,
               'current_person_nick': the_user.nick,
               'current_person_password': the_user.password,
               'current_person_age': the_user.age
            }
            return render(request, '../USERS/4user/index.html', current_person)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-08-14
@Workguy

"application_name/pattern_file", not sure if it will work, but mistakenly look in which directories the template will be searched for, and correct accordingly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question