Django Showing Page not found (404) if ran through command but works if ran through Pycharm GUI

Recently, I encountered an error in my project, I have created a simple Blog website project using Django. it has few apps a=such as home, contact us, blog etc. Now if i try to run the project through command - py manage.py runserver the error shows up like this:

and if ran through pycharm’s gui based run button runs perfectly fine, to express the same phenomenon in other words if i try to run the same url by using http://localhost:8000/blog instead of http://127.0.0.1:8000/blog/ it works. what could be the problem behind this??

It’s an issue of how you have your URLs defined.

The url blog/ is not the same as blog. Apparently you have blog in your url configuration.

1 Like

Actually I’m typing the same in the URL Bar but somehow it automatically changes to blogs/