问题
The Problem
When I run python manage.py runserver
I get the error ImportError: cannot import name AdminMediaHandler
.
ex.
(venv)agconti@agconti-Inspiron-5520:~/my_dev/github/stamped/stamped_project$ python manage.py runserver
ImportError: cannot import name AdminMediaHandler
This just started to happen after I installed the django-werkzeug-debugger-runserver.
Im using virtualenv. Here is what I have installed:
Django==1.5.2
Werkzeug==0.9.3
argparse==1.2.1
django-extensions==1.1.1
django-werkzeug-debugger-runserver==0.1.2
six==1.3.0
wsgiref==0.1.2
I'm not sure what could be causing the conflict. Any ideas?
回答1:
Seems like django-werkzeug-debugger-runserver==0.1.2
is not compatible with Django1.5+, which I suspect you are using.
Try uninstalling it and remove it from requirements.txt
. And use django-extensions
instead, which you already have installed.
回答2:
I had a problem like this. Then I forgot to activate virtualenv. Did you activate?
来源:https://stackoverflow.com/questions/18346433/django-manage-py-runserver-throws-importerror-adminmediahandler