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

Тел: +7 965 3737 888

419

Просмотров

2

Ответов

Middleware to prevent access to the admin when user ip not in INTERNAL_IPS

This middleware will prevent access to the admin if the users IP isn't in the INTERNAL_IPS setting, by comparing the request path with the reversed index URL of the default admin site, ultimately raising a 404 (unless DEBUG = True).

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

Ответы (2):

Ответblueyonder:29.03.2012
Ответ полезен? Да0/Нет0

works like a charm, thanks

Ответdiverman:05.07.2010
Ответ полезен? Да0/Нет0

What about raising "Forbidden" instead of "Not found"? Have you tried access control using Apache directives?