mirror of
https://github.com/django/django.git
synced 2025-06-13 07:29:13 +00:00
magic-removal: Added helpful error message during 'sql, 'sqlall' and 'install' django-admin commands if DATABASE_ENGINE is blank
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
1db708d4d7
commit
8d1dbddd75
@ -68,6 +68,15 @@ def get_sql_create(app):
|
|||||||
from django.db import backend, get_creation_module, models
|
from django.db import backend, get_creation_module, models
|
||||||
|
|
||||||
data_types = get_creation_module().DATA_TYPES
|
data_types = get_creation_module().DATA_TYPES
|
||||||
|
|
||||||
|
if not data_types:
|
||||||
|
# This must be the "dummy" database backend, which means the user
|
||||||
|
# hasn't set DATABASE_ENGINE.
|
||||||
|
sys.stderr.write("Error: Django doesn't know which syntax to use for your SQL statements,\n" +
|
||||||
|
"because you haven't specified the DATABASE_ENGINE setting.\n" +
|
||||||
|
"Edit your settings file and change DATABASE_ENGINE to something like 'postgresql' or 'mysql'.\n")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
final_output = []
|
final_output = []
|
||||||
models_output = set()
|
models_output = set()
|
||||||
pending_references = {}
|
pending_references = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user