In general, I think Django makes it way too easy to shoot yourself in the foot.
Django Newbie Mistakes
111–120 of 225 posts
Re: Django Newbie Mistakes
#112One of the things that makes me sad is there is no project even remotely close comparable to Django for say Golang or Scala. I love the fact that you get an admin interface out of the box. And tons of documentation. The views/template stuff is a bit dated since everyone started moving to frontend/backend services and SPAs but we still have DRF which is incredible in the amount you get for "free". I've had the "pleasu…
> I've had the "pleasure" of working with other large projects built on flask and ever time it gets to a certain size I wonder why we didn't just use Django. Actually, I've had the exact opposite experience. I like using Django for small and mid-sized projects, because with Flask I have to spend time adding all these extra libraries for universally required functionality on a quick app whereas, with Django it's plug…
I haven’t seen a Flask code bass do this anywhere near as well. They all seem to end up becoming very different and tricky to onboard new devs onto because they are so custom.
Django hides some complexity, but we haven’t found many pets we can’t effectively customise, and the architecture at scale is great, something I haven’t seen in many other places.
Re: Django Newbie Mistakes
#113This is given as the 'correct' way?
Storing a ZIP code as an integer? What does an 'integer' length of 5 mean? Integers have max values, not lengths.
"The django docs are so great! They educate you!"
I'm presuming most people aren't being sarcastic when they post that sort of sentiment, but it's hard to take those endoresements seriously.
Re: Django Newbie Mistakes
#114One of the things that makes me sad is there is no project even remotely close comparable to Django for say Golang or Scala. I love the fact that you get an admin interface out of the box. And tons of documentation. The views/template stuff is a bit dated since everyone started moving to frontend/backend services and SPAs but we still have DRF which is incredible in the amount you get for "free". I've had the "pleasu…
> One of the things that makes me sad is there is no project even remotely close comparable to Django for say Golang or Scala. Could not agree more. This is my number one reason for not moving away from Python for web stuff. > The views/template stuff is a bit dated since everyone started moving to frontend/backend services and SPAs This is certainly true for customer facing products, but for internal tools I've yet…
Why would you want to move away from something that works?
Re: Django Newbie Mistakes
#115Earlier quoted context omitted.
Agreed. Also, unless django has changed peaking under the hood is a nightmare. Forms and the ORM (and really the whole framework) is giant ball of mud.
Forms are a nightmare to work with. It's a component in Django I systematically avoid, even when using actual forms. Nowadays I use DRF for everything though. Serializers > Forms. And React > Templates. As for the ORM, I long for a world where the ORM is replaceable by SQLAlchemy. Django's ORM is nice and simple, but as soon as you want typed complex queries, SQLAlchemy is really good.
Re: Django Newbie Mistakes
#116Earlier quoted context omitted.
Personally, as a customer, the "new" way of doing it is irritating, usually somewhat broken, slow and usually unreliable. I wouldn't be surprised if non-techies couldn't give a toss if you're using a traditional MPA with a sprinkling of ajax for the bits that really need to be responsive or a total SPA. I'm beginning to suspect the only people who want a SPA are the programmers. Has anyone even got any proof that a S…
Good SPAs are fantastic . It's just a lot of people suck when implementing them. The Serverless documentation, an SPA, blew my mind in terms of how fast and clean it is: https://serverless.com/framework/docs/
(Single Page Applications arguably have their place. I'm just really confused why you think this is a particularly good example.)
Re: Django Newbie Mistakes
#117Re: Django Newbie Mistakes
#118Earlier quoted context omitted.
What makes Go projects easier to maintain?
I would argue that it's simplicity. I believe I've read somewhere that Golang was designed with junior engineers in mind. They wanted to create a language that young engineers could learn easily yet cannot make a lot of mess due to its simplicity. They baked all features necessary right into the language. You get a http server, ssl support, templating engine etc. right in the language. You also have a database agnost…
Interesting, when one of the complaints about Java is exactly this.
Re: Django Newbie Mistakes
#119I 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.
Where I’m from the most popular techs are .net (not core), Java, PHP and Django. Django is perfectly viable in that regard.
Go may be better, but if you can run Instagram on Django, I don’t think most people will really have to worry about scalability. Go might become popular eventually, but right now, there isn’t a single golang job in my country, so you know. :)
Re: Django Newbie Mistakes
#120A lot of these things are only common mistakes because of Django's unusual behavior. > POST to views loses POST data The middlewares shouldn't be redirecting POSTs then! They could have returned a client error instead. > Blank object names They could have provided a fallback of __class__.__name__. > Integer & NULLS If the admin interface knows the field is required, why does it even attempt to insert a null value? It…
Sounds like you're doing the same thing. You have a set of expectations about how the world works that is not the exact same as Django's - which is true of any other tool anyone uses.
Also I want to point out that software is not made by a monolithic entity; it's made by people, and you suggest a few simple things like adding type checks and validations, which would be a wonderful opportunity to contribute! In fact, opinions such as yours are enormously helpful to the creators of software frameworks. Software doesn't build itself; if you have ideas, contribute!