A
A
Alexey Mistin2015-05-02 09:32:11
Django
Alexey Mistin, 2015-05-02 09:32:11

how to get url in django?

Hello.
There is a site on django, for example test.ru
How can I get the url of the page I'm on? (If I'm on test.ru/contacts/, then I need to get /contacts/)
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
marazmiki, 2015-05-02
@Mistin

request.path or request.path_info

Z
zelsky, 2015-05-02
@zelsky

Regex. r'$/contact' Something like that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question