Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

404 Page for missing pages - #43

Open
revanth-reddy wants to merge 4 commits into
abhijithanilkumar:masterfrom
revanth-reddy:master
Open

revanth-reddy wants to merge 4 commits into
abhijithanilkumar:masterfrom
revanth-reddy:master

Conversation

@revanth-reddy

Copy link
Copy Markdown

When we visit an unexisting link then Django displays a default ERROR 404 page.
This PR is for a custom 404 error handler.

in reference to issue #41

@revanth-reddy

Copy link
Copy Markdown
Author

404 page is rendered only in production, for that DEBUG has to be False

To visualise it in local development environment comment line 6 and add the following two lines in src/appstore/settings/development.py :

DEBUG = False
ALLOWED_HOSTS = ['*']

Comment thread src/appstore/urls.py Outdated
]

#importing custom 404 page handler from "appstore" app views.py
from appstore.views import handler404

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's not mandatory to import handler404 from appstore.views as we already imported views :)
rewriting it to
handler404 = views.handler404
would also do the job.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants