Registering Django Models with Wagtails ModelAdmin

  Рет қаралды 13,006

Coding For Everybody

Coding For Everybody

Күн бұрын

In the land of Django and Wagtail, sometimes you need custom Django Models but Wagtail doesn't let you edit these models by default. And personally, I don't believe in giving a client 2 admin dashboards to operate in. So let's add a custom Django Model to our Wagtail website using a Wagtail ModelAdmin.
Tutorial: learnwagtail.com/tutorials/ho...
GitHub Commit: github.com/CodingForEverybody...
Gist: gist.github.com/KalobTaulien/...
Learn Wagtail from scratch with the official Wagtail for Beginners Course
learnwagtail.com/wagtail-for-...
Used in this video: Wagtail 2.4, Python 3.7, Django 2.1.5 #Wagtail #Django #Python

Пікірлер: 29
@eriklagergren7124
@eriklagergren7124 Жыл бұрын
This helped me on my internship. Thanks Calob :D :D
@stepan_moc
@stepan_moc 5 жыл бұрын
Tutorial about menus would be great :)
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Menu video is coming! Should be here in about a week (hopefully!)
@voronov_ad
@voronov_ad 5 жыл бұрын
Nice lesson! Now we have a challenge to copy all Djang-admin interface to the wagtail-admin)
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
It's actually SUPER easy. The only one I think you'll find a bit strange is the default User model and handling the passwords. But in Wagtail, Users have Wagtail User Profiles (different model with a 1-to-1 relationship), so you can register all the users with that Model. Or extend the User model and register your customer model. It works REALLY well in Wagtail, overall.
@voronov_ad
@voronov_ad 5 жыл бұрын
@@CodingForEverybody Yeah, that's what I did) Thank you!
@diogosilva3152
@diogosilva3152 3 жыл бұрын
How can I register an API endpoint for creating the subscribers from frontend, and also list them in the wagtail dashboard?
@mounamani3001
@mounamani3001 4 жыл бұрын
Thanks for the great video, but i get this issue 'RequestContext' object has no attribute 'items' when i go to /admin/subscribers/subscribers/ , i didn't get why ? :)
@mattmoloney1
@mattmoloney1 3 жыл бұрын
at the end of the video you mention using a form on a different page to add the subscriber. Could you please explain how...been trying for a while now. Thanks in advance!
@jellejanwillie
@jellejanwillie 4 жыл бұрын
How do you deal with check constraints within wagtail-admin. Is there a way to warn the user of a violated check constraint? Thanks!
@juanmonster6232
@juanmonster6232 Жыл бұрын
I love you bro.......that is all I can say
@lengo7167
@lengo7167 2 жыл бұрын
Can you add checkboxes next to them?
@drew_scottsdale
@drew_scottsdale 3 жыл бұрын
What if we wanted to do this but with a class we created that inherited from the page model. class restaurants(page):. Most examples I see are when a regular django model was used.
@ktee55
@ktee55 3 жыл бұрын
Is there a way to send emails to those subscribers all at once with Wagtail way?
@keretlen
@keretlen 2 ай бұрын
at wagtail 6 the wagtail-modeladmin needs to be installed separately
@pysandeep
@pysandeep 3 жыл бұрын
How to add custom custom action button
@jaradfisher5256
@jaradfisher5256 5 жыл бұрын
Fantastic.. Thanks for this.. Would one register with Django admin also?
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
You could if you wanted to, and it'll work perfectly fine. For most cases I find you don't need to though. I like one admin instead of two. There are some cases where you might want to manage data more privately, like Users, so I typically keep those in the Django Admin. But it's entirely up to you!
@mindeyi
@mindeyi 4 жыл бұрын
Wagtail admin is so good, that I would like to use it as primary user interface for all users, to avoid having to create separate UI. I wonder, how can we give all users access to the admin, and manage permissions about what they can do in the admin? And then, ideally, having the admin at the top route.
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
This is what I do. It's RARE I ever need access to the Django Admin these days. You can set permissions on models when creating a new Group in your settings!
@aakashbhaikatti2823
@aakashbhaikatti2823 4 жыл бұрын
IntegrityError at /admin/blog/sample/create/ FOREIGN KEY constraint failed Can u please help me with this error.
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
You'll need to provide a lot more detail than this. Feel free to join us on slack at wagtail.io/slack - that's a better place to post this question along with your traceback and maybe some of your code.
@compusaveit
@compusaveit 5 жыл бұрын
Excellent videos, please correct , wrong spelling
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Where did you catch this typo?
@mindeyi
@mindeyi 4 жыл бұрын
A real situation. I have a page, that needs to have many parents. In Django, I'd simply do: class Topic(models.Model): parents = models.ManyToManyField( 'self', blank=True, symmetrical=False, related_name='children') I wonder, how can I override the behavior of the parent relationship, to allow multiple parents...
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
For Page's you likely wouldn't. Wagtail uses a tree for creating page hierarchy. So you'd have to create copies of the page. Instead what we'd do is create a Snippet (or an Orderable if you need more than one selection option). You can then customize your get_context() method and query your database using Djangos ORM for the data you're looking for.
@ShaffleOne
@ShaffleOne 4 жыл бұрын
10:20 Add SUSBCRIBER xD
@Pmarmagne
@Pmarmagne 4 жыл бұрын
Me trying to type along: "Susriber", "Subscsiber", "Subcriber", "Subsicirber"
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
That was me trying to write Subscriber during recording, too haha
Wagtail CMS: Registering Snippets using Django Models
13:35
Coding For Everybody
Рет қаралды 10 М.
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 32 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 58 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 56 МЛН
Installing Django Debug Toolbar with Wagtail CMS
13:33
Coding For Everybody
Рет қаралды 17 М.
Django tutorial - How to improve your Django admin
18:20
Matt Freire
Рет қаралды 52 М.
Wagtail CMS: Adding Custom StreamField Logic
14:42
Coding For Everybody
Рет қаралды 6 М.
How to Add Routable Pages to your Wagtail CMS Website
24:27
Coding For Everybody
Рет қаралды 12 М.
Python Django - How to add custom fields to the User Model ?
26:10
JimShapedCoding
Рет қаралды 22 М.
Getting Started With Your First Home Page in Wagtail CMS
16:31
Coding For Everybody
Рет қаралды 65 М.
Adding User Registration/Login To Your Wagtail Website
23:03
Coding For Everybody
Рет қаралды 15 М.
Adding Global Site Settings to Your Wagtail CMS Website
16:43
Coding For Everybody
Рет қаралды 10 М.
39kgのガリガリが踊る絵文字ダンス/39kg boney emoji dance#dance #ダンス #にんげんっていいな
00:16
💀Skeleton Ninja🥷【にんげんっていいなチャンネル】
Рет қаралды 8 МЛН