gpt4 book ai didi

python - 无法让 zinnia 在我的 django 应用程序中工作

转载 作者:行者123 更新时间:2023-11-28 23:00:18 25 4
gpt4 key购买 nike

localhost 上访问 test server/weblog/ url 后,在“最新的一切都稳定”的环境中(python 2.7,django 1.4.1,apache 2.2。 22) 我得到:

NoReverseMatch at /weblog/

Reverse for 'zinnia_entry_add' with arguments '()' and keyword arguments '{}' not found.

Request Method: GET
Request URL: http://127.0.0.1/weblog/
Django Version: 1.4.1
Exception Type: NoReverseMatch
Exception Value:

Reverse for 'zinnia_entry_add' with arguments '()' and keyword arguments '{}' not found.

Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 424
Python Executable: /usr/bin/python
Python Version: 2.7.3

摘自settings.py:

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.staticfiles',
'django.contrib.admindocs',
'django.contrib.messages',
'django.contrib.comments',
'image_labeler',
'tagging',
'mptt',
'zinnia',
)

TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static',
'zinnia.context_processors.version',
)

来自urls.py:

urlpatterns = patterns('',
# Example:
# (r'^lastpixel/', include('lastpixel.foo.urls')),

# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^weblog/', include('zinnia.urls')),
(r'^comments/', include('django.contrib.comments.urls')),
(r'^admin/', include(admin.site.urls)),
(r'^$', views.Index),
(r'^login/?$', views.Login),
(r'^logout/?$', views.Logout),
(r'^register/?$', views.Register),
(r'^i$', include('image_labeler.urls')),
(r'^i/', include('image_labeler.urls')),
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': '/home/lastpixel/web/media', 'show_indexes': True}),
(r'^.*$', views.Index),
)

该应用程序以其他方式工作(没有 zinnia 博客)。知道我可能做错了什么吗?非常感谢!

最佳答案

更新 zinnia 后我遇到了类似的问题。这帮助了我,虽然我没想到 mysql 中的解决方案:

首先,编辑/etc/my.conf

[client]
default-character-set=utf8

[mysqld]
default-character-set = utf8
skip-character-set-client-handshake
character-set-server = utf8
collation-server = utf8_general_ci
init-connect = SET NAMES utf8

二、重启mysql

取自: zinnia on github

关于python - 无法让 zinnia 在我的 django 应用程序中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12255788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com