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 )
I am experiencing the following bug in Django 1.7.4:
- Create a new default project
- Create a new default app.
- Make a view + url, just return a simple string in a HttpResponse.
- Start "manage.py runserver"
- Load the URL in browser / curl.
- Change string in the view.
- 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