django管理ckeditor集成。

django-ckeditor-updated的Python项目详细描述


django-ckeditor
====
*riklaunim/django-ckeditor在pypi上作为https://pypi.python.org/pypi/django-ckeditor-updated-最新代码,与最新的django一起工作
*shaunsephton/django-ckeditor在pypi上作为https://pypi.python.org/pypi/django-ckeditor-仍然是旧版本而不是co兼容较新的django版本



**此fork,django ckeditor已更新,其配置与旧的django ckeditor不同。我的所有更改最近都合并到shaunsephton repository
,但它们还没有作为一个包发布。在django ckeditor无法获得新的和恒定的版本之前,我将维护这个fork。***



**django admin ckeditor集成。**
提供一个"richtextfield"和"ckeditorwidget",利用ckeditor,包括图像上传和浏览支持。

*这个版本还包括学生:
。支持django存储(与s3一起使用)
将ckeditor更新到4.4版。包括所有的ckeditor语言文件,让大家高兴!

…内容::内容
:深度:5


安装
----


必需
~~~~~~
安装或添加更新到python路径的django ckeditor。注意:您可能没有同时安装原始的django ckeditor和django ckeditor。将"ckeditor"添加到"已安装的应用程序"设置中。

。将ckeditor上载路径设置添加到项目的"setting s.py"文件中。此设置指定指向ckeditor媒体上载目录的相对路径。ckeditor使用django存储api。默认情况下,django使用文件系统存储后端(它将使用您的媒体根和媒体url),如果您不使用不同的后端,则必须对媒体根中的ckeditor上载路径具有写权限,即:




ckeditor上载路径="uploads/"

e默认文件系统存储图像将上载到媒体根目录中的"上载"文件夹,并根据媒体URL(/media/uploads/image.jpg)创建URL。

ckeditor已通过django文件系统存储和s3botostorage测试。
使用djan的s3storage存在问题去储藏室。运行"collectstatic"管理命令:`$/manage.py collectstatic``。这将把静态ckeditor需要的媒体资源复制到"static\u root"设置给定的目录中。有关详细信息,请参见"django关于管理静态文件的文档"https://docs.djangoproject.com/en/dev/howto/static files>;``。将ckeditor url include添加到项目的"url.py"文件中:

(r"^ckeditor/",include('ckeditor.url'),

。将"ckeditor_image_backend"设置为支持的后端之一,以在ckeditor库中启用缩略图。默认情况下,不创建缩略图,并使用全尺寸图像作为预览。支持的后端:

-``枕头``:使用PIL或枕头。django ckeditor在ckeditor-init.js文件中使用jquery。必须将"ckeditor_jquery_url"设置为将用于加载库的jquery url。如果jquery是从不同的源加载的,不要设置这个变量,django ckeditor将不会尝试加载它自己的jquery。示例:

ckeditor_jquery_url='//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'



默认情况下,所有上载的文件都会被删除,以禁用此功能,将"ckeditor_upload_slugify戡filename"设置为"false"

。在项目的"setting s.py"文件中,将ckeditor"restrict"by"u user"设置设置为"true"(默认值为"false")。这限制了上传用户对上传图像的访问(例如,每个用户只看到并上传自己的图像)。超级用户仍然可以看到所有图像。**注意**:此限制仅在ckeditor媒体浏览器中实施。

向项目的"setting s.py"文件中添加ckeditor\u configs设置。这指定了一组通过的ckeditor设置编辑到ckeditor(请参阅ckeditor的"设置配置"http://docs.cksource.com/ckeditor_3.x/developers_guide/setting_configurations>;```),即:


ckeditor_configurations={
"棒极了的ckeditor":{
"工具栏":"基本"、
}、
}

在实例化richtextfield时可以引用设置的名称:

content=richtextfield(config_name='awesome撸ckeditor')

实例化ckeditor widget时可以引用设置的名称:

widget=ckeditorwidget(confi通过指定一个名为"default"的集合,您将把它的设置应用到所有未明确定义"config"name的richtextfield和ckeditorwidget对象::

ckeditor配置={
"default":{
"工具栏":"完整的","高度":300,
"宽度":300,
},
}



LD型。ckeditor小部件被呈现为表单字段,但在所有其他方面,该字段的行为都是标准的django"textfield"。例如:

from django.db import models
from ckeditor.fields import richtextfield

class post(models.model):
content=richtextfield()



widget
~~~~~~
a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a菲尔德。例如:

from django import forms
from django.contrib import admin
from ckeditor.widgets import ckeditor widget


from post.models import post

class postadminfo(forms.modelform):
content=forms.charfield(widget=ckeditorwidget())
类meta:
model=post

类post admin(admin.modeladmin):
form=postadminfo

admin.site.register(post,postadmin)

管理命令
~图像已包含在"ckeditor_upload_path"中。当开始对现有图像使用django ckeditor时,这对于创建缩略图非常有用。按如下方式发出命令:

$./manage.py generateckeditorthumbnails

**注意**:如果使用自定义视图,请记住通过`{form.media}`或通过`<;script>;``标记在窗体的媒体中包含ckeditor.js。管理员将自动为您执行此操作。更多信息请参见http://docs.djangoproject.com/en/dev/topics/form s/media/>;`````````````````````````````有关使用S3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/>允许edcontent可以工作,禁用**stylesheetparser**插件。
因此将此功能包含在您的设置中。py。


ckeditor_configs={
"default":{
"removeplugins":"stylesheetparser",
}
}


如果克隆存储库您将能够运行"ckeditor_demo"应用程序。`` pip安装-r ckeditor_demo_requirements.txt``

运行"python.manage.py syncdb``

。如果要在"管理"面板中测试小部件,请创建超级用户。启动开发服务器。

在主页面(/)上有一个窗体,在管理中有一个模型,该模型使用该小部件作为模型字段。
数据库设置为sqlite3,静态/媒体根目录设置为临时目录中的文件夹。



您可以使用"python manage.py test ckeditor_demo`"(仅用于repo签出)或配置为使用python运行的"tox"运行测试2.7和3.3.
(您可能需要修复python 3.3的selenium webdriver中的一些导入)。
作者
==




` riklaunim<;https://github.com/riklaunim>;`



----
` shaunsephton<;http://github.com/shaunsephton>;`




贡献者
----
。` 3点2<;https://github.com/3point2>;`
。` buchuki<;http://github.com/buchuki>;`
。` chr15m<;http://github.com/chr15m>;`
。` hedleyroos<;https://github.com/hedleyroos>;`
。` jeffh<;https://github.com/jeffh>;`
。` lihan<;https://github.com/lihan>;`
。` loop0<;http://github.com/loop0>;`\` mwcz<;https://github.com/mwcz>;`
。` tomwys<;https://github.com/tomwys>;`
。` snbuback<;https://github.com/snbuback>;`
。以及其他`<;https://github.com/**/django ckeditor/graphs/contributors>;` `
更改日志
===


4.4.4
----
。将ckeditor更新到4.4.4完整包-对于您可能需要的所有插件和静态文件。内联编辑器的修复程序。编辑器初始化使用jquery。您需要指定ckeditor_jquery_url才能使其工作。您可以使用:

ckeditor_jquery_url='//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'



4.4.0
----
。将ckeditor更新至4.4.1
。Django 1.7兼容性修复程序将ckeditor更新至4.3.3

>4.2.7
----
。如果文件名中只有错误字符,请将slugifying修复为空文件名。使用随机字符串作为回退。
。不要在ckeditor文件浏览器中对非图像文件使用img标记。
从破坏CollectStatic的CSS文件中删除不存在的图像引用。
。其他修复

4.2.5/4.2.6
----
。修复静态文件安装-从distutils切换到setuptools。添加了带有Selenium集成测试的新演示应用程序。python 3.3和2.7测试的tox设置。将图像处理提取到后端。枕头现在是可选的。可以添加其他后端。修复了缩略图生成

4.2.3
-
的错误。python 3.3兼容性
默认情况下,所有上载的文件都会被删除(新设置ckeditor_slugify_filename)
。编辑链接时上载文件(<;a href>;)现在可以正常工作。python 3.3 widgets.py中的兼容性包括ckeditor版本4.2.1.
。支持django 1.6

>4.0.2
----
。包括ckeditor版本4.0.2.

3.6.2.1
----
。从分发中删除不需要的静态文件。
。使用枕头而不是PIL,因为它建立在所有系统上。包括ckeditor 3.6.2版。
关于django对齐主题的初始工作。修复媒体URL生成时的架构斜杠删除问题。感谢'mwcz<;https://github.com/mwcz>;`
。增加了南方的兼容性。感谢'3point2<;https://github.com/3point2>;`
。防止设置在小部件实例之间泄漏。感谢'3point2<;https://github.com/3point2>;`
。修复了将详细名称用作字段的第一个位置参数时的配置名称冲突。感谢'3point2<;https://github.com/3point2>;`
。重构视图以允许使用带有本地路径的文件遍历。感谢'3point2<;https://github.com/3point2>;`
。添加了生成缩略图的命令。感谢'3point2<;https://github.com/3point2>;`
。从使用媒体迁移到静态文件管理。

0.0.9
----

增加了通过ckeditor配置ckeditor的功能。感谢'jeffh<;https://github.com/jeffh>;``的输入。

<0.0.8
----

\删除了错误url include check。

0.0.7
----
。修改了egg包以排除testing admin.py以及型号。py.

0.0.6
----
。执行正确的配置。
。更改上载行为以按上载日期将文件分隔到目录中。感谢'loop0<;http://github.com/loop0>;`.
。增加了限制用户访问上传内容的功能(请参阅ckeditor_restrict_by_user设置)。感谢'chr15m<;http://github.com/chr15m>;``的输入。
。添加了一组非常需要的初始测试。一般清理,轻度重构。

0.0.5
----
CSRF_免除向后兼容。感谢http://github.com/chr15m>;`.

>0.0.4
----
。包括资源,抱歉。

0.0.3
----
更强大的PIL导入。谢谢"buchuki"<;http://github.com/buchuki>;`.
。更好的ckeditor_media_前缀设置错误。

<0.0.2
----
。包含在清单中的readme.rst。

>0.0.1
----
。添加了ckeditor_upload_前缀设置。感谢输入"chr15m<;http://github.com/chr15m>;"。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在java中查找特定命名方案的所有文件   java需要帮助在这个程序中查找错误,编译但不是计算机所必需的数字   java Androidsocket连接被拒绝   java在单元测试中使用Intent类   sql server 2008换行转义序列在Java中没有以正确的方式回避   嵌入十六进制编码的unicode Java字符串   java无法为类实现tester程序   为json字符串创建通用java映射器   java如何将2个TextView与Android中的if-else条件放在同一位置   java如何初始化锁?   为什么我的多项式类加法函数不起作用?   java Intellij不使用库构建JavaFX   java为什么在EJB类上同时使用@LocalBean和接口?   java无法在Spring Security中登录   Java中的文件创建   运行servlet需要哪个JRE。。服务器JRE还是客户端JRE?   来自Windows命令行的SOAP Web服务中的java SSL证书问题   java JPA如何为实体实施OneOnOne关系?