我在ckeditor中上传了图像,但它没有出现,因为图像的路径是
你知道吗http://127.0.0.1:8000/blog/post/hello-23-1547897944/uploads/2019/01/19/南区.jpg你知道吗
设置.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'main',
'contact',
'widget_tweaks',
'ckeditor',
'ckeditor_uploader',
]
CKEDITOR_UPLOAD_PATH = 'uploads/'
网址.py:
urlpatterns = [
...
path('ckeditor/', include('ckeditor_uploader.urls')),
]
型号.py:
from ckeditor_uploader.fields import RichTextUploadingField
class Post(models.Model):
title = models.CharField(max_length=150, db_index=True)
slug = models.SlugField(max_length=150, blank=True, unique=True)
body = RichTextUploadingField(blank=True, db_index=True)
我认为问题出在设置.py
对不起,我的英语不好,但我希望你能理解我的问题。
我只想补充:
给我的网址.py而且有效!你知道吗
相关问题 更多 >
编程相关推荐