标签:访问 nat dex comment ons tor path apt clu
第三百九十四节,Django+Xadmin打造上线标准的在线教育平台—Xadmin集成富文本框
首先安装Django Ueditor1.8.143模块
下载地址 https://pypi.python.org/pypi/DjangoUeditor/1.8.143
下载后 python setup.py install 安装
安装好后在settings.py将DjangoUeditor添加到app
INSTALLED_APPS = [ ‘django.contrib.admin‘, ‘django.contrib.auth‘, ‘django.contrib.contenttypes‘, ‘django.contrib.sessions‘, ‘django.contrib.messages‘, ‘django.contrib.staticfiles‘, ‘app_users‘, # 注册 APP ‘app_courses‘, ‘app_organization‘, ‘app_operation‘, ‘xadmin‘, # 注册xadmin的app ‘crispy_forms‘, # 注册xadmin的依赖app ‘captcha‘, # 注册验证码app ‘pure_pagination‘, # 注册分页app ‘DjangoUeditor‘ # 注册DjangoUeditor的APP ]
然后在全局的urls.py文件配置路由映射
urlpatterns = [ url(r‘^xadmin/‘, xadmin.site.urls), url(r‘^index.html‘, TemplateView.as_view(template_name=‘index.html‘), name=‘index‘), # 注册 url(r‘^register.html‘, zhu_ce.as_view(), name=‘register‘), url(r‘^captcha/‘, include(‘captcha.urls‘), name=‘captcha‘), url(r‘^active/(?P<active_de>.*)/$‘, active_code.as_view(), name="user_active"), # 登录 url(r‘^login.html‘, TemplateView.as_view(template_name=‘login.html‘), name=‘login‘), url(r‘^deng_lu‘, deng_lu.as_view(), name=‘deng_lu‘), url(r‘^logout‘, logout.as_view(), name=‘deng_lu‘), # 授课机构 url(r‘^org_list.html‘, org_list.as_view(), name=‘org_list‘), # 专门处理静态资源请求映射,也就是media上传文件夹里的请求映射 url(r‘media/(?P<path>.*)$‘, serve, {‘document_root‘: MEDIA_ROOT}), # 配置静态文件访问 # url(r‘static/(?P<path>.*)$‘, serve, {‘document_root‘: STATIC_ROOT}), url(r‘course_comment.html‘, course_comment.as_view(), name=‘course_comment‘), url(r‘usercenter_info.html‘, usercenter_info.as_view(), name=‘usercenter_info‘), # 上传头像 url(r‘touxiang/‘, touxiang.as_view(), name=‘touxiang‘), # 配置DjangoUeditor富文本路由映射 url(r‘^ueditor/‘,include(‘DjangoUeditor.urls‘ )) ]
第三百九十四节,Django+Xadmin打造上线标准的在线教育平台—Xadmin集成富文本框
标签:访问 nat dex comment ons tor path apt clu
原文地址:http://www.cnblogs.com/adc8868/p/7580705.html