Sorry if this question was supposed to be in Server Vault. I couldn't really tell whether it's a programming error or a server configuration error.
I recently pushed my git commits to the live server and I noticed something very frustrating.
No matter how I edit the urls.py
, I can't seem to update RedirectView
!
Here is my root mysite/urls.py
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url=reverse_lazy('order_list')), name='home'),
url(r'^doors/', include('doors.urls')),
url(r'^accounts/', include('registration.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^{}/'.format(settings.DAJAXICE_MEDIA_PREFIX), include('dajaxice.urls')),
)
The named URL order_list
comes from one of my app's urls.py
urlpatterns = patterns('doors.views',
url(r'^order/$', OrderListView.as_view(), name='order_list'),
# And more URL patterns...
)
So basically I simply changed r'^orders/$'
to r'^order/$'
in the last commit. But whenever I do {% url home %}
, I noticed the server keeps trying to redirect to the old path of /doors/orders/
instead of /doors/order/
. I also noticed that the redirect is a 301 Moved Permanently
.
So I tried to add permenant=False
to RedirectView
and restarted the server. But it still goes to /doors/orders/
and the redirect is still 301
(it should have been 302
)!
Why isn't my RedirectView
redirecting to the updated URL?
Server info
Running Apache 2.2.21 using mod_wsgi with Django 1.4 on Gentoo Linux