Live data from Hacker News

Customize Django Admin Interface

appliku.com

11–20 of 33 posts

Re: Customize Django Admin Interface

#11
post #2

I'm sort of fascinated by the resilience of the Django admin. It's nearly 20 years old at this point and really hasn't changed too much since I first used it in 2007. I've always thought it was a good example of what having a strong designer early in your project life-cycle can do.

I am strongly considering django for the next side project. I am new to python but enjoy it’s low ceremony approach (you sort of forget what language you are using, it gets out of the way) and then django to have more bases covered including this admin. Then htmx to avoid JS, maybe Elm if it needs interactivity

so, my 2 cents (and it's something i've said before here):

every time i start a project with something other than django, i end up with django, but "homebrewed".

example: you start with flask. you need auth, so you add flask-login.

you need some database access, so you add SQLAlchemy (and its flask plugin). you also need some kind of admin page, so you add flask-admin.

when you are finished, you have a flask-django framework, but not as well integrated -- with django, you get ALL of those all of those out-of-the-box, everything is well oiled and well integrated.

so, yeah, imho django is an amazing backend framework that does its job perfectly, specially when you add some really good libraries (like django-rest-framework).

Re: Customize Django Admin Interface

#13

Earlier quoted context omitted.

I am strongly considering django for the next side project. I am new to python but enjoy it’s low ceremony approach (you sort of forget what language you are using, it gets out of the way) and then django to have more bases covered including this admin. Then htmx to avoid JS, maybe Elm if it needs interactivity

so, my 2 cents (and it's something i've said before here): every time i start a project with something other than django, i end up with django, but "homebrewed". example: you start with flask. you need auth, so you add flask-login. you need some database access, so you add SQLAlchemy (and its flask plugin). you also need some kind of admin page, so you add flask-admin. when you are finished, you have a flask-django f…

Same, I do a lot of starlette/sqlqlchemy/etc. and I often miss Django and it’s batteries included approach. Django has its warts but my god is it productive.

Re: Customize Django Admin Interface

#14
post #2

I'm sort of fascinated by the resilience of the Django admin. It's nearly 20 years old at this point and really hasn't changed too much since I first used it in 2007. I've always thought it was a good example of what having a strong designer early in your project life-cycle can do.

I am strongly considering django for the next side project. I am new to python but enjoy it’s low ceremony approach (you sort of forget what language you are using, it gets out of the way) and then django to have more bases covered including this admin. Then htmx to avoid JS, maybe Elm if it needs interactivity

Strong opinion: DO NOT break up your project into apps.

Make 1 app called core or common of whatever and replace models.py with models/.py and import those into models/__init__.py

Everyone jumps into apps with foreign keys across app boundaries and it makes a mess of things from the start that doesnt buy you anything.

1 app. 1 set of migrations. Turn models, views, etc into a package instead of the single file module.

Its the one thing I wish the docs would prescribe and demonstrate for new project advice. .

Re: Customize Django Admin Interface

#15
We use the Django Admin A LOT. It's an amazing power. Lately, we've also added a Jupyter server connected to a read-only DB replica, with the Django models available.

It's impressive how much you can do with these two tools. There's no need for an internal management dashboard or a BI tool. Just the admin and a bunch of notebooks.

(Obligatory note: we are a bootstrapped startup)

Re: Customize Django Admin Interface

#16

Earlier quoted context omitted.

I am strongly considering django for the next side project. I am new to python but enjoy it’s low ceremony approach (you sort of forget what language you are using, it gets out of the way) and then django to have more bases covered including this admin. Then htmx to avoid JS, maybe Elm if it needs interactivity

Strong opinion: DO NOT break up your project into apps. Make 1 app called core or common of whatever and replace models.py with models/ .py and import those into models/__init__.py Everyone jumps into apps with foreign keys across app boundaries and it makes a mess of things from the start that doesnt buy you anything. 1 app. 1 set of migrations. Turn models, views, etc into a package instead of the single file modul…

After many years, I’ve come to the same conclusions and can heartily recommend these suggestions!

Another similar suggestion I’d add is make a settings module with a base collection of configuration (i.e. myproject/settings/common.py) that other deployment-specific dev.py & prod.py import from.

Basically, don’t forget that Django projects are always Python modules too, so go ahead and use those language features too.

Re: Customize Django Admin Interface

#17

Earlier quoted context omitted.

I am strongly considering django for the next side project. I am new to python but enjoy it’s low ceremony approach (you sort of forget what language you are using, it gets out of the way) and then django to have more bases covered including this admin. Then htmx to avoid JS, maybe Elm if it needs interactivity

Strong opinion: DO NOT break up your project into apps. Make 1 app called core or common of whatever and replace models.py with models/ .py and import those into models/__init__.py Everyone jumps into apps with foreign keys across app boundaries and it makes a mess of things from the start that doesnt buy you anything. 1 app. 1 set of migrations. Turn models, views, etc into a package instead of the single file modul…

Do you have a tutorial for more detailed example of what you wrote?

Re: Customize Django Admin Interface

#18
post #5

Earlier quoted context omitted.

Yup. No project of this size is without some ugliness, but Django really is an impressive piece of technology and complex but cohesive architecture. The more I understood its layers the more I appreciated how much it does, and how well it allows you not to worry about things until you need them. You mentioned having a strong designer early in the project; did you have a specific name in mind? I'd love to see what the…

I'm guessing Wilson Miner: https://wilsonminer.com

Yes. I was referencing Wilson. Thanks!

Re: Customize Django Admin Interface

#19

The Django admin is a superpower, it's a x10 productivity multiplayer at the beginning of (or even far to far into) a project. However, I also dislike so much of it. The hacks I have used to contort it to do what I want I would be embarrassed for another developer to see... Former Django fellow Carlton is working on a nice toolkit called "Neapolitan", it's early stage, but is designed to enable building CRUD views ve…

We have been working on something that sounds similar. It ain’t perfect yet, but we are using it quite a bit already.

https://github.com/django-beam/django-beam

Re: Customize Django Admin Interface

#20
post #17

Earlier quoted context omitted.

Strong opinion: DO NOT break up your project into apps. Make 1 app called core or common of whatever and replace models.py with models/ .py and import those into models/__init__.py Everyone jumps into apps with foreign keys across app boundaries and it makes a mess of things from the start that doesnt buy you anything. 1 app. 1 set of migrations. Turn models, views, etc into a package instead of the single file modul…

Do you have a tutorial for more detailed example of what you wrote?

if not, please write one when you have time, short one is better than none :)
Post reply on HN