Django reloader fails to watch all the project files

12 views
Skip to first unread message

rwman

unread,
Aug 18, 2011, 4:54:06 PM8/18/11
to django...@googlegroups.com
Hi. I bumped into a problem with djnago autoreloader (using standard runserver command) recently - when i update my views.py file it does not reload the server automatically. (while it does, if i update my project's settings.py file)
Looking at the code (django/utils/autoreload.py) - i discovered, that it watches sys.modules list(dict, actually). And after some debugging i found, that my app's views.py never gets into this list.
i am no expert in python, and will appreciate any help in finding answers.
Can anyone please tell me,
- is it a bug? (or no - updating views.py should not trigger autoreload?)
- how 'settings.py' appeared in the sys.modules?(what code makes it get in there) and why 'some_app.views.py' does not?

Bill Freeman

unread,
Aug 19, 2011, 11:49:17 AM8/19/11
to django...@googlegroups.com
Does your urls.py in the app in question import the view, or are you
just referring to the view functions with strings? I'm not sure whether
views.py is imported before the first time one of the urls is triggered
in this case, but it would be a cheap check to add the import.

> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/SXecMqFIiQYJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

Reply all
Reply to author
Forward
0 new messages