StaffCoder
Django
DjangoDjango 5.2Python 3.13
18 modules · 72 challengesSign up
Modules18 modules · 72 challenges
Sit in the request pipeline: time every response, refuse traffic before a view runs, capture exceptions the right way, and compose layers in a deliberate order.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Request Timing Middleware

Sign up to unlock
—No data yetmedium
About this challenge

Nothing in the project records what each request asked for or how long it took, so operations has no timing or identity in the logs. Write the middleware that times the downstream handling and logs one structured entry per request while passing every response through untouched.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Maintenance Mode Gate

Sign up to unlock
—No data yetmedium
About this challenge

During releases the site should return a maintenance response, except for staff who need to verify the deploy. Write the middleware that short-circuits with the defined 503 before the view runs, exempting staff users and the allowlisted paths.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Exception Capture Ordering

Sign up to unlock
—No data yetmedium
About this challenge

Unhandled view errors answer with a raw 500 that carries no trace id, and a request has nothing tying its log lines together. Write a middleware that stamps every request with an id and turns an unhandled view exception into the defined JSON error response carrying it, then register it in the right place in the stack.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Observable Request Pipeline

STAR
Solving it completes the module
0%0 of 1 solvedmedium
About this challenge

The app needs one coherent request pipeline - identity, timing, maintenance gating, and error conversion working together in the right order - and currently has none of it. Write the layers that assign a request id, log one timed entry carrying it, gate general traffic with the defined 503 while staff pass, and convert an unhandled view exception into the defined error response, then register them so every concern sees what it must.

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.