#28464: How to prevent URLconf settings from being carried onto new project?
-------------------------------------+-------------------------------------
               Reporter:  Mike Lee   |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  1.11
  contrib.redirects                  |       Keywords:  localserver,
               Severity:  Normal     |  URLconf
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I recently worked on a project that had an app named 'catalog'. While I
 was working on it, I changed the URLconf so that the root URL could be
 redirected to the app.

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.eee831eea6f98d94c2c28ef48598fa76%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to