News for hackers. Stuff that matters.
Re:Django 4.1 by giancarlostoro on Wednesday August 03, 2022 @08:30AM (#32330796)
I went with Django Rest Framework when I used it for a project because it provided things I would otherwise spend says implementing out of the box. The one thing I definitely did implement for myself was filtering, the built-in stuff was kind of mediocre for our needs, outside of that I want to say we left pagination and everything else as-is. It was a bit of a nightmare to look up documentation on though I will admit, if you don't know the Google Buzzword Soup you got to look up. Previously to that I was using CherryPy and building my entire kitchen sink myself, so it had nice moments and bad moments, but it definitely saved me on time and effort.

You typically do Django + REST because you are already comfortable with Django or because you were already using it, although I could argue, you could consider making your API project stand alone and using CherryPy or even FastAPI for a much nicer experience. The downside there being you wouldn't be using Django's ORM. I really do wish Django's ORM would be spun off into a stand alone project that Django then imports, so anyone else can use it in other non-django specific projects.

Re:Django 4.1 by znpy on Wednesday August 03, 2022 @09:42AM (#32331544)
I remember watching a beautiful talk from some pycon whose details I can’t remember about using django as if it was a micro-framework.

It basically boils down to rejecting the folder structure that django-admin sets up for you, importing stuff yourself and doing some basic initialisation/configuration.

Once you do that, django kinda somehow behaves like a micro-framework, with the significant difference that you can import and use the advanced features if you want/need to.

Re:Django 4.1 by ingenieroariel on Wednesday August 03, 2022 @10:07AM (#32331851)
Here is an example of a single file Django project I started around eight years ago that does what you mention:

https://github.com/planetfederal/registry/blob/149a2b958dd05...

Re:Django 4.1 by rsanek on Wednesday August 03, 2022 @11:31AM (#32333086)
I guess I prefer to keep it light and use a true microframework like flask for this use case. I find I can similarly import Flask extensions without bringing in a full heavy framework
Re:Django 4.1 by Evidlo on Wednesday August 03, 2022 @12:31PM (#32333851)
PonyORM is sort of like Django's