Задать вопрос

Тел: +7 965 3737 888

543

Просмотров

0

Ответов

add port from settings file to an url

I'm working on a Project where on certain places I need absolute URL's, in development mode I need the port 8000 added to any absolute url.

This piece of work, took me some time to figure out. Couldn't find something similiar on the net, it's based on Code from the Python urlparse module.

You can change the "settings.PORT" part to "settings.DEBUG == True" if you like, and so on.

META: replace parameters in URL, edit parameters in URL, edit URL, urlparse

Вопрос полезен? Да0/Нет0
file_5171.py(702.0б)
None