From 8d1dbddd75b403fea10b786315015daa7b09d62c Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 5 Jan 2006 14:55:22 +0000 Subject: [PATCH] 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 --- django/core/management.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/django/core/management.py b/django/core/management.py index d93a0f5933..cc39711964 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -68,6 +68,15 @@ def get_sql_create(app): from django.db import backend, get_creation_module, models 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 = [] models_output = set() pending_references = {}