Opened 17 years ago

Closed 17 years ago

#5245 closed (wontfix)

manager runserver don't reload after fixing error

Reported by: bchesneau@… Owned by: nobody
Component: django-admin.py runserver Version: dev
Severity: Keywords: runserver reload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

since some days, manager runserver don't reload even if error is fixed in file. It was not the case before.

Case to reproduce:
Error in a manager imported from managers.py file: indentation. Server don't reload after fixing line.

Change History (15)

comment:1 by Paul Bx <pb@…>, 17 years ago

Resolution: invalid
Status: newclosed

This is a support request. Please try the django-users mailing list or the IRC channel.

comment:2 by anonymous, 17 years ago

Resolution: invalid
Status: closedreopened

this isn't a support request. Correct behaviour is : server reload when page change. Current behaviour broken. I don't use --noreload function. Please fix this or explain me why it's a suppor't request.

comment:3 by anonymous, 17 years ago

don't wan't say fix this, but leave it's open until someone fix it :/ late night.

comment:4 by Paul Bx <pb@…>, 17 years ago

Please fix this or explain me why it's a suppor't request

I called it a support request because you say you're having a problem but include almost no information. The bug reporting guidelines which are linked from the newticket form you filled out say "Include as much information as you possibly can". For example, if you believe this is a bug then it would be helpful to include:

  • the exact svn rev you are using (run 'svn info')
  • your Python version and operating system (sometimes relevant, sometimes not)
  • the code you edited, before you edited it
  • the code you edited, after you edited it
  • any error messages that were displayed before or after your edits

The idea is you want to give enough information so that someone else, using only the information you have provided, can reproduce the problem.

comment:5 by Adrian Holovaty, 17 years ago

Resolution: worksforme
Status: reopenedclosed

I can't replicate this behavior -- I made a change to my view code and the development server picked up my change without having to be restarted.

comment:6 by anonymous, 17 years ago

Resolution: worksforme
Status: closedreopened

If you change a view it wor. But not if you change in another in the project that the view import. Ie a forms file or a manager file in the same application project .

Svn version : 6002
python 2.5

I can't paste the code since it was fixed it. Anyway there are other people with same problem. It worked before. So I don't understand.

comment:7 by anonymous, 17 years ago

mmm after reading my sentence think it need some better description. Sorry for that.

My project has this structure :

/myapp

--- managers.py
--- forms.py
--- models.py
--- view.py

If something change in views.py or models.py eevrything is ok. But If I change something in managers.py imported by my form it doesn't work. Server isn't reloaded.

Hope it could help.

comment:8 by bchesneau@…, 17 years ago

I waw wrong, same error if there is a problem in models.py. Here is a traceback :

Validating models...
Unhandled exception in thread started by <function inner_run at 0x17832b0>
Traceback (most recent call last):
  File "/opt/local/lib/python2.5/site-packages/django/core/management/commands/runserver.py", line 40, in inner_run
    self.validate()
  File "/opt/local/lib/python2.5/site-packages/django/core/management/base.py", line 63, in validate
    raise CommandError("One or more models did not validate:\n%s" % error_text)
django.core.management.base.CommandError: One or more models did not validate:
friendsnippets.network: name 'permalink' is not defined

comment:9 by Simon G. <dev@…>, 17 years ago

Resolution: invalid
Status: reopenedclosed

the management dir. got heavily rearranged recently. Sometimes SVN can glitch when this happens. Please remove the django/core/management subdir (rm -rf) and then do an svn up to see if this fixes the issue. Re-open this ticket if it doesn't.

comment:10 by anonymous, 17 years ago

Resolution: invalid
Status: closedreopened

I did this. Same error occured :

Validating models...
Unhandled exception in thread started by <function inner_run at 0x1783330>
Traceback (most recent call last):

File "/opt/local/lib/python2.5/site-packages/django/core/management/commands/runserver.py", line 40, in inner_run

self.validate(display_num_errors=True)

File "/opt/local/lib/python2.5/site-packages/django/core/management/base.py", line 63, in validate

raise CommandError("One or more models did not validate:\n%s" % error_text)

django.core.management.base.CommandError: One or more models did not validate:
friendsnippets.subscriptions: invalid syntax (models.py, line 8)

comment:11 by Paul Bx <pb@…>, 17 years ago

Resolution: invalid
Status: reopenedclosed

Sorry to hear you're still having trouble (assuming you're the same person -- your username is "anonymous"). However, if you want this to be treated as a bug report, please provide a complete test case with all code required to reproduce this bug on a clean installation of Django. Otherwise, please stop reopening this ticket and instead pursue the support channels mentioned above.

comment:12 by Paul Bx <pb@…>, 17 years ago

Resolution: invalid
Status: closedreopened

Hm, well, I see you were instructed to re-open this ticket if rm'ing the management dir didn't solve it, so I retract my last statement. But do consider giving a complete reproducible case, not just tracebacks.

comment:13 by Benoit, 17 years ago

models:

from django.db import models
from django.contrib.auth.models import User

from tagging.models import Tag


class Subscription(models.Model):
    user = models.ForeignKey(User)
    tag = models.ForeignKey(Tag)ru

    def __unicode__(self):
        return "%s - %s" % (self.user, self.tag)

view :

from models import Subscription

error that created previous traceback : the ru after field description. It was detected by runserver and then runserver hanged. This error appear from time to time. Project has 2047 files.

comment:14 by James Bennett, 17 years ago

In my experience, the server isn't always able to recover when an error in a models file is corrected; I'm not sure if it's possible or desirable for the server to work around that by constantly running and re-running the (fairly expensive) process of model validation and loading.

comment:15 by Simon G <dev@…>, 17 years ago

Resolution: wontfix
Status: reopenedclosed

Ok - closing this again, based on ubernostrum's comment - it's too intensive to revalidate models on each request.

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