Live data from Hacker News

Customize Django Admin Interface

appliku.com

21–30 of 33 posts

Re: Customize Django Admin Interface

#21
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?

This tutorial addresses the practice: https://doordash.engineering/2017/05/15/tips-for-building-hi...

There's also a long, uh, spirited discussion about it here with some decent arguments going both directions: https://forum.djangoproject.com/t/why-do-we-need-apps/827/19

Re: Customize Django Admin Interface

#22

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 of experiments i came to the same exact conclusion.

In 15 years I haven't seen a single case when splitting a project into multiple apps brought anything but pain.

Also, splitting files like models into packages is also a great approach. 6 months ago I found myself with models.py, API.py (my alternative for API views vs regular views) and serializes.py each over 3k lines of code. Spent 3 days splitting them into small files by topic. Way easier to work.

I also wish docs suggested that it is an option and better to split them earlier. Because it is so easy to just "add one more model to the end of the file, what can go wrong?"

You understand what goes wrong after 2-3k LoC

Re: Customize Django Admin Interface

#23
post #7

Just want to chime in and say I've been using AppLiku to host a Django service since over a year and it's a great alternative to Heroku if one is bogged down by the limitations. Kudos to the maker!

Thanks! Super happy to hear that it keeps being valuable and useful for you! Keep deploying

Re: Customize Django Admin Interface

#24

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)

This is a great idea. Have you ever written about it somewhere? I would like to read and share with others. I know a few people who could benefit from that.

Re: Customize Django Admin Interface

#25

django admin > database console. Even though the admin is far from perfect it is a fantastic alternative to having operations people have to contend wit a database control panel.

Yes absolutely. Ops people love spreadsheets and it is done in admin easily.

Also, with Admin site you can limit their ability to screw things up massively.

The amount of stress and time waste you remove by giving them pretty user friendly admin with such low effort is astonishing.

Re: Customize Django Admin Interface

#26

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…

Agreed. Only make another app if it's almost entirely decoupled from the main app, e.g. a blog app or similar.

Re: Customize Django Admin Interface

#27

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…

> Make 1 app called core or common

Do not call it core. There's an existing app or module or something with that name and this will introduce hard-to-diagnose bugs. Common is preferable.

Re: Customize Django Admin Interface

#28
post #23
post #7

Just want to chime in and say I've been using AppLiku to host a Django service since over a year and it's a great alternative to Heroku if one is bogged down by the limitations. Kudos to the maker!

Thanks! Super happy to hear that it keeps being valuable and useful for you! Keep deploying

Thanks for the awesome and super affordable service. It's truly a saviour for me.

Deploys from today: https://imgur.com/a/3h7yYlO

Re: Customize Django Admin Interface

#29

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…

> Make 1 app called core or common Do not call it core. There's an existing app or module or something with that name and this will introduce hard-to-diagnose bugs. Common is preferable.

i've been getting away with calling the folder with models/views 'app' and the folder with asgi/wsgi/settings 'config' (top-folder name is the project name)

so far nothing bit me other than an awkward 'app' in my installed_apps, fingers crossed

Re: Customize Django Admin Interface

#30

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

Every time I read a new comment about webapp stuff, new languages and "technologies" seem to be mentioned. How does anybody keep up with this stuff, let alone create it all? :p

Lol yes this is what I am trying to run away from ironically! Forget Elm and HTMX for a second: I would like to use Django because it should be boring tech to get the job done. HTMX allows you to have interaction without JS using HTML-like primitives. I would just learn what I need. Elm is something I used before but not really needed! More of an indulgence. Vanilla JS will do though. No need for Elm or React for side projects.

I am trying to avoid the nextjs/react/ etc stuff where I spend half my time on tooling issues. JS itself is nightmarish (people complain about python dependencies but I haven’t yet seen a big issue yet) but node JS weird module errors and myriad places things are configured and that you usually have build steps etc. Makes me want to get away from that.

You don’t need to “keep up”. You don’t need to know all 100 ways to make a sausage. Just make sausages. Occasionally tweak the machine.

Post reply on HN