Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine what file a syntax error coming from

I am having an incredibly frustrating time trying to get off the ground with a Django setup. I'm sure it has something to do with a no-no regarding python3 and something in my requirements file. Anyways when I run this command from my Django project directory:

python3 manage.py runserver --settings=my_test_app.settings.development

the only output I get is

SyntaxError: invalid syntax (__init__.py, line 6)

I can't, for the life of me, figure out what __init__.py file this error message is talking about. I've tried to set a breakpoint with pdb, tried to catch an Exception around the calling code, and even put print statements in all of the __init__ files in my project but no dice. Does anybody have an idea of what might be going on here? Or at least how to figure out what file is causing this syntax error? Thanks for your help.

like image 419
D.C. Avatar asked Dec 06 '25 08:12

D.C.


1 Answers

I had exactly the same problem when:

  • starting from django-twoscoops-project template

    django-admin.py startproject --template=https://github.com/twoscoops/django-twoscoops- project/archive/master.zip --extension=py,rst,html project_name app_name

  • with django-debug-toolbar ver 0.9.4

Disabling django-debug-toolbar or upgrading django-debug-toolbar in requirements.txt to 1.0.1 solved the problem.

like image 185
fragles Avatar answered Dec 08 '25 21:12

fragles