好友
阅读权限10
听众
最后登录1970-1-1
|
uwsgi配置
[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也没有报错。
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|