If you're writing a REST api, invest the time to learn Django Rest Framework. It is well worth it.
Django Newbie Mistakes
11–20 of 225 posts
Re: Django Newbie Mistakes
#12Django is a hell for APIs and big projects. It's good for beginners and small projects, but once you need the least amount of actual control, you will find it's too late
I've worked on plenty of large projects and haven't run into places were I've "lost control". Just the opposite, I have found it to be very extensible.
I'm curious if there are cases I haven't hit that you have, though.
Re: Django Newbie Mistakes
#13I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Re: Django Newbie Mistakes
#14I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Re: Django Newbie Mistakes
#15Django is a hell for APIs and big projects. It's good for beginners and small projects, but once you need the least amount of actual control, you will find it's too late
Actual control... where? And why is it too late? Too late for what?
You can get actual control everywhere if you want to. Doing raw sql queries is perfectly possible. Rendering with jinja instead of django's template system is possible. Speaking to redis directly: possible. Returning a string instead of something rendered: possible.
Heck, even speaking to the django db from another project with sqlalchemy worked out quite alright.
A big problem in large projects is too many queries per view, or unoptimized queries. Django's orm often gets the blame. But I did see that happen with ORMs in other frameworks as well (flask, bottle although an orm is optional). Even raw sql. Another nice feature of django 2.1 will be the .explain() method on querysets. Im using 2.1 to debug queries now and switch back to 2.0 when things are speedy again.
Another problem is having way too many unused variables and unclear calls to database from templates. But that is also a big problem in flask etc.
I think it is a myth Django is a hell for big projects, there are plenty big companies and websites which prove im right. Of course there are struggles. But those struggles are there with other python frameworks as well.
A lot of work happens quickly beyond the framework you use anyways. When a website grows many background jobs have to run or many business rules have to be programmed at some place. This does not have to do with the framework and often times just happens to become messy. I think of the work i do in django projects 30% is django related 70% is django unrelated.
You can consider to use another _static_ language and framework for speedups, like play or something. But i think the parent poster meant Django is a hell compared to other python frameworks.
I do wish django could do some async stuff, like the play framework does. It would be just nice to fire off a few db queries and resize an image and just wait for the result at the moment you build the response. But other than that it is superb!
Re: Django Newbie Mistakes
#16I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Re: Django Newbie Mistakes
#17I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Re: Django Newbie Mistakes
#18I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
I am. So, yes.
Re: Django Newbie Mistakes
#19I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Re: Django Newbie Mistakes
#20I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.
Does go have a web framework that does as much for you as django?