ImportError: cannot import name get_path_info

∥☆過路亽.° 提交于 2020-01-19 17:25:05

问题


My question is why foreman start not serving css file in dev environment ...? but my app running perfectly fine in heroku production server. Correct me if i am wrong, i thought dj-static is the only option for serving static in foreman env, so in order to work dj-static in wsgi.. follows...

wsgi.py 
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

if i am changing above code to

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readtamil.settings")
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
application = Cling(get_wsgi_application())

then foreman start gives me this error

ImportError: cannot import name get_path_info


回答1:


Try setting dj-static==0.0.6 in your requirements.txt file for Virtualenv. There might be a versioning issue on PyPI or a Django1.7 issue or the Heroku tutorial shows to use 0.0.5.

I've reported this issue to Heroku and their tutorial is now updated to reflect newer versions in the requirements.txt.



来源:https://stackoverflow.com/questions/25844101/importerror-cannot-import-name-get-path-info

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