[Answered ]-Django setting.py error

2👍

In line 5 in myScript.py you have a # which comments a line out. Then, I think that the line 6 DATABASE_ENGINE = " ", will be a syntax error (though the traceback does not seem to include this).

There are other problems too. The way you import things will cause the settings.py database settings to be overwritten with empty values in line 5 onwards in myScript.py. Unless this is what you want, a correct way to do this (in myScript.py) is:

# settings.py
from django.conf import settings

from django.db import models
from myApp.models import *

That is, specify the settings in settings.py, don’t overwrite them in myScript.py.

If you do need to override the settings for whatever reason, then just remove the # at line 5, and things might work.

Next time, please try to solve syntax errors by yourself, it will be much faster than posting to stack overflow.

Leave a comment