Django manage.py runserver throws ImportError: AdminMediaHandler

守給你的承諾、 提交于 2019-12-10 20:24:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!