Django admin returns 404 with tinymce

走远了吗. 提交于 2021-01-05 07:25:25

问题


I'm getting 404 with Django admin and tinymce

settings.py

STATIC_URL = '/static/'
STATICFILES_DIRS= [os.path.join(BASE_DIR, 'static'), ]

admin.py

@admin.register(Blogpost)
class BlogpostAdmin(admin.ModelAdmin):
    class Media:
        js = ('blog/tiny.js',)

js

var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js";
document.head.appendChild(script);
script.onload=function ()
{
    tinymce.init(
    {
        selector: '#id_content',
    });
};

来源:https://stackoverflow.com/questions/65494686/django-admin-returns-404-with-tinymce

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