Note that there are some explanatory texts on larger screens.

plurals
  1. POI can't update Django's RedirectView. It keeps referring to the old URL with a status of 301 Moved Permenantly
    text
    copied!<p>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.</p> <p>I recently pushed my git commits to the live server and I noticed something very frustrating.</p> <p>No matter how I edit the <code>urls.py</code>, I can't seem to update <code>RedirectView</code>!</p> <p>Here is my root <code>mysite/urls.py</code></p> <pre><code>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')), ) </code></pre> <p>The named URL <code>order_list</code> comes from one of my app's <code>urls.py</code></p> <pre><code>urlpatterns = patterns('doors.views', url(r'^order/$', OrderListView.as_view(), name='order_list'), # And more URL patterns... ) </code></pre> <p>So basically I simply changed <code>r'^orders/$'</code> to <code>r'^order/$'</code> in the last commit. But whenever I do <code>{% url home %}</code>, I noticed the server keeps trying to redirect to the <strong>old</strong> path of <code>/doors/orders/</code> instead of <code>/doors/order/</code>. I also noticed that the redirect is a <code>301 Moved Permanently</code>.</p> <p>So I tried to add <code>permenant=False</code> to <code>RedirectView</code> and restarted the server. But it <em>still</em> goes to <code>/doors/orders/</code> and the redirect is still <code>301</code> (it should have been <code>302</code>)!</p> <p>Why isn't my <code>RedirectView</code> redirecting to the updated URL?</p> <hr> <p><strong>Server info</strong></p> <p>Running Apache 2.2.21 using mod_wsgi with Django 1.4 on Gentoo Linux</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload