Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#12428 closed (fixed)

Projects created with django-admin.py startproject no longer run if no databases have been configured

Reported by: simon Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

(ve)simon $ ./manage.py runserver 0.0.0.0:8003
Validating models...
Unhandled exception in thread started by <function inner_run at 0x1363c30>
Traceback (most recent call last):
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 48, in inner_run
    self.validate(display_num_errors=True)
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/core/management/validation.py", line 22, in get_validation_errors
    from django.db import models, connection
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/db/__init__.py", line 74, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/db/utils.py", line 73, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/db/utils.py", line 20, in load_backend
    return import_module('.base', backend_name)
  File "/Users/simon/Development/django_signed_demo/ve/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
ValueError: Empty module name

The problem is that "django-admin.py startproject" creates a new project with the following in the settings file:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.',
         ...

Django then chokes on the invalid ENGINE setting.

Brand new projects should work without needing the database to be manually configured, since some projects don't use a database at all.

Attachments (1)

12428.diff (2.4 KB ) - added by simon 14 years ago.
Patch from Alex Gaynor

Download all attachments as: .zip

Change History (5)

by simon, 14 years ago

Attachment: 12428.diff added

Patch from Alex Gaynor

comment:1 by simon, 14 years ago

Has patch: set
Patch needs improvement: set

comment:2 by simon, 14 years ago

Summary: Project's created with django-admin.py startproject no longer run if no databases have been configuredProjects created with django-admin.py startproject no longer run if no databases have been configured

comment:3 by Russell Keith-Magee, 14 years ago

Resolution: fixed
Status: newclosed

(In [11974]) Fixed #12428: Ensured that the dummy backend is installed correctly on a fresh project generated by django-admin.py startproject. Thanks to Simon for the report.

comment:4 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top