Django not recognizing the MEDIA_URL path?

前端 未结 8 2051
鱼传尺愫
鱼传尺愫 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:04

    I was also having the same problem, this is how I got it done.

    If you are using a FileField in your model class instead of MEDIA_URL use .url member to access the url of your file. For eg: something like this

    href = "{{ some_object.file_name.url }}" 
    

    here file_name is the FileField in model class.

提交回复
热议问题