无模块命名的博客
问题描述:
我在django.Now我下面一个名为的Python Web开发Django的书和blog.With应用博客和sqlite3的选择创建用于测试的光一个新手,运行./manage.py syncdb时出现错误。无模块命名的博客
的错误是,
Error: No module named blog
这是我settings.py
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'mysite.blog',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '/var/db/django.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.
}
}
部分这里是所有model.py在博客应用:
from django.db import models
class BlogPost(models.Model):
title = models.CharField(max_length = 150)
body = models.TextField()
timestamp = models.DataTimeField()
我已经通过*中的类似问题进行了搜索,但那些决议对我不起作用。
究竟是什么错误? – shx2 2013-03-10 10:50:34
我希望你的代码缩进是好的,因为它看起来像它不是 – apoq 2013-03-10 10:52:51
@Kapo我刚刚从我的脚本粘贴它。它一定会好起来的。 – Edward 2013-03-10 10:59:26