You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release 0.1.8: surface toggles + middleware ordering in README
README now documents the ?__autologin__=tmp_off|logout|log_in toggles,
the middleware ordering requirement for manual installs (after
Session/Auth/Messages), and includes middleware_autoinstall and
query_param in the configuration example. No code changes.
Copy file name to clipboardExpand all lines: README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Dev-time conveniences for Django projects: autologin endpoint, dotfiles for LLM
10
10
## Features
11
11
12
12
-**Autologin endpoint** — one URL logs in a user via token, no interactive login needed
13
+
-**Auth-state query toggles** — `?__autologin__=tmp_off|logout|log_in` on *any* URL to flip auth state in the browser without leaving the page
13
14
-**Dotfiles** — `.dev_helpers_token`, `.dev_helpers_port`, `.dev_helpers_pg_*`, `.dev_helpers_redis_*` written to project root for easy `cat` by LLM agents
14
15
-**Agent help prompt** — copy-pasteable curl/psql/redis-cli commands printed at startup
15
16
-**Gitignore self-check** — warns if dotfiles are not in `.gitignore`
Once `AutologinMiddleware` is wired (the default), every request is scanned for
84
+
a toggle query parameter. Drop it onto any URL — the middleware handles it
85
+
before URL resolution.
86
+
87
+
| URL on any view | Effect |
88
+
|---|---|
89
+
|`https://localhost:8000/some/page/?__autologin__=tmp_off`| Render **this one request** with `request.user = AnonymousUser`. Session unchanged — the next plain request is logged in again. Toggle param stripped from `request.GET` before the view sees it. |
90
+
|`https://localhost:8000/some/page/?__autologin__=logout`|`django.contrib.auth.logout(request)` — ends the session. 302 to the same path with the toggle stripped; other query parameters preserved. |
91
+
|`https://localhost:8000/some/page/?__autologin__=log_in` (or `login`) | Log in the configured user (`autologin.user_lookup_field` / `user_lookup_value`). 302 to the cleaned URL. No URL token required — the localhost host allowlist is the trust signal. |
92
+
93
+
Unknown values pass through silently (likely typos). Off-host requests pass
94
+
through identically — the toggles do not announce their existence to
95
+
unauthorized hosts.
96
+
97
+
Rename the parameter via `autologin.query_param`, or set it to `""` / `None`
98
+
to disable the toggle layer while keeping the path-based `/__autologin__/`
0 commit comments