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.
Django 4.0
131–140 of 226 posts
Re: Django 4.0
#132Let'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
#133nowadays 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.
Re: Django 4.0
#134Django 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.
Re: Django 4.0
#135Earlier 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.
Re: Django 4.0
#136Earlier 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.
Re: Django 4.0
#137Django 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…
Re: Django 4.0
#138Earlier 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.
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
#139Earlier 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.
Granted, I'm not fond of ORMs in general, but I at least understand the appeal of the active record pattern.