
The site has member pages but no way to sign in, and the protected views are protected by nothing. Wire Django's built-in LoginView and LogoutView with your own login template, gate the member views with login_required, and send a visitor back to the page they originally asked for.
Read the full problemPublishing and unpublishing are gated on being signed in and nothing more, so every author can change the state of anyone's article. Gate both actions on the model permission app.publish_article, hide the controls from a visitor who does not hold it, and let the editors group grant it.
Read the full problemThe product signs users up by email, but the shipped user model still identifies people by a username. Replace it with a custom user model that authenticates by email, backed by a manager that creates users and superusers correctly.
Read the full problemThe members area has a public page, member pages, permission-gated actions and a staff-only section, and today every one of them is reachable by everyone. Enforce the whole access matrix across the view and template layers, with a login redirect for anonymous visitors and a 403 for signed-in visitors who are not allowed.
Read the full problem