manage.py runserver giving error!!

1,570 views
Skip to first unread message

Gagan (GPS)

unread,
Jun 13, 2011, 4:42:45 AM6/13/11
to Django users
I am using Ubuntu 11.04 and I had recently installed Django by using
svn and creating a hard link of the Django folder to the appropriate
python folder. When I tried to create a new project, It created the
project easily but the manage.py runserver is giving me trouble.
192.168.2.127 is the IP address of this computer. The problem is
coming even if I do not give my IP address.

Kindly help.

Following is the display on the terminal when I try to execute the
command:



$ python manage.py runserver 192.168.2.127:8000
Validating models...

Unhandled exception in thread started by <bound method
Command.inner_run of
<django.contrib.staticfiles.management.commands.runserver.Command
object at 0x2b5a990>>
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/django/core/management/
commands/runserver.py", line 88, in inner_run
self.validate(display_num_errors=True)
File "/usr/lib/python2.7/dist-packages/django/core/management/
base.py", line 243, in validate
from django.core.management.validation import
get_validation_errors
File "/usr/lib/python2.7/dist-packages/django/core/management/
validation.py", line 3, in <module>
from django.contrib.contenttypes.generic import GenericForeignKey,
GenericRelation
File "/usr/lib/python2.7/dist-packages/django/contrib/contenttypes/
generic.py", line 7, in <module>
from django.db import connection
File "/usr/lib/python2.7/dist-packages/django/db/__init__.py", line
27, in <module>
connection = connections[DEFAULT_DB_ALIAS]
File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 81,
in __getitem__
backend = load_backend(db['ENGINE'])
File "/usr/lib/python2.7/dist-packages/django/db/utils.py", line 23,
in load_backend
return import_module('.base', backend_name)
File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
ImportError: No module named base

Daniel Roseman

unread,
Jun 13, 2011, 4:51:25 AM6/13/11
to django...@googlegroups.com
As that traceback shows, there is a problem with your database engine setting. What have you put in the DATABASES dictionary in settings.py?
--
DR.

Gagan (GPS)

unread,
Jun 13, 2011, 5:15:49 AM6/13/11
to Django users
I am using sqlite3.

The database settings are as follows:

DATABASES = {
'default': {
'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'mysql',
'sqlite3' or 'oracle'.
'NAME': 'database.db', # Or path to
database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for
default. Not used with sqlite3.

Daniel Roseman

unread,
Jun 13, 2011, 5:21:38 AM6/13/11
to django...@googlegroups.com
On Monday, June 13, 2011 10:15:49 AM UTC+1, Gagan (GPS) wrote:
I am using sqlite3.

The database settings are as follows:

DATABASES = {
    'default': {
        'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'mysql',
'sqlite3' or 'oracle'.
        'NAME': 'database.db',                      # Or path to
database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for
localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for
default. Not used with sqlite3.
    }


So, you ignored the bit that said 'Add' when you replaced the stub ENGINE setting with 'sqlite3'. It should be 'django.db.backends.sqlite3'.
-- 
DR

Gagan (GPS)

unread,
Jun 13, 2011, 5:27:55 AM6/13/11
to Django users
Thanks,

It seems to work with the change you proposed.

Problem Solved.

Thank you Daniel
Reply all
Reply to author
Forward
0 new messages