Live data from Hacker News

Django 4.0

djangoproject.com

131–140 of 226 posts

Re: Django 4.0

#131
post #45

Django has allowed me to enjoy some side entrepreneurship. I have released three products as a solo part time dev that I would never have been able to do in a reasonable time using Java/Spring (my strongest stack). My first project went nowhere, but the second generated 1k+ a month and sold for 50k, and the third one is following a similar trajectory. My advice - keep it simple - function based views - centralize acc…

>avoid fat models, use a service layer I had not heard the term "fat models" before so I googled it. It did not go in the direction I expected.

I think the idiom was: Fat models, skinny controllers. That might return better results.

Re: Django 4.0

#132
Maybe this will be the moment I upgrade.

Let's see what version I'm running: Django 1.5.9

This is going to be very painful isn't it. I wonder how long until the bitrot makes it unbuildable and undeployable.

I should clarify, there is no database attached to this and it talks to a secure API that is maintained really well. So this is just views and templates, where the views talk to the API.

Re: Django 4.0

#133

nowadays most people use Django to create REST API. I wish Django would merge DRF into its codebase.

> nowadays most people use Django to create REST API I doubt that's true, but yes, having DRF merged in would be rather nice.

There are quite a lot of apps that do a JS frontend and Django backend these days, I myself have done quite a few.

Re: Django 4.0

#134
post #45

Django has allowed me to enjoy some side entrepreneurship. I have released three products as a solo part time dev that I would never have been able to do in a reasonable time using Java/Spring (my strongest stack). My first project went nowhere, but the second generated 1k+ a month and sold for 50k, and the third one is following a similar trajectory. My advice - keep it simple - function based views - centralize acc…

>avoid fat models, use a service layer I had not heard the term "fat models" before so I googled it. It did not go in the direction I expected.

I laughed

Re: Django 4.0

#135

Earlier quoted context omitted.

Class views are fine. Even just a TemplateView saves some effort, but it comes with learning some Django magic about the life cycle of the view to load data in and out and what methods to implement. I still recommend it. You don’t have to fully embrace it and it lets you avoid repeating a lot of code.

My recommendation for learning class-based views is to use a good editor or IDE that allows you to drill down into the library code easily. In PyCharm/IntelliJ I can just command-click on the TemplateView symbol and see its implementation, and do so recursively until I've unraveled the entire thing.

Agreed. Django's documentation is pretty light on the order in which certain functions will be executed and diving into the code is the only way I've been able to understand what happens when handling forms and views.

Re: Django 4.0

#136

Earlier quoted context omitted.

My recommendation for learning class-based views is to use a good editor or IDE that allows you to drill down into the library code easily. In PyCharm/IntelliJ I can just command-click on the TemplateView symbol and see its implementation, and do so recursively until I've unraveled the entire thing.

Agreed. Django's documentation is pretty light on the order in which certain functions will be executed and diving into the code is the only way I've been able to understand what happens when handling forms and views.

http://ccbv.co.uk/ is a pretty useful resource for learning class based views...

Re: Django 4.0

#137
post #45

Django has allowed me to enjoy some side entrepreneurship. I have released three products as a solo part time dev that I would never have been able to do in a reasonable time using Java/Spring (my strongest stack). My first project went nowhere, but the second generated 1k+ a month and sold for 50k, and the third one is following a similar trajectory. My advice - keep it simple - function based views - centralize acc…

please point us at your side projects - and congratulations that's a fantastic outcome

Re: Django 4.0

#138

Earlier quoted context omitted.

> nowadays most people use Django to create REST API I doubt that's true, but yes, having DRF merged in would be rather nice.

There are quite a lot of apps that do a JS frontend and Django backend these days, I myself have done quite a few.

Absolutely, I just question the premise that “most” Django applications are like that.

My best guess, and I have nothing but my own experience to back this up, is that for every public facing Django based website, there are at least three used internally and at least one of those use nothing but the build in admin interface as a UI.

Re: Django 4.0

#139
post #43

Earlier quoted context omitted.

Less taste and more that data mapper ORMs are better (although harder to make) than active record ones, except for very small datasets/simple queries.

"Better" for whom? It was a long time ago that I surveyed the ORM landscape but I remember thinking at the time I was much happier using an active record style ORM. I guess I'm saying I'm always suspicious when I see "better" with no qualification. Everything has tradeoffs.

I, for one, find data mapper simply baffling. I look at it and can't even comprehend why someone might want to do things that way.

Granted, I'm not fond of ORMs in general, but I at least understand the appeal of the active record pattern.

Re: Django 4.0

#140
Feels more like a Django 3.3 release than a 4.0 -- was expecting Django 4.0 to deliver the promised ORM async support.
Post reply on HN