You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Hi All,
I have a problem with the source code provided on the associated git hub pages:
https://github.com/PacktPublishing/Django-2-by-Example
After downloading the source files, and setting up the chapter 1 example locally, using the default sqlite database
everything works as expected.
However, changing the database to mysql the site breaks. This is the scenario:
Changing the settings.py file to use mysql works fine, and the database is created, and the tables are all populated correctly.
using createsuperuser also works and I am able to access the admin backend and create a post
navigating to :
http://127.0.0.1:8000/blog/2019/1/31/test-post/
however, although this works fine with sqllite, on mysql the link take me to a 404 page:
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/blog/2019/1/31/test-post/
Raised by: blog.views.post_detail
No Post matches the given query.
even though the blog post exists in the mysql table:
table blog_post
id - 1
title - Test Post
slug - test-post
body - content for test post
publish - 2019-01-31 10:56:40.000000
created - 2019-01-31 10:56:59.674959
updated - 2019-01-31 10:56:59.674976
status - published
author_id - 1
I would appreciate any advice on why this is happening when the database is switched to MySQl
thank you
Pedram