-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: dev mode admin + refactor api init #7628
Conversation
Converting to draft to figure out what to do about tests failing. They don't like an app with no |
N.b., tests are now passing aside from the URL coverage |
Sorry for waffling about whether to leave this as a draft or not. I think that some of the pain I blamed TastyPie for might be self-induced. We have an |
Avoids interacting with the app registry before it's ready.
Ok - I think this is ready. The last commit (95ce3f8) brought the api init up to Django's spec for initializing things that pay attention to the app registry. I've left the admin app as a fully fleshed out app. With the changes here, I could combine the files in |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7628 +/- ##
==========================================
- Coverage 88.98% 88.79% -0.20%
==========================================
Files 291 298 +7
Lines 40717 41292 +575
==========================================
+ Hits 36233 36664 +431
- Misses 4484 4628 +144 ☔ View full report in Codecov by Sentry. |
When in dev mode, applies styling to the Django admin site that resembles main site's dev mode. It also changes the admin title from "Django administration" to "Datatracker administration".
This introduces an
admin
app with anapps.py
. This lets us override the title / header for the admin site without customizing more templates. In theory we could put the contents of theietf/admin/
directory into anietf/admin.py
instead, but this does not play well with TastyPie's api autodiscovery. 😡The CSS for this is a bit clunky - importing
ietf.css
to the admin does nasty things to its formatting. Instead, I've copied the explicit values for a few colors to try to keep the admin consistent with the overall scheme of the site. This is fragile and we could do it better, but I don't think it's worth much more effort.