#24704: Development server does not restart on SynaxError in models.py
-------------------------------------+-------------------------------------
Reporter: artemrizhov | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.7
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):
* status: closed => new
* component: Core (System checks) => Core (Management commands)
* has_patch: 1 => 0
* resolution: fixed =>
* stage: Unreviewed => Accepted
Comment:
It seems that before 0d2c8ff2be733c7cc83a023bbafe0258faa5603c syntax
errors in models.py didn't stop the server. Now it does:
{{{
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/tim/code/django/django/core/management/__init__.py", line
428, in execute_from_command_line
utility.execute()
File "/home/tim/code/django/django/core/management/__init__.py", line
420, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/tim/code/django/django/core/management/__init__.py", line
288, in fetch_command
commands = get_commands()
File "/home/tim/code/django/django/core/management/__init__.py", line
125, in get_commands
apps.populate_models()
File "/home/tim/code/django/django/apps/registry.py", line 123, in
populate_models
app_config.import_models(all_models)
File "/home/tim/code/django/django/apps/base.py", line 164, in
import_models
self.models_module = import_module(models_module_name)
File
"/home/tim/.virtualenvs/django34/lib/python3.4/importlib/__init__.py",
line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2203, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1129, in _exec
File "<frozen importlib._bootstrap>", line 1444, in exec_module
File "<frozen importlib._bootstrap>", line 1549, in get_code
File "<frozen importlib._bootstrap>", line 1509, in source_to_code
File "<frozen importlib._bootstrap>", line 321, in
_call_with_frames_removed
File "/home/tim/code/mysite/polls/models.py", line 15
class MyModelmodels.Model):
}}}
Not sure if the old behavior can be restored, but reopening in case
someone would like to investigate.
--
Ticket URL: <https://code.djangoproject.com/ticket/24704#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.d64ba108f20c14e8c02b43c28b82fab3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.