Opened 10 years ago

Last modified 10 years ago

#24398 closed Bug

Built in webserver not reloading Python files upon requests — at Version 1

Reported by: Zsolt Ero Owned by: nobody
Component: Uncategorized Version: 1.7
Severity: Normal Keywords: server runserver
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Zsolt Ero)

I am experiencing the following bug in Django 1.7.4:

  1. Create a new default project
  2. Create a new default app.
  3. Make a view + url, just return a simple string in a HttpResponse.
  4. Start "manage.py runserver"
  5. Load the URL in browser / curl.
  6. Change string in the view.
  7. Reload the URL in browser / re-run curl.

What should happen:
The updated contents should be shown in the browser / curl.

What is happening:
Sometimes the updated content is displayed.
Most of the time the old content is displayed.

Note 1:
If I wait a while (say 5 minutes), and reload, the updated content will be displayed.
If I do not wait, but simply click reload-reload-reload, the old content will be displayed all the time.

Note 2:
If I hit the force-reload button in the browser (by clicking Ctrl + refresh or similar), then it triggers a server reload/restart. However the result of this response is still the old content. However if I do a normal request now (so it's the 2nd request after reload), then the updated content is displayed.

Note 3:
A very interesting, possibly related bug: if I hit Ctrl + C to quit the server and restart it, it terminates with error"

Error: That port is already in use.
}}}.

To be able to restart the server I have to wait quite a while (say 20 seconds). This error seems to only happen when the server is in the "stuck" mode, as in displaying the old content.

Python version: 2.7.9, latest from homebrew
Django version: 1.7.4, latest from pip
OS version: OS X 10.9.5

Change History (1)

comment:1 by Zsolt Ero, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top