Comments (5)
I've been digging into this and there's been a kind of surprising amount of movement in the admin config area of 2.0 and 2.1 and I'm not sure the best route forward here.
- 2.0 changed a bunch of things around URL conf and how they get installed.
- There are some details around installing
SimpleAdminConfig
vsAdminConfig
- In 2.1, there's an option to create a custom
AdminConfig
that can override the default admin site
from django-adminplus.
Great point there @jsocol! I just wrote this little appconfig module for our purposes. Note that this is doing more than just installing AdminPlus, it sets titles, wraps with a login required so we can use a central single, central login view.
admin.py
:
from django.contrib.admin.apps import AdminConfig
from django.contrib.auth.decorators import login_required
class AdminPlusConfig(AdminConfig):
default_site = 'adminplus.sites.AdminSitePlus'
def ready(self):
super().ready()
self.module.site.site_title = self.module.site.site_header = 'Our Magic Admin'
self.module.site.login = login_required(self.module.site.login)
settings.py
:
INSTALLED_APPS = [
'admin.AdminPlusConfig',
'adminplus', # needed unless you make that AppConfig "poison" the template dirs
]
urls.py
:
from django.contrib import admin
urlpatterns = [
path('admin/', include(admin.site.urls[:2], admin.site.urls[2])),
]
The site.urls is the only bit that's a bit funky now. If you could make that a Django 2-sensitive @property
, that would really minimise the amount of hacking to get this in. Hell, you could even provide a little AppConfig, makes installation just two lines in INSTALLED_APPS
.
from django-adminplus.
Hi @jsocol - are there any plans to support Django 2.x ?
from django-adminplus.
I would love to get this updated. I imagine this situation described in this comment has gotten better since we no longer have to worry about 2.0 and 2.1, only 2.2 and 3.0. I have not been working in Django day to day recently, though, so I'm not sure how easy it will be to support both 2.2 and 3.0.
I'm extremely open to patches that bring adminplus up to date with 2.2'sโ and hopefully 3.0'sโadmin module changes. I hope that the differences are smaller than existed between 2.{0,1,2}.
from django-adminplus.
The code on main
is now tested against Django 3.2, 4.2, and 5.0 (plus some others) and seems to be working. I'm working on cutting a new release today
from django-adminplus.
Related Issues (20)
- Upgrade the link TD to TH HOT 1
- Template different to main site HOT 5
- Completely broken on Django 1.9.5 HOT 6
- Authentication and Authorization disappears in Django 1.9.6 HOT 1
- Pass view objects to template
- How to change "Custom Views" title text in admin section. HOT 5
- Now have to set admin.sites.site HOT 4
- Hide parameterized URLs
- How to hide the custom view from admin main page HOT 1
- Models not resolving on Django 2.0
- No module named "SimpleAdminConfigdjango" HOT 1
- Django 4 support HOT 9
- [catchup] Double check CI and branch protection config HOT 1
- [catchup] Drop Python 2 support HOT 1
- [catchup] Test against modern Django HOT 1
- Automate releases HOT 1
- Rename the module to django_adminplus
- Autodiscover from readme doesn't work correctly
- Moving to adminplus locks out superuser from editing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-adminplus.