Django import error - no module named django.conf.urls.defaults

前端 未结 2 789
臣服心动
臣服心动 2021-01-30 19:15

I am trying to run statsd/graphite which uses django 1.6.

While accessing graphite URL, I get django module error

File \"/opt/graphite/webapp/grap

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 20:06

    If for some reason you don't want to downgrade to Django 1.5.x or upgrade Graphite then you can apply the fix to your older Graphite with:

    find ./ -type f -exec sed -i -e 's/from\ django\.conf\.urls\.defaults\ import\ \*/from\ django\.conf\.urls\ import\ \*/g' {} \;
    

    ..in your /webapp/graphite dir.

    This helped me with my Graphite 0.9.12 and Django 1.7(.5).

    (I also had to do:

    find ./ -type f -exec sed -i -e 's/mimetype\=/content_type\=/g' {} \;
    find ./ -type f -exec sed -i -e 's/content_type\=mimetype/content_type\=content_type/g' {} \;
    

    ..later on as after I managed to start Graphite some of its features didn't work. Now they work for me but YMMV.)

提交回复
热议问题