views:

64

answers:

1

I'm on Windows XP with the latest install of Python 2.6 (and the development server has been working up until last night). I have the path and Python path stuff all set up, and my dev server has worked forever. I recently replaced my django-trunk with a new pull from the Django trunk. I thought maybe there was an import error or something that Django wouldn't catch in one of my app's models.py so I started a new project (empty but just for testing) and it still didn't work. I restarted my computer and tried the new empty app again python manage.py runserver 8080 and went to http://127.0.0.1:8080/ and it worked ("Congrats. Django is insta..."). So I CD over to my real project and tried again and it didn't work. I'm not getting a stack trace or anything like that. I either get [17/Ja/2010 16:30:51] "GET / HTTP/1.1" 301 0 as output when I visit http://127.0.0.1:8080/ in my CMD prompt or I get nothing (even if I hard refresh, etc). What could this be?

Update (Important):

Firefox tells me Firefox can't find the server at www.127.0.0.1. even though I'm at http://127.0.0.1:8080/. Does this mean that Django is really sending a 301 to www.127.0.0.1 for some other reason?

I removed PREPEND_WWW from settings.py, and even removed all the apps (except for the django admin and preset ones) that were installed in settings.py.

Update 2: It works in Safari! How can this be? It's like Firefox is getting some sort of 301 but Safari works just fine.

+2  A: 

yep, 301 permanent redirect is remembered by firefox, i've been stuck once on that one, restarting or cleaning history/cache didn't help, so i just ran it on another port.

edit after commenting:

assuming you use some localhost_settings.py to setup your project locally and still want to www_redirect on the production website:

try:
    from localhost_settings import *
    PREPEND_WWW = False
except ImportError:
    PREPEND_WWW = True

i do it this way

zalew
Holy crap. That seems really odd. I don't know what the benefit would be of remembering. Save a single request to the server with the risk of ruining a website? Think if digg.com had a 301 to Twitter for just an hour on Monday morning. They'd permanently lose about 10 percent of their traffic :)
orokusaki
u know, permanent redirect is meant to be permanent, but i don't know why clearing all FF cache doesn't reset it (at least it didn't work for me then). setting up a new redirect works fine, so the imaginary digg->twitter problem should not occur (not to mention that temporary redirects are not being done by setting up a permanent one), don't know how to solve it with the django www redirect though.
zalew
I think the reason cache clearing doesn't fix it is because by default Firefox's "Clear Recent History" doesn't clear "Site Preferences" so you have to check it. This saves a lot more info about sites, including the zoom level of a site last time you visited (I'm kind of blind so I noticed that).
orokusaki
wow, good to know that's there.
zalew