develeopment servers stops at syntax error.

80 views
Skip to first unread message

Yunus Koçyiğit

unread,
Sep 12, 2014, 4:40:24 PM9/12/14
to django...@googlegroups.com
when i change source code of a model at django 1.7 with python 2.7. development server stops immediately when a syntax error occurs. am i need option with runserver ? also in my settings.py debug= true

Lee

unread,
Sep 12, 2014, 7:44:20 PM9/12/14
to django...@googlegroups.com
Providing the actual error and traceback would be the only way we can really help you. Could you paste that here?

Thanks

Yunus Koçyiğit

unread,
Sep 13, 2014, 4:19:19 AM9/13/14
to django...@googlegroups.com

on django 1.7 if i made a syntax error on purpose like    "      a = [ 'blablabla'       "  development server stops immediately with this error :

System check identified no issues (0 silenced).

September 13, 2014 - 08:18:01

Django version 1.7, using settings 'learning_site.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CONTROL-C.

Traceback (most recent call last):

  File "manage.py", line 10, in <module>

    execute_from_command_line(sys.argv)

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line

    utility.execute()

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute

    django.setup()

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/__init__.py", line 21, in setup

    apps.populate(settings.INSTALLED_APPS)

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate

    app_config.import_models(all_models)

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/lib/python2.7/site-packages/django/apps/config.py", line 197, in import_models

    self.models_module = import_module(models_module_name)

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module

    __import__(name)

  File "/Users/kocyigityunus/Desktop/virtual_envs/ENV1/learning_site/polls/models.py", line 38

    votes = models.IntegerField(default=0)

        ^

SyntaxError: invalid syntax



but if i made same with django 1.6   server stops but if i save again with true syntax server restarts. i think it's a bug there.






Andreas Kuhne

unread,
Sep 13, 2014, 5:59:37 AM9/13/14
to django...@googlegroups.com
That's strange. A syntax error in my django 1.6 also stops the server, without restarting it. I think that's the way it should be, because the server cannot continue processing invalid python files.

Regards,

Andréas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/df98acae-27cb-4c59-b749-11e813c87f3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yunus Koçyiğit

unread,
Sep 13, 2014, 10:14:10 AM9/13/14
to django...@googlegroups.com
in django 1.6 on syntax error server also stops. but not fully. when i fix the issue and save server restarts without i need to write "runserver" command. 

Collin Anderson

unread,
Sep 17, 2014, 10:39:43 AM9/17/14
to django...@googlegroups.com
I think it's because of the new check framework. The check framework runs and validates more of the website and looks for errors long before the the "runserver" management command has a chance to start the reloading process.
Reply all
Reply to author
Forward
0 new messages