Opened 8 years ago

Closed 7 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: master
Severity: Keywords: runserver reload
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 Changed 8 years ago by Paul Bx <pb@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 8 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened

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 Changed 8 years ago by anonymous

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

comment:4 Changed 8 years ago by Paul Bx <pb@…>

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 Changed 8 years ago by adrian

  • Resolution set to worksforme
  • Status changed from reopened to closed

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 Changed 8 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

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 Changed 8 years ago by anonymous

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 Changed 8 years ago by bchesneau@…

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 Changed 8 years ago by Simon G. <dev@…>

  • Resolution set to invalid
  • Status changed from reopened to closed

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 Changed 8 years ago by anonymous

  • Resolution invalid deleted
  • Status changed from closed to reopened

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 Changed 8 years ago by Paul Bx <pb@…>

  • Resolution set to invalid
  • Status changed from reopened to closed

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 Changed 8 years ago by Paul Bx <pb@…>

  • Resolution invalid deleted
  • Status changed from closed to reopened

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 Changed 8 years ago by Benoit

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 Changed 8 years ago by ubernostrum

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 Changed 7 years ago by Simon G <dev@…>

  • Resolution set to wontfix
  • Status changed from reopened to closed

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