Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Python/Django keep redirecting to url 'catalog'?

I'm stepping into the Python world. First I learned a little Python. Then I learned the basics of Django, and on top of that I'm learning Wagtail (framework for template managing for Django)

To learn Django a went through a tutorial to build a site locally and test it in 127.0.0.1:8000.

At some point of the tutorial I configured the settings (because the tutorial said so) to redirect to 127.0.0.1:8000/catalog when browsing to 127.0.0.1:8000 alone.

Then I started the Wagtail tutorial, as a completely different project in another folder. Not sharing any code with the tutorial Django project.

I run the server and the console says it is now running in port 127.0.0.1:8000 and when I browse it, it redirects me to /catalog and of course shows a Page not found error since this project doesn't have one app catalog.

I workaround this by opening Chrome in Incognito Mode. But still I would like to know why this is happening and how to solve it to add to my knowledge of how Python works.

Some notes:

  • I'm on Windows
  • I killed all processes related to Python and actually this is still happening after turning my PC off and on
  • I know I could use a different port, please do not give me that answer. My goal is to learn.
like image 944
user1869935 Avatar asked Mar 10 '17 14:03

user1869935


Video Answer


1 Answers

Try clearing your browser cache.

The problem is most likely that your browser has cached a 301 Moved Permanently for 127.0.0.1:8000, thus never hit your development server when you enter the URL, but simply do the redirect based on the cache.

You will see the same result no matter what you're running behind port 8000, and it's as such not related to Django.

like image 78
decibyte Avatar answered Nov 15 '22 08:11

decibyte