I wrote the below code to do this:
{{{
# within the project's URLconf file
from django.views.generic import RedirectView
urlpatterns += [
url(r'^$', RedirectView.as_view(url='/catalog/', permanent=True)),
]
}}}
I was working on the local development server, and the root URL
(127.0.0.1:8000) was successfully redirected to the 'catalog' app
(127.0.0.1:8000/catalog/).
However, when I created a new project, the root URL of this NEW project
ALSO tried to redirect to the 'catalog' app of the previous project.
So where as I should be seeing the "it worked!" page at the root URL for
the new project, I am instead redirected to the 'catalog' app's URL of the
previous project, where the 404 page is displayed (obviously, because the
'catalog' app is not part of the new project).
It seems to me that the settings from the previous project have somehow
affected the local server permanently so that the modified URLconf setting
is carried on to any subsequent projects.
I could not find exactly what was causing this issue so I just ran the new
project on a different port (8001) using the
{{{
python manage.py runserver 8001
}}}
command, and this seemed to fix the issue. However, I regard this only as
a temporary workaround and I want to find out the root cause of the issue.
If I can't fix it, I would like to "reset" the default port (8000) so
everything goes back to default settings.
Is there a way to completely "reset" either the local server or django
itself so that all the settings go back to how they were released?
--
Ticket URL: <https://code.djangoproject.com/ticket/28464>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "404.JPG" added.
* status: new => closed
* resolution: => invalid
Comment:
Django isn't at fault: permanent redirects are cached by the browser.
Please see TicketClosingReasons/UseSupportChannels for ways to ask usage
questions, and create a Trac ticket only when you've confirmed a bug.
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/28464#comment:1>