Opened 8 years ago

Closed 8 years ago

#18111 closed Uncategorized (invalid)

Django autoreload doesn't work for or in my app (but does for

Reported by: stu.axon@… Owned by: nobody
Component: Uncategorized Version: 1.4
Severity: Normal Keywords: autoreload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I've created a django app that I use within my site. When I change it's reload happens, however for and it does not.

Change History (4)

comment:1 Changed 8 years ago by stu.axon@…


If I open and put the following code

        if filename.endswith(""):
            print 'MODEL: ', filename
        elif filename.endswith(""):
            print 'FORM: ', filename

I can see all my and djangos models, also forms it' uses, but none from my app:

MODEL:  ..../python2.7/site-packages/django/contrib/staticfiles/
FORM:  ..../python2.7/site-packages/django/contrib/auth/
MODEL:  ..../python2.7/site-packages/compressor/
MODEL:  ..../python2.7/site-packages/django/contrib/messages/
MODEL:  ..../python2.7/site-packages/django/contrib/sites/
MODEL:  ~/projects/jpc/git/MY_SITE/MY_APP/
MODEL:  ..../python2.7/site-packages/django/contrib/formtools/
MODEL:  ..../python2.7/site-packages/django/contrib/auth/
FORM:  ..../python2.7/site-packages/django/forms/
MODEL:  ..../python2.7/site-packages/django/contrib/admin/
MODEL:  ~/projects/jpc/git/MY_SITE/MY_APP/
MODEL:  ..../python2.7/site-packages/django/contrib/contenttypes/

MODEL:  ..../python2.7/site-packages/debug_toolbar/
MODEL:  ..../python2.7/site-packages/django/forms/
MODEL:  ..../python2.7/site-packages/django/contrib/sessions/
FORM:  ..../python2.7/site-packages/django/contrib/admin/

comment:2 Changed 8 years ago by stu.axon@…

Putting the following code into MY_APP/ works as a workaround, although doesn't seem ideal:

  import forms

comment:3 Changed 8 years ago by stu.axon@…

Last bit of info for now - here's the (not recommended) I came up with to reload forms and tests automatically:

    from django.conf import settings
    if settings.DEBUG:
        import forms, tests

comment:4 Changed 8 years ago by Aymeric Augustin

Resolution: invalid
Status: newclosed

By design, the development server only reloads code that it's actually using.

If isn't used, what's the point in reloading the development server when it's changed?

Note: See TracTickets for help on using tickets.
Back to Top