短篇小说
我后立即安装新上运行一个完全新鲜的Django项目./manage.py schemamigration junk_app --initial
南(http://south.aeracode.org/),我收到以下错误:Django的南新安装 - >错误:未知命令“schemamigration”
Unknown command: 'schemamigration'
Type 'manage.py help' for usage.
编辑:我有版本1.7(南方/ init.py有版本 =” 0.07" )
说来话长
下面是刚刚发生的事几乎文字复制/粘贴:
$ sudo apt-get install python-django-south
$ django-admin.py startproject junk_proj
$ cd junk_proj
$ ./managy.py startapp junk_app
$ vim settings.py #add 'south' to INSTALLED_APPS
。
$ cat settings.py
# Django settings for junk_proj project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
import os
CWD = os.getcwd()
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = CWD+'/db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = ''
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'vgtm!i0*(qn$8m9&0u_)#(5yh(kt8%+4dlwfum%xtt-$1ge+ld'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
ROOT_URLCONF = 'junk_proj.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'south',
'junk_app',
)
。
$ ./managy.py syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table south_migrationhistory
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'foo'): admin
E-mail address: [email protected]
Password:
Password (again):
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model
synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> south
> junk_app
Not synced (use migrations):
-
(use ./manage.py migrate to migrate these)
$
$./manage.py schemamigration junk_app --initial
Unknown command 'schemamigration'
Type 'manage.py help' for usage
$
你下载了哪个南方版本? 'schemamigration'没有出现在早期版本中。当你输入'./ manage.py'没有参数时,你会得到什么? – 2010-11-18 19:06:48
'可用子命令: 清理 compilemessages convert_to_south createcachetable createsuperuser dbshell diffsettings dumpdata 平齐 inspectdb loaddata makemessages 迁移 复位 runfcgi 的runserver 壳 SQL sqlall sqlclear sqlcustom sqlflush 个sqlindexes sqlinitialdata sqlreset sqlsequencereset 的startApp startmigration 执行syncdb 测试 TESTSERVER 验证 ' – 2010-11-18 19:13:41
我不建议使用'的apt-GET'对于这样的事情。您的操作系统中的任何内容都不依赖于南,所以没有理由将您自己绑定到为您的操作系统打包的旧版本。使用'pip'代替。 – 2010-11-18 19:29:28