StaffCoder
Django
DjangoDjango 5.2Python 3.13
18 modules · 72 challengesSign up
Modules18 modules · 72 challenges
Sign people in and out with Django's own views, gate pages on login, permissions and flags, and run the project on an email-identified user model.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Session Access Flow

Sign up to unlock
100%2 of 2 solvedmedium
About this challenge

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 problem
Solved in a browser IDE and graded by tests. Sign up to solve

Permission Gated Publishing

Sign up to unlock
100%2 of 2 solvedmedium
About this challenge

Publishing 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 problem
Solved in a browser IDE and graded by tests. Sign up to solve

Email Login Custom User

Sign up to unlock
100%2 of 2 solvedmedium
About this challenge

The 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 problem
Solved in a browser IDE and graded by tests. Sign up to solve

Members Area Access Matrix

STAR
Solving it completes the module
100%2 of 2 solvedmedium
About this challenge

The 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
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.