Django项目部署到服务器上无法显示ckeditor有大佬遇到过么
uwsgi配置socket = localhost:8000
master = true
chdir = /home/Blog_pro
module = Blog_pro.wsgi
home = /root/home/Django_env
processes = 2
memory-report = true
daemonize = uwsgi.log
pidfile = uwsgi.pid
py-autoreload = 1
nginx配置
server{
listen 80;
server_name www.rxxx.top;
charset utf-8;
access_log /etc/nginx/access.log;
error_log /etc/nginx/error.log;
location /static{
alias /home/Blog_pro/static/;
}
location /media{
alias /home/Blog_pro/media/;
}
location /{
uwsgi_pass 127.0.0.1:8000;
include /etc/nginx/uwsgi_params;
}
}
models.py文件
from ckeditor_uploader.fields import RichTextUploadingField
class Blog(model.Model):
field_img = RichTextUploadingField()
settings.py文件
INATALLED_APPS = [
'ckeditor'
]
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR,'media')
CKEDITOR_UPLOAD_PATH = 'upload/'
CKEDITOR_CONFIGS = {
'width': 'auto',
'height': 400px,
'toolbar': 'Full'
}
urls.py
urlpatterns = [
path('ckeditor/',include('ckeditor_uploader.urls')),
]
项目根目录/home/Blog_pro
收集的静态文件目录
静态文件运行正常,网页布局没有混乱。
不知道为什么本地测试就正常,部署到服务器就不显示ckeditor富文本了。uwsgi、nginx也没有报错。
难道没有大佬用过ckeditor富文本的么 哇这么难受的么,没人回答
页:
[1]