python - django settings.py value error -
i setting django project(for first time).
i tried configure, despite showing value error.
here settings.py
settings.py
debug = true template_debug = debug admins = ( ('asit', 'lipun4u@gmail.com'), ) managers = admins databases = { 'default': { 'engine': 'django.db.backends.sqlite3', # add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'name': 'c:\\users\\asit\\workspace\\tutu\\src\\sqlite.db', # or path database file if using sqlite3. 'user': '', # not used sqlite3. 'password': '', # not used sqlite3. 'host': '', # set empty string localhost. not used sqlite3. 'port': '', # set empty string default. not used sqlite3. } } time_zone = 'america/chicago' site_id = 1 use_i18n = true use_l10n = true media_root = 'c:\\django\\media' media_url = '' admin_media_prefix = '/media/' secret_key = 'secret_key' template_loaders = ( 'django.template.loaders.filesystem.loader', 'django.template.loaders.app_directories.loader', # 'django.template.loaders.eggs.loader', ) middleware_classes = ( 'django.middleware.common.commonmiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', ) root_urlconf = '' template_dirs = ( 'c:\\django\\template\\' # put strings here, "/home/html/django_templates" or "c:/www/django/templates". # use forward slashes, on windows. # don't forget use absolute paths, not relative paths. ) installed_apps = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', # uncomment next line enable admin: 'django.contrib.admin', # uncomment next line enable admin documentation: # 'django.contrib.admindocs', )
urls.py
from django.conf.urls.defaults import * # uncomment next 2 lines enable admin: django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # example: # (r'^tutu/', include('tutu.foo.urls')), # uncomment admin/doc line below enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # uncomment next line enable admin: (r'^admin/', include(admin.site.urls)), )
the error
exception type: valueerror exception value: empty module name exception location: c:\python27\lib\site-packages\django\utils\importlib.py in import_module, line 35
can me ?
the reason have empty root_urlconf
. not have default value defined, should provide actual url config project here. it's yourprojectname.urls
, this
root_urlconf = 'yourprojectname.urls'
see django urldispacther docs details.
Comments
Post a Comment