Django not recognizing the MEDIA_URL path?

前端 未结 8 1851
鱼传尺愫
鱼传尺愫 2021-02-03 13:23

So I\'m trying to get TinyMCE up and running on a simple view function, but the path to the tiny_mce.js file gets screwed up. The file is located at /Users/home/Django/tinyMCE/m

8条回答
  •  执念已碎
    2021-02-03 14:02

    It looks like your are using the debug server (your url is http://127.0.0.1:8000/...) . Did you install the static serve in your urls.py?

    if settings.DEBUG:
        urlpatterns += patterns('',
            (r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes':True}),
    )
    

    The 'show_indexes':True options make possible to browse your media. Go to your medias root http://127.0.0.1:8000/media/ and see it there is something

提交回复
热议问题