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

Тел: +7 965 3737 888

492

Просмотров

0

Ответов

Decorator to modify reverse() to render SSL urls

This snippet monkey-patches Django's reverse() method (use for generating URLs from vew functions and parameters) to allow certain areas of your site to automatically have URLs with the correct SSL domain in place.

This saves you from having to use unnecessary redirects to guide users to an SSL-encrypted version of a page. This should still be used alongside a redirect-based method (such as this snippet) to ensure that the user can't access an unencrypted version of the page

Simply add the code to the files mentioned in the code.

This obviously won't work anywhere that doesn't use reverse(), the admin app seems to be an example of this.

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