r/django•
lmtstrm

Redirect all but a few URL's to a 403 response page.

Hi guys, I'm writing a Django app, and I'm trying to have all url's but a few redirected to a 403 page. I tried the following on my urls.py:

from django.conf.urls import include, url,handler403
from django.contrib import admin

urlpatterns = [
    url(r'(?!foo|admin)',include(handler403)),
    url(r'^foo/', include('foo.urls')),
    url(r'admin/',include(admin.site.urls)),
]

But, when I run the server, I get this error (on Pastebin).

I am lost here. Any help would be greatly appreciated.

Posted Dec 3, 2015, 12:05 AM UTC

412
Loading comments…