django1.9.6 使用 DjangoUeditor (python3.5)
DjangoUeditor https://github.com/zhangfisher/DjangoUeditor
1 DjangoUeditor 安装
pip install DjangoUeditor
需要修改的地方:
打开 %python_root%\Lib\site-packages\DjangoUeditor (如D:\Python\Python35\Lib\site-packages\DjangoUeditor)
commands.py:
from . import settings as USettings
forms.py
from .widgets import UEditorWidget
models.py
from DjangoUeditor.widgets import UEditorWidget, AdminUEditorWidget
settings.py
UserSettings=getattr(gSettings,"UEDITOR_SETTINGS",{}).copy()
# if UserSettings.has_key("config"):UEditorSettings.update(UserSettings["config"])
if UserSettings.get("config"):UEditorSettings.update(UserSettings["config"])
# if UserSettings.has_key("upload"):UEditorUploadSettings.update(UserSettings["upload"])
if UserSettings.get("upload"):UEditorUploadSettings.update(UserSettings["upload"])
# if UEditorSettings.has_key(key):
if UEditorSettings.get(key):
urls.py
# from django.conf.urls import patterns, url
from django.conf.urls import url ###################
urlpatterns = [
url(r'controller/$',get_ueditor_controller),
]
views.py
全部的
except Exception,E: 改成
except Exception as E:
widgets.py
utils.py
使用方法参考
https://github.com/zhangfisher/DjangoUeditor
最后注意一点的事在 在模板里面 使用DjangoUeditor
<head>
......
{{ form.media }} #这一句会将DjangoUeditor 所需要的CSS和JS加进来。
......
</head>
最后再需要的元素中引用 form
如 <form> {{ form }} <form>
django1.9.6 使用 DjangoUeditor (python3.5)的更多相关文章
- win10下安装Django
Django的核心(1.4+)可以运行在从2.5到2.7之间的任何Python版本. 我的电脑是操作系统是window10 ,内存是4G. 1.下载django 官网地址:https://www.dj ...
- Django学习笔记第四篇--数据处理URL和数据库
一.URL: 1.基础的URL与视图函数的映射 from django.conf.urls import url from django.contrib import admin from appna ...
- apache2.4 +django1.9+python3+ubuntu15.10
这是我这几天学习部署django的总结,中间出现了不少的问题.特此记录下来,用来复习巩固,同时也希望给想学习的同学一些参考. 第一步:我在ubuntu上装的是python3.sudo apt-get ...
- 64位win8 配置Apache2.4+mod_msgi4.4.21+django1.8.6+python3.4
学习了很多前人分享的资料,整理如下: 安装步骤: 一.安装python3.4 下载 python-3.4.3.amd64.msi 直接安装 地址:https://www. ...
- windows下django1.7 +python3.4.2搭建记录1
python+django在linux下搭建比较简单,windows下搭建比较复杂,所以列在下方一.下载安装下载django的包,到刚解压后的Django-1.7目录下执行命令 python setu ...
- Cenos6.6 升级 python3.5.2 安装配置 django1.10
1 准备编译环境(环境如果不对的话,可能遇到各种问题,比如wget无法下载https链接的文件) yum groupinstall 'Development Tools' yum install zl ...
- 如何在Django1.6结合Python3.4版本中使用MySql
唉,最近赶了个新潮,用起了Python3.4跟Django1.6,数据库依然是互联网企业常见的MySql. 悲催的是在Python2.7时代连接MySql的MySQLdb还不支持Python3.4,还 ...
- 如何在Django1.6结合Python3.3版本中使用MySql
用起了Python3.4跟Django1.6,数据库依然是互联网企业常见的MySql. 悲催的是在Python2.7时代连接MySql的MySQLdb还不支持Python3.4,还好,苦苦追问G哥终于 ...
- Python3.7&Django1.11.15 兼容性问题
环境: 1. Windows10 2. python3.7 3. Django1.11.15 启动Django时抛出以下异常: Unhandled exception in thread starte ...
随机推荐
- js模板引擎
js模板引擎包括如下: template 官方参考:http://aui.github.io/artTemplate BaiduTemplate 官方参考:http://baidufe.github. ...
- JVM 内存
大多数 JVM 将内存区域划分为 Method Area(Non-Heap)(方法区) ,Heap(堆) , Program Counter Register(程序计数器) , VM Stack( ...
- SSO之CAS总结
1.采用kerberos原理 2.特点,经纪人模式即需要sso的所有用户账号要集中在一起 3.安全性保证方法: 关键就是保证TS和TGC的安全. 3.1)TS生成是采用足够随机算法,一次性使用,设置有 ...
- How to Create Mixed Reality Videos for the Vive - with Two Controllers
http://secondreality.co.uk/blog/how-to-create-mixed-reality-videos-for-the-vive-with-two-controllers ...
- 怎么写jq插件?
1.概述 先看看html代码 <ul id="catagory"> <li><a href="#">jQuery</a ...
- 10月9日Android学习笔记:活动与服务之间的通信
最近在照着<第一行代码>这本书来学安卓,顺便记下笔记.主要的内容是Android中服务的第二种启动方式,通过活动绑定服务来启动服务,实现活动与服务之间的通信. 一. 首先创建一个服务类 p ...
- winform客户端程序第一次调用webservice方法很慢的解决方法
.net2.0的winform客户端最常用的与服务端通信方式是通过webservice,最近在用dottrace对客户端做性能测试的时候发现,客户端程序启动以后,第一次调用某一个webservice的 ...
- iOS开发多线程篇—创建线程
iOS开发多线程篇—创建线程 一.创建和启动线程简单说明 一个NSThread对象就代表一条线程 创建.启动线程 (1) NSThread *thread = [[NSThread alloc] in ...
- php数据库封装与引用方法
1.做封装类 <?php class DBDA { //成员变量 数据库的四个条件 public $host="localhost"; public $uid = " ...
- centos 防火墙配置
转载:http://www.cnblogs.com/bugs/p/3587915.html 1.安装iptables防火墙 怎么知道系统是否安装了iptables?执行iptables -V,如果显示 ...