Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoReverseMatch at /admin/zinnia/entry/, using MySQL UTF-8 database #144

Closed
jasoniem9246 opened this issue May 1, 2012 · 2 comments
Closed

Comments

@jasoniem9246
Copy link

Hi,
I can add a new entry when use default DB under MySQL, but I need to save UTF-8 words so I create the database as following:
CREATE DATABASE mydb
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;

After sending the a new entry, I caught the error NoReverseMatch at /admin/zinnia/entry/
Reverse for 'zinnia_entry_detail' with arguments '()' and keyword arguments '{'year': '2012', 'slug': u'', 'day': '01', 'month': '05'}' not found. I also name the slug, but the slug shows nothing in the error.

Thanks your help!

My urls.py:

from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',

     url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 

     url(r'^admin/', include(admin.site.urls)),

     url(r'^$', include('zinnia.urls.entries')),
     url(r'^search/', include('zinnia.urls.search')),
     url(r'^sitemap/', include('zinnia.urls.sitemap')),
     url(r'^trackback/', include('zinnia.urls.trackback')),
     url(r'^weblog/tags/', include('zinnia.urls.tags')),
     url(r'^weblog/feeds/', include('zinnia.urls.feeds')),
     url(r'^weblog/authors/', include('zinnia.urls.authors')),
     url(r'^weblog/categories/', include('zinnia.urls.categories')),
     url(r'^weblog/discussions/', include('zinnia.urls.discussions')),
     url(r'^weblog/', include('zinnia.urls.entries')),
     url(r'^weblog/', include('zinnia.urls.archives')),
     url(r'^weblog/', include('zinnia.urls.shortlink')),
     url(r'^weblog/', include('zinnia.urls.quick_entry')),
     url(r'^comments/', include('django.contrib.comments.urls')),


)
@jasoniem9246
Copy link
Author

I've been solved this by changing database configure.

  1. create databaase MyDB default character set utf8;

  2. edit /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

3)restart mysql

@Fantomas42
Copy link
Owner

In one word: Perfect !

I think that your feedback can help a lot of people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants