1
我嘗試使用django集成django-wysihtml5 1.6.1 我執行所有從a GitHub開始的快速啓動步驟。 安裝six和django-wysihtml5。在settings.py 添加應用程序名稱,但wysihtml5不工作,我沒有任何錯誤。 我使用Python3.2django 1.6 django-wysihtml5 integration
models.py:
from wysihtml5.fields import Wysihtml5TextField
class Article(models.Model):
....
body = Wysihtml5TextField()
admin.py:
from wysihtml5.admin import AdminWysihtml5TextFieldMixin
class ArticleAdmin(admin.ModelAdmin, AdminWysihtml5TextFieldMixin):
....
search_fields = ['title', 'body']
admin.site.register(Article, ArticleAdmin)
我通過python3安裝Django-wysihtml5的setup.py安裝
安裝日誌:
running install
Checking .pth file support in /usr/local/lib/python3.2/dist-packages/
/usr/bin/python3 -E -c pass
TEST PASSED: /usr/local/lib/python3.2/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating django_wysihtml5.egg-info
writing django_wysihtml5.egg-info/PKG-INFO
writing top-level names to django_wysihtml5.egg-info/top_level.txt
writing dependency_links to django_wysihtml5.egg-info/dependency_links.txt
writing manifest file 'django_wysihtml5.egg-info/SOURCES.txt'
reading manifest file 'django_wysihtml5.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs'
writing manifest file 'django_wysihtml5.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/wysihtml5
copying wysihtml5/utils.py -> build/lib/wysihtml5
copying wysihtml5/fields.py -> build/lib/wysihtml5
copying wysihtml5/models.py -> build/lib/wysihtml5
copying wysihtml5/admin.py -> build/lib/wysihtml5
copying wysihtml5/__init__.py -> build/lib/wysihtml5
copying wysihtml5/widgets.py -> build/lib/wysihtml5
creating build/lib/wysihtml5/tests
copying wysihtml5/tests/fields.py -> build/lib/wysihtml5/tests
copying wysihtml5/tests/models.py -> build/lib/wysihtml5/tests
copying wysihtml5/tests/settings.py -> build/lib/wysihtml5/tests
copying wysihtml5/tests/__init__.py -> build/lib/wysihtml5/tests
copying wysihtml5/tests/widgets.py -> build/lib/wysihtml5/tests
creating build/lib/wysihtml5/conf
copying wysihtml5/conf/defaults.py -> build/lib/wysihtml5/conf
copying wysihtml5/conf/__init__.py -> build/lib/wysihtml5/conf
creating build/lib/wysihtml5/static
creating build/lib/wysihtml5/static/wysihtml5
creating build/lib/wysihtml5/static/wysihtml5/css
copying wysihtml5/static/wysihtml5/css/stylesheet.css -> build/lib/wysihtml5/static/wysihtml5/css
copying wysihtml5/static/wysihtml5/css/toolbar.css -> build/lib/wysihtml5/static/wysihtml5/css
creating build/lib/wysihtml5/static/wysihtml5/img
copying wysihtml5/static/wysihtml5/img/toolbar.png -> build/lib/wysihtml5/static/wysihtml5/img
creating build/lib/wysihtml5/static/wysihtml5/js
copying wysihtml5/static/wysihtml5/js/advanced.js -> build/lib/wysihtml5/static/wysihtml5/js
copying wysihtml5/static/wysihtml5/js/simple.js -> build/lib/wysihtml5/static/wysihtml5/js
copying wysihtml5/static/wysihtml5/js/wysihtml5-0.3.0.min.js -> build/lib/wysihtml5/static/wysihtml5/js
copying wysihtml5/static/wysihtml5/js/wysihtml5-0.4.0pre.min.js -> build/lib/wysihtml5/static/wysihtml5/js
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/wysihtml5
copying build/lib/wysihtml5/utils.py -> build/bdist.linux-x86_64/egg/wysihtml5
copying build/lib/wysihtml5/fields.py -> build/bdist.linux-x86_64/egg/wysihtml5
copying build/lib/wysihtml5/models.py -> build/bdist.linux-x86_64/egg/wysihtml5
copying build/lib/wysihtml5/admin.py -> build/bdist.linux-x86_64/egg/wysihtml5
creating build/bdist.linux-x86_64/egg/wysihtml5/static
creating build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5
creating build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/css
copying build/lib/wysihtml5/static/wysihtml5/css/toolbar.css -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/css
copying build/lib/wysihtml5/static/wysihtml5/css/stylesheet.css -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/css
creating build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/img
copying build/lib/wysihtml5/static/wysihtml5/img/toolbar.png -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/img
creating build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/js
copying build/lib/wysihtml5/static/wysihtml5/js/advanced.js -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/js
copying build/lib/wysihtml5/static/wysihtml5/js/simple.js -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/js
copying build/lib/wysihtml5/static/wysihtml5/js/wysihtml5-0.3.0.min.js -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/js
copying build/lib/wysihtml5/static/wysihtml5/js/wysihtml5-0.4.0pre.min.js -> build/bdist.linux-x86_64/egg/wysihtml5/static/wysihtml5/js
copying build/lib/wysihtml5/__init__.py -> build/bdist.linux-x86_64/egg/wysihtml5
copying build/lib/wysihtml5/widgets.py -> build/bdist.linux-x86_64/egg/wysihtml5
creating build/bdist.linux-x86_64/egg/wysihtml5/tests
copying build/lib/wysihtml5/tests/fields.py -> build/bdist.linux-x86_64/egg/wysihtml5/tests
copying build/lib/wysihtml5/tests/models.py -> build/bdist.linux-x86_64/egg/wysihtml5/tests
copying build/lib/wysihtml5/tests/settings.py -> build/bdist.linux-x86_64/egg/wysihtml5/tests
copying build/lib/wysihtml5/tests/__init__.py -> build/bdist.linux-x86_64/egg/wysihtml5/tests
copying build/lib/wysihtml5/tests/widgets.py -> build/bdist.linux-x86_64/egg/wysihtml5/tests
creating build/bdist.linux-x86_64/egg/wysihtml5/conf
copying build/lib/wysihtml5/conf/defaults.py -> build/bdist.linux-x86_64/egg/wysihtml5/conf
copying build/lib/wysihtml5/conf/__init__.py -> build/bdist.linux-x86_64/egg/wysihtml5/conf
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/utils.py to utils.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/fields.py to fields.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/models.py to models.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/admin.py to admin.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/__init__.py to __init__.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/widgets.py to widgets.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/tests/fields.py to fields.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/tests/models.py to models.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/tests/settings.py to settings.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/tests/__init__.py to __init__.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/tests/widgets.py to widgets.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/conf/defaults.py to defaults.cpython-32.pyc
byte-compiling build/bdist.linux-x86_64/egg/wysihtml5/conf/__init__.py to __init__.cpython-32.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying django_wysihtml5.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying django_wysihtml5.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying django_wysihtml5.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying django_wysihtml5.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
wysihtml5.tests.__pycache__.__init__.cpython-32: module references __file__
wysihtml5.tests.__pycache__.settings.cpython-32: module references __file__
creating dist
creating 'dist/django_wysihtml5-1.2b1-py3.2.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing django_wysihtml5-1.2b1-py3.2.egg
creating /usr/local/lib/python3.2/dist-packages/django_wysihtml5-1.2b1-py3.2.egg
Extracting django_wysihtml5-1.2b1-py3.2.egg to /usr/local/lib/python3.2/dist-packages
Adding django-wysihtml5 1.2b1 to easy-install.pth file
Installed /usr/local/lib/python3.2/dist-packages/django_wysihtml5-1.2b1-py3.2.egg
Processing dependencies for django-wysihtml5==1.2b1
Finished processing dependencies for django-wysihtml5==1.2b1
管理頁面的源代碼:
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/static/admin/js/core.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.js"></script>
<script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
<script type="text/javascript" src="/static/admin/js/actions.js"></script>
<script type="text/javascript" src="/static/admin/js/urlify.js"></script>
<script type="text/javascript" src="/static/admin/js/prepopulate.js"></script>
我已經在我的靜態文件夾中的所有文件,這
hi arocks!我做到了。 –
我安裝django-wysihtml5通過python3 setup.py安裝,也許問題在其中? –
看起來安裝成功了。您將在編輯「文章」時檢查管理頁面,看看您是否有任何javascript錯誤。應該有一個參考wysihtml5-0.3.0.min.js什麼的。 – arocks