Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行 python manage.py migrate ansible 报错 #13

Open
540444923 opened this issue Mar 17, 2016 · 8 comments
Open

执行 python manage.py migrate ansible 报错 #13

540444923 opened this issue Mar 17, 2016 · 8 comments

Comments

@540444923
Copy link

python:2.7
Django:1.6

当单独安装 guardian 时 需要 Django:1.7 以上版本

231># python manage.py migrate ansible
Traceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/python2.7/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/django/core/management/init.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/python2.7/lib/python2.7/site-packages/django/core/management/init.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/python2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/usr/local/python2.7/lib/python2.7/site-packages/south/management/commands/init.py", line 10, in
import django.template.loaders.app_directories
File "/usr/local/python2.7/lib/python2.7/site-packages/django/template/loaders/app_directories.py", line 25, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError guardian: cannot import name register

@bluefan
Copy link

bluefan commented Mar 31, 2016

我也是同样的报错
不过我是一开始就报错
python manage.py schemamigration desktop.apps.account --init

@bluefan
Copy link

bluefan commented Apr 1, 2016

已经解决

@kevinchengshellcode
Copy link

怎么解决的啊,我也是遇到同样的问题

@bluefan
Copy link

bluefan commented Apr 22, 2016

guardian 版本不对

@hivefans
Copy link

hivefans commented May 6, 2016

@bluefan 应该是哪个版本呢

@bluefan
Copy link

bluefan commented May 6, 2016

django-guardian==1.3.0

@weinshun
Copy link

(env) [root@zhuodong6 ansible_ui]# python manage.py schemamigration desktop.apps.account --init
Traceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/core/management/init.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/core/management/init.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/south/management/commands/init.py", line 10, in
import django.template.loaders.app_directories
File "/data/soft/app/python2.7/env/lib/python2.7/site-packages/django/template/loaders/app_directories.py", line 25, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError kombu.transport.django: No module named django
同样报错,django-guardian==1.3.0也不行。
(env) [root@zhuodong6 ansible_ui]# python -V
Python 2.7.11,是不是一定要用Python 2.7.3?

@lhuguanglong
Copy link

lhuguanglong commented May 17, 2017

(envansible) [root@test01 ansible_ui]# python manage.py schemamigration desktop.apps.ansible --init
Traceback (most recent call last):
File "manage.py", line 11, in
execute_from_command_line(sys.argv)
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line
utility.execute()
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/core/management/init.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/core/management/init.py", line 75, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
import(name)
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/south/management/commands/init.py", line 10, in
import django.template.loaders.app_directories
File "/etc/ansible/ansible_ui/envansible/lib/python2.7/site-packages/django/template/loaders/app_directories.py", line 25, in
raise ImproperlyConfigured('ImportError %s: %s' % (app, e.args[0]))
django.core.exceptions.ImproperlyConfigured: ImportError kombu.transport.django: No module named django
最后这个问题是怎样解决的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants