我想使用 Buildout 来获得 Django 1.5 的 django 注册,并且我有一个使用 MyUser(AbstractUser) 的自定义用户。我曾经从食谱 v0.8 中得到它,它很棒。因为,我切换到 1.5,删除我的 UserProfile 并使用这个自定义的 MyUser。
django-registration 不再起作用。我被告知我应该从存储库中获取它,这就是我想要做的。我过去曾使用 mr.developer 来获得更新版本的 django-tastypie,并且我尝试使用 django-registration 重现相同的版本。我在调用 bin/buildout 时出错。让我们首先检查构建配置:
[buildout]
extensions = mr.developer
parts = myquivers
eggs =
django-registration
include-site-packages = false
versions = versions
sources = sources
auto-checkout =
django-registration
[sources]
django-registration = hg https://bitbucket.org/ubernostrum/django-registration
[versions]
django = 1.5
[myquivers]
recipe = djangorecipe
settings = development
eggs = ${buildout:eggs}
project = myquivers
很简单的配置。它曾经像我说的那样与tastepie一起使用,我正在尝试执行相同的步骤:-python2.7 bootstrap.py-bin/buildout-bin/develop 激活 django-registration-bin/develop checkout django-registration-bin /myquivers syncdb - bin/myquivers runservser
但它在 bin/buildout 步骤失败:
$ bin/buildout
Getting distribution for 'mr.developer'.
Got mr.developer 1.25.
mr.developer: Creating missing sources dir /home/damien/Documents/projects/myquivers/src.
mr.developer: Queued 'django-registration' for checkout.
mr.developer: Cloned 'django-registration' with mercurial.
Develop: '/home/damien/Documents/projects/myquivers/src/django-registration'
Traceback (most recent call last):
File "/tmp/tmpzLDggG", line 13, in <module>
exec(compile(open('/home/damien/Documents/projects/myquivers/src/django-registration/setup.py').read(), '/home/damien/Documents/projects/myquivers/src/django-registration/setup.py', 'exec'))
File "/home/damien/Documents/projects/myquivers/src/django-registration/setup.py", line 30, in <module>
version=get_version().replace(' ', '-'),
File "/home/damien/Documents/projects/myquivers/src/django-registration/registration/__init__.py", line 5, in get_version
from django.utils.version import get_version as django_get_version
ImportError: No module named django.utils.version
While:
Installing.
Processing develop directory '/home/damien/Documents/projects/myquivers/src/django-registration'.
An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/damien/Documents/projects/myquivers/eggs/zc.buildout-2.1.0-py2.7.egg/zc/buildout/buildout.py", line 1923, in main
getattr(buildout, command)(args)
File "/home/damien/Documents/projects/myquivers/eggs/zc.buildout-2.1.0-py2.7.egg/zc/buildout/buildout.py", line 466, in install
installed_develop_eggs = self._develop()
File "/home/damien/Documents/projects/myquivers/eggs/zc.buildout-2.1.0-py2.7.egg/zc/buildout/buildout.py", line 707, in _develop
zc.buildout.easy_install.develop(setup, dest)
File "/home/damien/Documents/projects/myquivers/eggs/zc.buildout-2.1.0-py2.7.egg/zc/buildout/easy_install.py", line 871, in develop
call_subprocess(args)
File "/home/damien/Documents/projects/myquivers/eggs/zc.buildout-2.1.0-py2.7.egg/zc/buildout/easy_install.py", line 129, in call_subprocess
% repr(args)[1:-1])
Exception: Failed to run command:
'/usr/bin/python2.7', '/tmp/tmpzLDggG', '-q', 'develop', '-mxN', '-d', '/home/damien/Documents/projects/myquivers/develop-eggs/tmpYM_dR9build'
检查错误,首先django似乎不在系统中,没错,当进入python2.7并尝试>>> import django时,它失败了。但这很正常,这就是为什么我使用构建,而不是安装系统范围的 Django,只是在本地为我的项目安装。
知道如何解决这个问题吗?有没有比使用这个 repo 版本更好的选择?请再次告诉我自定义用户/django 1.5/django-registration。
谢谢!