Is it time for a Django Admin rewrite? If so, how?
Published October 26, 2026
This video features Emma Delescolle at DjangoCon Europe 2026 in Athens, Greece.
WORKSHOP: Django-Admin-Deux: From First Steps to Custom Plugins by Emma Delescolle
What if customizing Django's admin felt like writing any other Django view? Django-Admin-Deux aims at doing just that. It is not just a cosmetic refresh, it's a radically new approach relying on factory-generated views with a plugin-first design.
More information: https://2026.djangocon.eu/speakers/XREAEA/
Follow DjangoCon Europe on social media:
*X - https://x.com/DjangoConEurope/
*LinkedIn - https://www.linkedin.com/company/djangocon-europe/
*Mastodon - https://fosstodon.org/@djangoconeurope
#django #djangocon #djangoconeurope #djangoconeurope2026
Automatically transcribed, so expect mistakes in names and technical terms.
Speaker 1: Hey, I am talking uh in a mic for the first time, so uh we are here to talk uh about Django Armin Deukes from MI Uh Dell's call? Okay. So all yours.
Speaker 2: Thank you. So yes, for anyone who wants to follow along and hasn't done so already. as the QR code to to the slides. Um and yes, I'm Emma. I still work for Levit. and squads. Was anybody who's here today not uh there yesterday for the main talk? No? Okay, so I don't I don't need to to repeat myself too much This was the original plan for the workshop since uh there is no real table uh to to get things going. We're going to innovate a little bit on that. But that's still pretty much
Speaker 2: what I intend to to follow. So we will go a bit more in detail over the architecture of the tool and then we will see some some code. So um a pretty central piece of Django Admin De is the factory system, which builds views uh on the according to uh um recipes and those recipes are uh referred to as action So we are going to to go uh step by step, but the most important part of an action is that an action is
Speaker 2: This defines a base a base view class and then uh plugins uh register um register mixings against that action. So uh for example for the for a list view the the list action will say hi my um base class is uh the Django generic list view And uh the search plugin is going to say hey for the uh list action I am uh registering uh search widget And I am registering a query set modifier for that for also that view.
Speaker 2: And uh if you have uh permission, uh A permission plugin, whatever it is, the permission plugin can say, hey, for this actions, for this list action, I'm also going to uh register some permission checks. And I will delegate permission to to that method or this method. And this action tank is a data class. In Django Admin D, a lot of the things that were just strings in Django admin are can still be strings, but they often can also be uh some sort of data class
Speaker 2: So uh that 's uh let's try to do this quite interactively. So does anyone have any question about this main architecture for the for whole things work? No, everything clear? Okay. Um so the principles here of the of the core of Django Admin Do is that it's built upon the uh Django generic classes, generic generic class-based views, it doesn't have to. Um there are a couple methods that need to be present, but it can use any class-based view uh
Speaker 2: to to do anything. So the on the the the the one thing you need you need a dispatch a dispatch method because that's the standard entry point for class base use in in Django. Um it is probably much better if you have a getContextData method because Django Admin Do plugs into that, it has its own mixing that will add things to the context, like if uh the search the search plugin that I mentioned earlier, it registers a search widget So the search widget is going to be populated into the context of the view thanks to the getContextData method. The search mixing
Speaker 2: will add that there. Um and that's that's that's about it. That's all you need. Um The permission check is uh injected also via the dispatch method. So anything that has those two methods can technically be used as a base class for an action in Django admin 2. Um by default the core plugin, so everything is a plugin in Django Admin 2, even It's on code, so the the core of Django and Mindo is a plugin. And the core plugin
Speaker 2: uh defines sensible defaults for CRUD uh using um Django 's provided code. Uh mostly uh there's just one thing that uh Django generic views don't provide is the bulk delete operation, which is Only the the the only true uh view that I had to create outside of Score Django for this to work. Um clear for everyone? Yeah, just a question here and recognize.
Speaker 1: So if uh when you say that the car is the is a plugin in itself, should we think that we We can replace the core if we need or maybe okay, that's cool.
Speaker 2: Yes, so um the core plugin. So there when I say core I I suppose I should make the the distinction So there is the the glue mechanics that I'm going to say that bring things together. That's not a plug-in because that that is not something that is pluggable. But uh the the base things that I showed uh yesterday on the screen, so the uh regular admin stuff with the list view, the edit view, delete That is a plugin. That is the core plugin. It can be deactivated. And you can remove the core plugin and put your own stuff in there if you want. Uh if you do, uh you
Speaker 2: should probably still look at the core plugin in s in order to plug back in uh the permission check. For example. But you can just import that from your own plugin, define your own plugin, import the permission check, import the context. uh thing, get context data, and write your own mix in, declare your own actions that are based on something that is not Django. Basically anything that you have, even if you have function based views To turn a function-based view into a class-based view that is compatible, all you would need to do is to
Speaker 2: uh move everything from uh what you have. into the dispatch method. Into a dispatch method. So you could declare class my class extend um view from the base uh Django base views, extend view, declare uh dispatch method and move everything from your function base view into that class base view view. Class based views don't have to be complicated. It can they can have one single method if you want. Um Yeah. Uh so
Speaker 2: yeah, so all those uh all those actions uh they're uh composable Uh meaning that during the main talk I talked about three types of action. I said that you had you could have uh actions that acts on uh on a model generically like list add that's actions that are on on a model. There are uh actions that are on one specific record like uh view, um, update, delete that targets one specific record Or there are actions that target a group of records, like uh
Speaker 2: bulk delete, for example. Um that's that's true, but that was a slight simplification. You can also you uh will be able to compose actions Um the most uh used action type is uh the view action type. Because all those things that I that I said here they they they act on one or multiple records or on a model, but they're all linked to views. Sometimes you want actions to do something else. It's not the majority of the cases, but sometimes you want an action to
Speaker 2: be uh a link or to be uh downloading uh a download of a file or you you Want uh your action to be popping up uh to be popping up uh a window. So for example, um If you have invo a list of invoices and you have uh a button next to the the invoice to market as paid. Well, maybe maybe you want a pop-up that will ask you for the date of the payment, which bank account it's been uh it's been paid on or that kind of thing. So probably 80% of the actions will be view actions, but you might have other types of actions.
Speaker 2: The actions, they don't uh do much by this by themselves. There are data classes with uh mandatory parameters. But uh there is usually no logic in actions. Uh if you really want to put some logic into actions, there is a way to bind action matters to view. But I would advise against doing that. Um So the good thing is that if you are using whether you you are using uh the Django generic views Or if you are removing the whole of the core plugin
Speaker 2: and adding different views, if you want to um Uh I I've been looking into uh yeah uh IOMI. Uh do you know Iomi? No, yes Yes, you do. Uh so IME is another is is is another uh tool that deals with uh list and and and and um and from views for Django. Uh if if you want to remove the core and add some completely other um view types The actions will work with that. There is usually no absolutely no logic in actions. Actions are just recipes that are being read by Django admin In order to build
Speaker 2: the the layers of your admin. And um one of the reasons that you are able to remove the core plugin and do without the core plugin is that uh CRUD is just that is just actions And in the regular Django admin and in a lot of applications like DRF and so on, list, read, edit, delete, those are have a special status. In Django Admin D they have no special status other than being the default. You can add or remove uh any of those actions.
Speaker 2: as you want and if you want to have an action duplicate or an action publish or uh any other type of action You can build your own default and say, hey, all my all my views instead of being CRUD, they're going to be CRUD plus publish plus duplicate. That is um and then you would use your own defaults as standards. Yeah, so that's I'm I'm repeating here. I I'm showing again the this uh architecture diagram. So we've been talking about the the generic views or any
Speaker 2: kind of class-based view that can that is used as uh as the base layer. On top of that, we have two things that uh I've alluded to. We have the uh UI layers. So there are A few things that come in in the UI layer, there's uh breadcrumbs they are given for they are created automatically for you. Um you have the side panels, so this is where one um by default any plugin that's going to to Register a widget that is going to appear in the side panel. So if you remember yesterday there was the search and filter, they were on the right side of the screen.
Speaker 2: That is the side panel. And by default, any application Any um yeah, any application that's going to register a widget, that is going to go to the side panel. There are other uh elements that come into the design. There is the layout. We also saw a bit of that yesterday. Uh so the layout is uh for from views uh only and uh it is compatible with Django um uh Django's forms. Um but the Django Fromset plugin also makes it compatible with uh formset forms So if you are ju you if you want to use Django From Set
Speaker 2: and I would strongly uh say that yeah you should probably use Django From Set. If you use Django FromSet, that layout object is also used. Now layouts, a layout is also in itself just a data class. instead of just listing the field names like you would do in Django when you uh declare a field set for the admin or when you just declare the list of your fields you just put strings there You can do the same if you want to in Django Admin Do, but you can also use field objects. field set object, column object, rows object. So that you are able to uh have a little bit more control
Speaker 2: on your form. It's not display logic Per se that's going to be handled by the template, but that's um I'm going to say grouping logic. You want uh you want to group your fields into a field set, you want uh the form to be displayed uh with uh things in the same row and that kind of So you're you you have this layout object as part of the as the UI layer. In list view you also have uh the column uh and especially the column address uh object So yesterday when I showed the list the code for the admin in list display the first version once again you could list all the fields that you wanted to to list in the admin
Speaker 2: list view with list display but instead of you uh using just this display you can use a column object and then you can say oh um this is the field category name But the label should be just category and uh this should be sortable and this uh should be filterable. Or instead of just filterable true, you can just uh add a filter object and a complex object. So this is a recurring theme in in Django Admin Do. It's Taking the things that were um just strings in Django and giving in in the regular Django admin and giving them more power, giving you the ability to define more information.
Speaker 2: Um on top of uh at the same level I I suppose then the UI layer we also have the permission layer. So by default on the default model admin, the permissions that are going to be used are the Django permissions. But if you're familiar with uh things like uh Django Rest framework, uh you know that there are multiple types of permissions that uh are not easy to do with uh regular Django permission. Like for example, anonymous read-only access. DRF has that permission. We also have that permission In uh
Speaker 2: in Django admin duo, and also the permissions are uh composable. So you can say anonymous read access or Django permission. Or you can say anonymous reside access or logged in or logged in. So this means that you would need to be logged in to have write access, but everybody has uh read access. Yeah, and once again this all is made possible thanks to the the plug-y system. Um DJP uh DJP is just a thin layer on top of Pluggy. It's been shown by Simon Wilson in two years ago, I think, at DjangoCon
Speaker 2: US. Um and Pluggy is part of the of the Py test suit. So this is not something that is going away. This is something something that has been maintained for years and as long as people are using PyTest, uh it is expected that Pluggy will will be around as well. So yeah, this is uh the action system. Uh back to what we were saying, uh bulk for multiple. records uh records for single records and general for model level um model level actions this says model level but that's not
Speaker 2: exactly true. So to stay compatible with Django stock admin, we're dealing with a class that's called model admin But uh in Django admin 2 you can have um you can define a model admin and set model equals none. Which sounds weird for a model admin. It's because it's not really a model admin, it's just an admin. But we're using the the name model admin to stay compatible with Django admin too. So the general level uh action uh they can be anything they don't really need to be linked to a model so it can be a template view where you
Speaker 2: Just display a pretty picture. Or it can be a dashboard view where you have twenty-five widgets saying, Hey, we have made twenty-five sales this this week and uh we have uh Earned that much money and we have 20 27,000 users logged in and that kind of stuff. So the general uh action type is pretty versatile Um yeah, I'm going to to take a small break. Does anybody have any question now? Yes. model that is not managed for
Speaker 3: can it be used for a model that is not managed
Speaker 2: yes it can be used for a model that's not managed There is absolutely no no restriction there. By not being managed, of course, you take the risk that your model definition is Django in the database drift. But other than that, uh there is there is no restriction there. Okay So all this time I've been talking about plugins. How do those uh those plug-in work? Well the A plugin architecture is basically a series of uh life I'm going to say life cycle hooks
Speaker 2: that you can hook into to and so you can register things uh with the plugin system and they will get picked up whenever uh it's needed. So here we uh to to get started we have uh the top level uh hooks I'm going to say So we can uh the first one is register actions. This means that any plugin can register any new type of action. So I was saying CRUD is the default, so create, list, update, delete, bulk, delete. Those are pre-registered for you by the core plugin. But if you want to register a duplicate action, you can
Speaker 2: the plugin system can you can use a plugin system to register a duplicate action. If um there's also a dashboard action that renders the generic uh Django admin style dashboard that lists all your application and all your models You can register your own dashboard action, for example. Um There is the next one is uh get default action. So the star here uh stands for general record and bulk like the three action types that we uh that we saw uh before. Um this um
Speaker 2: lets you register uh the default actions that you want. So So if uh for example when you are in the admin, if you just click on the on the model name, you will get the list view of the model name. That is the default action uh that this is the default for that uh um general action for a model. It instead of that there is another general action for each model that is the create or add. So you could define instead of having the list as default action, you could very well define add as the default action. In this case Might not make a lot of sense to you every time you click on the model name
Speaker 2: adding a new thing, but if you have an action get that maybe gives you a summary of what is happening uh once again a summary of your s if you're looking at all your invoices, maybe the default action would be um something that would show you only the uh the invoice that's are yet to be paid or something like that or the invoices that are later So you can change the default um behavior for each type of action. Then we have the get action view mixing and we will see example of all those codes uh in the second part. part of the of the talk. So uh well of the workshop I guess. Um
Speaker 2: so the get action view mixing will um is this where you plug into If you want to register a mix a mixing for a certain type of action. So let's go back and look at the search plugin. The search plugin adds a widget, it adds a query set uh changer, but search plugin doesn't make sense on an edit view. The search only uh acts on the list view. So, or rather on the list action. So this is where you can register different types of mixing for different types of actions.
Speaker 2: Um So uh if you have uh the fromset Django FromSet uh plugin, this is only for uh edit views, edit actions or create actions. It doesn't make sense to have Django form set on a delete action, for example, because there is no form on the delete action. That is for the mixing. Right next to it, you have the base uh the view-based class. So each View is built upon a base view on which you add mix in so you can overwrite which uh base view is going to be used.
Speaker 2: So once again for the edit view, the core plugin uses the generic Django uh edit view, but If you install the Django Fromzet plugin, then it will use uh Django's from FromZ edit view instead as a basic class. And all the the other mixing will still register on top of that base class. Um Yeah, and so the last the last two so attributes uh when you define uh model admin in regular Django you are going to set attributes on There like maybe uh the page size for the pagination
Speaker 2: or the fields or the list display or that kind of thing. So this uh this is A list of the attributes that should be plugged out of the of the action and injected by default into the view. So that's the the default that you are going to give Um uh plug. sorry it's plugged out from the model admin to the view. So if you're on model admin you define that you you have a pagination page size of 20 The factory will take that attribute from the model admin and use it in the factory to add that uh to the view. This is how it takes, for example, the model in the Django generic views, you have to specify a model.
Speaker 2: When you create a when you declare model admin. You also create a model. So the factory is going to go see, check those parameters, and inject their values automatically in the created views. Um any question? This this part is it might be a bit a bit more uh complicated, no? Okay. The last one is attribute binding. This is the same thing, but uh for if you want to move methods. This is probably a bit a bit hacky, I would
Speaker 2: uh advise against it, but if you really need it need it, it's there So there were the the first ones were the the top level hooks I'm going to say. You do have uh a few other hooks. You have the one that you have one to modify the query set Used by the search plugin, for example, when you type something in the search widget, this is going to be uh taken in to modify the query set. Um add context data, this is also used um again uh
Speaker 2: by anything that would need to add some anything to the context. So if you're adding widgets uh if your plugin adds widgets uh to the sidebar It probably needs some data to display in that widget. So this is the hook for a plugin to register that it wants to add uh things to the context data. Um same for the the next two. Those are all UI elements that any plugin can register that they want to modify. So for example for the column headers uh the sort plugin the sort plugin wants to add icons next to the the titles so when you have the the
Speaker 2: the list of records you have your column titles with the field names and you want to have those little uh arrow uh things that that show up. So this is the column headers and any plugin can add things to the to the column headers. So for searching is the uh is the arrows, but maybe you want a mix in that will uh that will uh add help text. You know, have a little uh question mark next to a field name so that people can over over that and have an explanation of exactly what the field is or something like that. Same for the sidebar widget. We saw the the widget for filtering, searching. You can add as many things uh in there.
Speaker 2: I know that uh there is uh somebody working on uh Django reversion. And that is used to version your changes to the to to you make to the models in the admin. And so they're working on a on a widget. where you can uh see the latest change that have been made to the model and compare between uh two different versions of the same records. Um any question on those? Nope. Okay. Um and then we have other meta uh hoax, I'm going to say. Um
Speaker 2: one thing that Trying to protect yourself against um doing something uh wrong. Uh each plugin can declare some uh features. So for example, uh still the search plugin it declares a search feature And it also declares uh the attribute that's uh are linked to it. So for example, if I have If I have not installed the search plugin and I declare a search field on my Django admin , on my model admin, Django Admin is going to say, hey, you're trying to use the search search feature but you don't have any plugin
Speaker 2: that uh provides the search feature and is going to stop there when you're trying to launch your front server or in production trying to uh launch uh to the the whiskey uh app is going to stop there and tell you hey you have not installed the plugin this is not gonna going to work I'm stopping there. So this is uh stopping early because it could be easy to get confused, forget to install one plugin in production or something like that. So this this is a a safety uh safety feature feature um that will prevent you to do stupid things. I have implemented that because I have done many stupid things. So So
Speaker 2: um the next one is the getRecord apps. Um so I've been talking about these plugins that are um Django filter plugin, the Django Fromset plugin. I have not changed anything to the original libraries. I've just created a plugin that uh has the right settings to use those libraries in Django admin duo. This means that I also need to install those libraries. So and not only do I need to install them, but usually I need them in my installed app. So this feature lets you automatically uh get all the requirements for your plugin into installed apps. Um
Speaker 2: this is opt-in. If you do not want to use that, you can still manually go curate your installed apps. But if you want to inside installed apps you can just uh have one call to Django Admin du and it will curate everything that is that you need to add uh there and if you uninstall a plugin it will also take care of that for you. This might make more sense when I get to to the example, maybe. I see some people doing funny faces. Um and the last one is the getTest methods. So Django admin dir also comes with
Speaker 2: um basic smoke test functionality and so it will try to see all the actions that are available that you have registered For model admins, and it will just try to call them and see if it returns a 200. Uh yeah and but then you uh you can um Register more test methods. So for example for the edit view, it's nice that it returns a 200 and shows me a form when I try to edit a record. I also want to see that when I submit data and click save. That it also works. So you can um add to that test framework. You can add your own test to that test framework.
Speaker 2: And if you have a search plugin, you can if you have the search plugin you can add a searching functionality to the test. And so when you run all the tests, the smoke test is going to to try to do a search wherever the search action is registered and is running. Yeah. So these are going to be example. Uh do we have any questions before going into the examples. Okay, so I've been talking about all this all these hooks. What are these hooks
Speaker 2: exactly doing? link. Um most of the hooks they return either a dictionary or a list. depending on what you're trying to do. Um the dictionary uh here um The the view attributes here uh is giving a list of the uh attributes to go and plug from the model admin and plug into your uh the the view that is created by the factory. So here for example we have paginate by That's the attribute that's go you are going to declare on your model admin.
Speaker 2: So if you have a uh model admin for users You are going to declare your model admin model equal equals user and then you are going to have this paginate by 20. um and when the view factory is going to build the view it needs to go get that uh thing and it needs to uh put it on the Put it on the on the created view, on the on the generated view. So the label, paginate by, is the attribute that's going to be set on the view. And on the right side is how to get it. So you see that the
Speaker 2: hook is getting the action as a parameter. So the hook is going to get the action, let's say, uh list action. And um It's going to from the action is going to be able to access the model admin that is linked to the action and uh get the paginate by uh So this is this is a simple mapping. So from action. model admin. paginate by, that's going to populate the paginate by attribute on the list view. Um same for ordering. Um that's that's So it's going to work.
Speaker 2: And then we have the the next one, the next hook is to get the view mix-ins. So this uh was um what I was saying that any uh actions can um you can Any plugin can add mixings to actions type. So once again it is getting an action. Um that you may or may not use. So here this is a static mapping. It's not using the action, uh, but it it's going to give a dictionary of for everything that is Some action, I want to apply this custom mixing on it. Um but sometimes you want to do things more complicated. So for example I want to say, oh, uh
Speaker 2: I want to still access action. model admin and s and check, for example, hey, uh Does my model has a owner field? Or um does it has does it have that kind of field? Any other checks of features. So for example, if it has uh an owner field, I can add uh something specific like maybe a permission mixing that says hey only the owner is able to uh update this or that. Um so by having access to the action you also get access to the model admin. This is called every time for Uh whenever a view is generated, it's going to call that and check. So you can do runtime checks before applying a mix
Speaker 2: in to a view. Is that clear for everybody? Okay. So the next uh topic is going to be the the data classes. So I mentioned this earlier. So here we have we're going to start with the the the column So column is used for the list views. And this is used to give more information about a column.
Speaker 2: So instead of just using the string name to enlist the enlist display, instead of just using the string name, you can give much more attributes Um the you can change the label. You can add CSS classes If you really want to, uh you should probably have your CSS take care of things, but for example, uh sometimes uh people want this one column to appear in bold or something like that. That's not going to be easy to uh to add in your regular CSS. So you can say you can add CSS classes to to the columns uh here directly in the admin.
Speaker 2: You can change the labels, but you can also do things like um defining filters So here we are in you can just say filter equals true, but for example for the columns I want to filter, I want a range So I can look uh use these uh these settings uh lookup expression. Um the only plugin that provides filtering for now is uh Django filters So that's information that's going to be passed to Django filters. So lookup expression is something that is known by Django filters and that is used by Django filters. Same thing for ordering.
Speaker 2: Um you can simply have order equals true. By default everything is false. I know in the stock uh Django admin by default everything is true. If it's um if it's an issue I will revert to the stock Django admin uh behavior, but for me it just makes more sense that by default sorting is turned off on all columns and only activate it on the ones that you want. So this can be just a a Boolean or it can be an order object. Same thing giving you the possibility to customize things uh done further like uh changing the the label of the ordering
Speaker 2: menu over uh on the little arrows There is uh us usually most people skip over it, they click before the pop-up appears, but there's usually a pop-up that's essa or during ascending uh or during descending. You can customize the the label, uh the main label, you can uh customize uh things you can uh provide um Other information like uh sorting, ascending, and descending. If you're sorting on the column category which is a foreign key. Simple simply uh sorting ascending and descending is probably not going to do what you expect because it's going to sort on
Speaker 2: Category ID which is an integer and what you expect would probably be sorting on column name, on category name and not its ID. So yeah, all these data classes um or meant to uh help you be more granular and be able to define more things directly easily in the model admin Um no questions about that? Okay. Let's move to the next one. And I'm getting out of running out of water.
Speaker 2: Um UI components. Once again, data class is to let you do uh go into more details and um do do more things. So we I've been talking about the the sidebar widgets. So any uh plugin can register a sidebar widget. This is how you define a sidebar widget. A sidebar widget comes with a template, uh which is a partial template that this b the widget is going to be uh displayed. Um it has uh display conditions, so you want uh you A lot of widgets you will not want to display them if some condition is not met first.
Speaker 2: Uh other widgets you want you will want to have them uh shown uh all the time. Uh but For example, let's say that you want a widget to be able to uh automatically create a batch payment. from your uh WISE uh account. Uh I don't know if you've ever generated those batch files that you can directly send to WISE. But you want only want this to be able To be enabled when there is at least 10 payments to be made or something like that. So there's this this condition here that uh takes a callable You can use lambda uh directly if you don't want to
Speaker 2: to point to something else, but you can just pass any callable to that uh to uh Uh see whether the the widget is going to be displayed or not. There is also um So You will probably want all your widgets to always appear in the same order, so they need to be sortable by something. And uh not only At least I want them to as far as I'm concerned I want at least that they appear always in the same order so not to confuse the user
Speaker 2: but probably also I want some to appear before others. So this is an integer, it's completely arbitrary. you put everything that you want there. I've been using um multiples of tens for the default um for the widgets that I publish with the with the general uh plugins uh because first language I learned is basic so 10 print hello 20 go to So yeah, the multiples of 10 sounded like a good idea, but of course you can use whatever you want and you can override those. Um the column header icon, this is another one.
Speaker 2: Um This here is the uh example for sorting. So uh same as with the other with the widget you have a template in that template you It's it's just a Django template. And uh you have an URL. What do you want to uh link to when that is clicked It could be none. Here is for sorting, so it 's got a callable that will get the URL. You can pass in any collect callable, you can pass in a function. you can pa you can pass in a lambda. Um and also um same as
Speaker 2: With the widget you have order, so if you have multiple icons like sorting and um help text, well you they will always appear in in the same order and you can define which one Um more data classes. Uh This is the media data classes. So each plugin uh can have assets that are linked to it that will uh usually be CSS and uh JavaScript.
Speaker 2: And you have uh these data classes that let you uh give out basically whatever you would say uh if you were adding this directly uh in HTML. So um JavaScript is uh module blocking uh deferred async I don't remember all of them but they are in the documentation. Um and uh CSS asset as media. So any plugin can uh once again register for any action or multiple actions can register some assets. So if you have uh fancy JavaScript on your edit view to manage things in the form.
Speaker 2: The plugin can register that and all your forms will have that JavaScript that is loaded, at least all the all the ones that are using the that plugin Uh same for the CSS, uh one type of plugin is uh team plugin. Um So if you are doing a team plugin, you are likely going to be uh registering some CSS, but not only. If you want to have a plugin with um What's it called? Select2? JQuery Select2? Yeah. If you want uh plugin with SLEC2, you're going to need some CSS and some JavaScript.
Speaker 2: So um every plugin can uh register some assets like that. Um Yeah, let's uh column in filter example. I already oh yeah. So yeah. Um I think it would be good to take a five minute break for everybody, at least for me, because I've been talking for forty-five minutes and uh I need a a small break. So let's take a five minute break. I think this is the same time as the coffee break outside, is that right? Yeah. So Yes, but I'm only giving you five minutes break.
Speaker 2: They have 30 minutes. So yeah. Um Um if everybody's back well everybody who intends to come back is back. I will continue. So I will do a short uh thing about installation. So that's all in the documentation. documentation is on read the docs it is quite extensive uh since it's extensive it's possible that tourist things here and there that might be slightly out of date. If you find any that's uh out of date don't be afraid to open
Speaker 2: to open But yeah, the the documentation I've tried to have some very extensive uh documentation. So the URL is uh Django admin Django dash admin dash the at free the dot free. docs. Um and yeah. So when you are installing Django admin duo There are multiple ways that you can do that. Of course it's all pip install, but you can just pip install the Django admin du package that will that this this will give you uh the glue layer and this will give you the core plugins. Uh or should I say the core plugins?
Speaker 2: There are uh four core plugins that uh there so there is the default team there is uh the plugin with crud uh search and permissions There this is all part of the basic Django admin package No, you can also uh install Django admil admin the uh square bracket full. This was this will also install other plugins This will install Django filters, this will install Django FromSet, and this will also install Django Classy
Speaker 2: Docs. which is the documentation plugin that uh I showed uh yesterday when I showed the C C C C Bv style documentation for your own code, for your own admin. Uh this this plugin uh is uh Django Classy Duck plugin. Or if you want anything between those two extremes, there's also you can all You can also just uh install with square bracket from sets or square bracket filters. Uh one important Thing that needs to be said about the installation, and that's the only complicated part about the installation process is that when you add
Speaker 2: things to your installed app you can um either install you can either list all the things that you actually want there so you can uh list individual plugins Or if you want, the last one there is store Django admin apps. This is the uh automated plugin part if you put that that one there the store django uh dj admin apps that is is going to collect all the apps That need to go into installed apps as they've been defined by the plugin themselves. So I
Speaker 2: would say this is the easy route and it's probably the safest uh in some way. That means that if uh when you upgrade a plugin uh has a new dependency, for example, and needs something new in installed app, that's going to be automated, that's not going to crash your application No, on the other hand, having uh Pep installing something that modifies your installed app. might not be desirable. For example, if there's a supply chain attack and somebody gets hacked and a plugin that you're using gets hacked, you might not want to have that automatically in your install. apps. So there's two ways to look at it.
Speaker 2: I know that for now this using it like this makes my my life much easier. because then I don't have to uh look into uh my installed apps or my settings and I can just go and use that Um yeah, so if you this It's hard to scroll. So yeah, so uh one more thing that you uh want to do is go into your Euros. py of course and here 's you can see you can and as I was saying you can have the regular admin and uh Django admin living side by side if you want to. If you don't want to you can remove the old admin
Speaker 2: If you don't have the regular admin, I would uh strongly advise for uh having Django Contript OT URLs. uh installed that's going to provide the login and logout views. That's um so Stock Django provides the login logout views, but it does not provide any template for it. Django admin du provides templates for those views. But you still have to add them and you might not want to add them if you if you'd rather if you're using the regular Django admin, you might you might want to use the the admins logging page instead. But yes, if you are not using the admin, make sure you have a login
Speaker 2: page installed. Um yes So um this is the repo. I was thinking that for this uh since it's going to be completed obligated to write to actually write some code. I thought that we should look into some existing plugins and how they have been created. Yes. Oh, come on.
Speaker 2: Yes. Okay, so this uh going to scroll Okay, so this here uh is um the little plugin I showed yesterday during the demo is uh DJ Anmin REST2 that uh builds upon uh DJ REST2, which is a really tiny library that uses stock Django to create a REST API. Um so how how does it work? How can I make this into a plugin to use with um Django Admin dub? Biggest part of the code basically
Speaker 2: is going to be into this dj admin underscore underscore hooks. py. Django admin2 is going to look automatically for that file. and it's going to import that file automatically if it exists. It's going to run. So if you have any code that runs in there, it's going to To run like any other import once once it gets imported. If there is uh something at the root level it's it will run, but this also um contains all the hooks that we have been seeing before. We have, I think we've talked about 16 different hooks, which is a lot of hooks. But not all applications need that many hooks.
Speaker 2: Sure, um this plugin uses I think yeah uh five uh total plus uh plus thing. So we're going to go back again through uh all these to see exactly what they are doing. So the first one record apps. So this plugin depends on an uh um This plugin uh depends on having it into the installed app itself into the installed app. It doesn't really need anything else in the installed apps. You only need uh uh in the installed app you you only need uh certain stuff usually if you have templates if you have static assets or if you want to
Speaker 2: uh have uh things that are loaded automatically like in case of a plugin. So this one uh only wants to add DJ admin REST2 into your installed apps A lot of plugins will be like that. They will only want to add themselves to install the apps. Now here this is a list, a simple list But uh if you want to uh if you need to have something more complicated, there are transformers also available. So what are transformers? They're uh before, after, uh, and replace. for example. So um often when you are installing a uh an application, a third
Speaker 2: party application uh the application the the installation instructions will say okay you need to have blah blah blah into your installed apps but it needs to come before this setting or it needs to come before this other installed app. So uh there is a transformer you can use uh before that's provided by uh DJP You can use before and say before um before search filters because I want to install the filters plugin before the search one. So you can you can have things uh I'm not going to say very complicated, but you you do have some fine grain control. And sometimes you also want to use a replace
Speaker 2: uh if you want to replace something from another plugin. Um Let's say for example that there's a Django application that depends on either this package A or package B. and the default plugin installed package A , you can have a plugin for package B that says, hey, remove package A from installed app and put package B instead. Everything that's uh that's is going to go into install that app Um you don't have to trust, you can inspect uh from the comment
Speaker 2: line. There are management comments that will uh there's a management comment that lets you uh list all uh the output of uh this uh dj admin apps function and tells you which mix in for uh which plugin provided what So you have visibility on what the plugins are doing. Inst pip installing something and making change to your site is powerful, but it You you uh if you're starting to peep install many things, you want to keep a good uh overview of what plugin is doing what. So there is a management comment that will give you the output of that uh uh of that uh line and also
Speaker 2: tells you uh which plugin provides what Since I'm talking about management commons, uh there's uh the same thing uh for the views. So every view that is generated uh by the comm uh by uh the factory can be uh inspected in different So there is a comment line uh management comment where we can say I want to inspect list view for uh the list act the view generated by for the list action For the model user. And this will give you an output of every mix in that is installed, what plugin provided the mix
Speaker 2: mix in what uh base class it is using. It will try to give you uh as much uh concise insight into What helps you build the final result of the of the views that are getting rendered? Yesterday I also showed the CCBV style documentation that's also a management command that can generate those statically. Why statically and not dynamically is because generally when you want to look at the document Is because your application is not working. If your application is not working and the documentation is served by your application, you're a bit screwed. So that there is a management common to generate it statically and it can generate
Speaker 2: In three different formats, uh directly in HTML. Uh in Markdown, compatible with MK Docs. So this is used uh on the documentation websites. Uh so on the uh Django uh Django and me the uh documentation website it is uh generated dynamically by this command. It is a different format than what I showed yesterday, slightly different because it is MK Docs. But this is the same information that is directly compatible with MKDocs Uh and here again you have uh
Speaker 2: as much information as I thought might come in handy at some point. So things like which base class has been used by the factory, which mixings have been added, which uh by which plugin has the mix has the mixing being added by which hook is it being added uh and then if you if you scroll you can uh see all the attributes uh same thing Uh yeah, it's yes, it's it's showing there on the right. So same thing for the attributes, it tells you which mix in has provided that attribute, which plugin has provided that attribute to the class thanks to the uh hook we saw uh before the break
Speaker 2: that was uh the the attribute hook So it will tell you, hey, this this plugin has contributed this property, this attribute to uh the final generated view. And if you scroll, keep scrolling down, at some point you can see the code. Yeah Here. So yeah, you can click and have the the code of everything that is provided like in CCBV. So there is it's not it's not really magic, but there is a lot of things that are provided by plug-in. and you have full view and full control
Speaker 2: over that you should not find yourself in a blind spot wondering hey how come uh my this attribute change on my view. Well you can go in the documentation and see oh this plugin changed that attribute on my view So back to the plugin definition. So first hook is there to add to install dApps. Um This one, the meta hook that provides feature. Uh this plugin provides REST API and CRUD.
Speaker 2: You can name your features like you want. Uh CRUD is something that is uh known by default by the by Django Admin Do, but REST API is not When I made this plugin I wanted to I didn't want to break things. I was hoping it was not breaking, but uh I wanted to to see if I could push it. REST API is not something that is known that is a known feature by default for uh Django uh and mindeu, but this Plugin says it's provided and if another plugin says, Hey, I require a CRUD API then this plugins provided if
Speaker 2: this plugin is not installed or maybe uh if somebody writes uh DRF plugin or or something like that. It can also provide uh distressed API, I suppose at some point I should Start keeping a list on a website of uh when other people start publishing plugins of which plugin provides what. Right now it's not yet necessary Um so um yeah, then we we have the the actions, this uh This by default provides two actions , one general action and one record action.
Speaker 2: The general action is list create view Uh well list create action that will result in the list create view. The other the record action is the um Update delete action, which is the details view uh equivalent of the rest uh API. So it's a single uh view that is going to be created, a single cast based views that will have three different methods to handle get to handle and and all uh put and handle delete uh methods and same for the general action this is uh one single view that's going to be created one action
Speaker 2: one view one class based view with one method that handles get and one method that handles post. Um So uh for these for those two i new actions that the plugin registered. It needs to provide some information. So for both of those, it's going to provide the best view class for each of those And uh this um this hook that provides the base view class uh returns the dictionary. So uh
Speaker 2: the on the left the action on the right uh the view the base view so it's it's mapping this i these two actions that we just registered and is providing the baseless view for them well the base the base view for them I'm sorry. And if any plugin wants to add to that and wants to apply mixing to these actions, well then it can say hey for restless create action uh I want to add this mixing. If you want to add a mix whoops if you want to add a mix into all actions, for example, you can just say that
Speaker 2: You can use action as a key in your key value peripheromic sense. So say A for each action of type action which is the best class for every every action type. So for every action I'm adding a mixing. For example, permission mixing makes sense to be added to all actions. Like we were saying earlier, search mixings don't make sense to be added to edit. Um and um last things Um actually the the hook to get the attributes here is going to
Speaker 2: set an attribute that's actually a method is going to set an attribute. on the underviews uh because uh DJ Res two uh requires uh the list of serializable fields it uses this method get serializer field so we need to provide that so how is going how is it going to get that is going to use uh the fields that here I'm getting from the action. You could also get that directly from the uh from the model admin. I am not doing this in this case because I've been using this in conjunction with the regular thread views. So just adding
Speaker 2: um rest and you might not want to have the same fields for VEST that you have for the regular list view or for the regular edit So it's a choice to have the fields defined on the action, but you could have you could as we saw earlier you you from the action you have access to the model admin, you can go get anything you want on the model admin Um and uh this is everything I'm going to have time to uh Go into details. This is uh I'm just going to leave that there. This is the the test methods that I was uh talking about earlier So the testing uh framework that's going to be testing uh smoke testing every type of action, here I am adding
Speaker 2: Test uh functions that will test other stuff than just uh the basics provided. So um not only is Django admin the pluggable But the simple test harness that comes with Django Anminter is also pluggable, so your plugin can register tests to test themselves. Yes, uh if you want to know more, uh I will be there uh tomorrow and the day after that for the sprints. Um You can also open issues on the repo, it's on Codeburg, the links uh are on uh the slides of the presentation.
Speaker 2: Um And yes, actu come come talk to me afterwards uh and all that. Uh yeah. Thank you. We have
Speaker 3: the aligning cups, so there are
April 15 - 17, 2026
Athens, Greece
Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026
Published October 26, 2026