---
title: "diango创建数据异常no module named base"
author: "怡然城南"
date: "2013-05-05T22:02:18Z"
tags: []
categories: ["编程语言"]
slug: "diango-no-module-named-base"
draft: false
lastmod: "2013-05-05T22:02:18Z"
id: 1860151
url: "https://yrcn.iteye.com/blog/1860151"
---

本人使用django创建web项目使用的数据库是sqlite3，python版本为2.5.4，django版本为1.4.5
然后我创建了一个project，配置settings.py文件为
DATABASES = {
    'default': {
        'ENGINE': <span style="color:red">'sqlite3'</span>, # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': './testDj.db3',                      # 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.
    }
}
确不料报出如下错误
error:no module named base

将配置settings.py文件改为
DATABASES = {
    'default': {
        'ENGINE':<span style="color:red"> 'django.db.backends.sqlite3',</span> # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': './testDj.db3',                      # 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.
    }
}

可以正常运行