问题
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