Django development server crash on syntactic or indent error after check

66 views
Skip to first unread message

Mario De Frutos Dieguez

unread,
Dec 4, 2014, 8:58:49 AM12/4/14
to django...@googlegroups.com
First of all i want to say hi!, i'm new in the group :)

I'm having a problem with the development server (a.k.a runserver). When i'm working in a file but i have an error (for example indent error or syntactic error) the server crash instead of report the error and keep running.

I've been reading the doc and i saw this phrase "..If any errors are found, they will be printed to standard output, but it won’t stop the server..." (https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port).

What i don't know if this is a bug or the expected behaviour.

Thank you :)

Mike Dewhirst

unread,
Dec 4, 2014, 12:32:08 PM12/4/14
to django...@googlegroups.com
On 4/12/2014 7:58 PM, Mario De Frutos Dieguez wrote:
> First of all i want to say hi!, i'm new in the group :)
>
> I'm having a problem with the development server (a.k.a runserver). When
> i'm working in a file but i have an error (for example indent error or
> syntactic error) the server crash instead of report the error and keep
> running.
>
> I've been reading the doc and i saw this phrase "..If any errors are
> found, they will be printed to standard output, but it won’t stop the
> server..."
> (https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port).
>
> What i don't know if this is a bug or the expected behaviour.

It is expected behaviour. In Django 1.6+ a syntax error or indent error
doesn't stop the dev server. If you read the traceback and see where the
error originates, you can open that source file in your editor, fix the
problem and when you save it, the dev server detects the repair and
keeps on keeping on!

Very clever IMO

Cheers

>
> Thank you :)
>
> --
> 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
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto: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/3af61c48-af43-4947-8d18-7c9fbb393480%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/3af61c48-af43-4947-8d18-7c9fbb393480%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Mario De Frutos Dieguez

unread,
Dec 5, 2014, 7:00:01 AM12/5/14
to django...@googlegroups.com
If i understand you correctly, when an error occur the server should not stop, instead of that it will print the error trace to let you correct the problem but in my case when an error occur the server show the trace and stop working or at least it returns to the shell. :S

What i understand reading the official docuementation is that the expected behavior is not to exit instead of that the server should show the error trace to let you fix it

Am i right?

Collin Anderson

unread,
Dec 6, 2014, 5:32:17 PM12/6/14
to django...@googlegroups.com
Hi,

Yes, this happens to me frequently. It happens when editing models.py or something imported by a models.py. It's on my mental dream list of things to fix, but feel free to open a ticket about it if there's not one open already.

Collin

Collin Anderson

unread,
Dec 6, 2014, 5:33:34 PM12/6/14
to django...@googlegroups.com
It happens if there's a SyntaxError in a models.py file.

Mario De Frutos Dieguez

unread,
Dec 7, 2014, 3:37:34 PM12/7/14
to django...@googlegroups.com
Thank you very much Collin, i will take a look knowing that its probably a bug :)
Reply all
Reply to author
Forward
0 new messages