Live data from Hacker News

Django 4.0 release candidate 1 released

djangoproject.com

51–60 of 126 posts

Re: Django 4.0 release candidate 1 released

#51
Django is good for those who have used it a lot.

For beginners, there are much better alternatives and, frankly, Django way of development is severely restricting.

Starting off with an API backend and a React/Angular/Vue front end, allows new developers to learn better abstractions (and not merge front ends and back-ends)

The very idea of "sending UI code to the front end for every request" is unsuitable for medium to large projects. But, if you start building smaller projects with an vertically integrated system like Django, it becomes increasingly difficult to think about larger projects.

Re: Django 4.0 release candidate 1 released

#52

Earlier quoted context omitted.

Django templates are the worst. Django is great. Just don't use its templates or form systems. Indeed react is a great replacement for both.

I disagree. The way you can extend sections of other templates without creating an inheritance chain works very well (and I missed in template systems, for Java, for example)

To be clear, I use them as well. And every time I come to regret it unless it's on a site I absolutely do not touch once it's finished.

Templates make it harder to find and debug issues. They have extremely little tooling to give assurances about what they're compiling, whether the syntax is correct etc. This requires you to build massive, flaky test suites.

I'll take react and typescript any day over even one tenth of that.

Re: Django 4.0 release candidate 1 released

#53
post #48

Earlier quoted context omitted.

Django templates are the worst. Django is great. Just don't use its templates or form systems. Indeed react is a great replacement for both.

How many tools do I need to install to publish a front-end made with React?

Just the one if you're using CRA. None if you're embedding react as is.

The answer depends on how you're using react, and what advantages you want to get from it. "How many tools" is not a real question to ask. If you're concerned about ease of development and learning curves, then that gives you an actual goal to optimize for, and it won't coincide with the amount of tools (react is harder to use embedded than with tooling, hence why the latter is more popular).

Re: Django 4.0 release candidate 1 released

#54

Django is good for those who have used it a lot. For beginners, there are much better alternatives and, frankly, Django way of development is severely restricting. Starting off with an API backend and a React/Angular/Vue front end, allows new developers to learn better abstractions (and not merge front ends and back-ends) The very idea of "sending UI code to the front end for every request" is unsuitable for medium t…

I think for beginners Django rocks. I dont do software at all in my career (Engineering), but I can pick-up a django project, look through the example project in the documentation and then throw (and I mean throw) together a working django project in a few evenings. With a very much an amateur knowledge of python. As in another thread, the css takes longer.

Are they any other beginner alternatives I should be looking at ?

Re: Django 4.0 release candidate 1 released

#55
post #29

Earlier quoted context omitted.

Nothing stopping you from writing a Django app with parts written in React, VueJS or whatever you prefer.

Obviously nothing is stopping me, that's not the point. I was just highlighting the fact that in my opinion the DX of parts of Django is inferior compared to the JS frontend ecosystem. As the Django community, I think this is something we should have an eye on.

You're absolutely right in the sense that the Django and other communities should not stagnate and should also keep an eye on what the other frameworks are up to. Maybe the default template engine should be replaced in Django?

Re: Django 4.0 release candidate 1 released

#56

Django is good for those who have used it a lot. For beginners, there are much better alternatives and, frankly, Django way of development is severely restricting. Starting off with an API backend and a React/Angular/Vue front end, allows new developers to learn better abstractions (and not merge front ends and back-ends) The very idea of "sending UI code to the front end for every request" is unsuitable for medium t…

Django/Python is the first "real" thing I ever learned while teaching myself to become a developer (through Harvard's CS50web course), and I found it very easy to learn and pleasant to work with. It has its quirks, but what doesn't?

Once you move on to using Django (probably with REST Framework) for the backend and React or some other JS framework for the front-end, you get some slightly difficult things involving Auth and some other stuff, and of course you can take the complexity as far as you want and I'm sure there are some Django devs with 10-15 years of experience who are experts in parts of the framework that I'm not even aware of, but I don't think learning Django to the point where you can ship a reasonably competent app is more difficult than learning Node/Express, or Rails, or whatever.

Re: Django 4.0 release candidate 1 released

#57
post #31

Earlier quoted context omitted.

I used Django for 4 years, their ORM is a mess imo. I wouldn't expect someone new to it to be able to discover how to do this after a couple of hours of reading.

The ORM is great ... but is a question of taste/previous experiences. Once you start playing with annotations, DB-side functions and subqueries, it is very nice. Only frustration I have is the power/possibilities of mysql (which I use 99% of the time for various reasons) versus postgre. The latter seems far better and advanced, and it does reflect in the ORM. But wait, this isn't linked to django, is it? :-)

I agree. I can generally do what I need to with the ORM, except in extreme cases where you probably should be writing custom SQL anyway. I do fight with Subquery and OuterRef now and then, thinking OuterRef isn't being used in a Subquery when it is, but a little debugging usually resolves that.

The one thing I really wish Django had after all these years is multi-column PK support. I bring it up every time I see a thread about Django, hoping the devs or an open-source contributor will take it on. But after 10+ years, the open ticket just keeps passed on and I don't know that I have the skills to do it myself.

Re: Django 4.0 release candidate 1 released

#58
post #48

Earlier quoted context omitted.

How many tools do I need to install to publish a front-end made with React?

Just the one if you're using CRA. None if you're embedding react as is. The answer depends on how you're using react, and what advantages you want to get from it. "How many tools" is not a real question to ask. If you're concerned about ease of development and learning curves, then that gives you an actual goal to optimize for, and it won't coincide with the amount of tools (react is harder to use embedded than with…

For each and every tool that is added to my project, it needs to be installed by every developer, it needs to be understood at least on some level by every developer, and it needs to be maintained by someone.

Re: Django 4.0 release candidate 1 released

#59

Earlier quoted context omitted.

I disagree. The way you can extend sections of other templates without creating an inheritance chain works very well (and I missed in template systems, for Java, for example)

To be clear, I use them as well. And every time I come to regret it unless it's on a site I absolutely do not touch once it's finished. Templates make it harder to find and debug issues. They have extremely little tooling to give assurances about what they're compiling, whether the syntax is correct etc. This requires you to build massive, flaky test suites. I'll take react and typescript any day over even one tenth…

Wouldn't all of python have that problem? What you're saying is that there's very little static checks until the code is run, but all of python has that problem too, doesn't it?

Either you write big test cases covering everything, or you live with the knowledge that very unexpected things can be passed in to your methods without you getting notified.

And then there's javascript ...

Re: Django 4.0 release candidate 1 released

#60
post #5

Last week I was trying develop a quick prototype, and instead of setting up a C# project, I tried Django. At first, everything seemed super easy, but later I hit so many road-blocks that I had to give up (For example defining a self-referential m2m relationship with a custom join table, and getting it working on the admin site). Don't people really have such problems with it? It really feels like a huge burden when y…

For most frameworks,etc... I find that things get harder as the project grows in size and more code is added. Strangely, I find the complete opposite with Django. I find that adding new features and apps in my day job is easy and I barely even think that I'm using Django, but trying to start a hobby project with it is initially a bit of a nightmare That being said, weighing up the good with the bad, its still my favo…

Not my experience. I inherited two Django projects, and adding features is quite cumbersome. I had to add one boolean switch which Django only has to pass from an Angular form to a template, and I had to alter the code in 7 places (one of which is the Angular code). It's just not suitable for REST-like access from a front-end, nor for data that's not a tree, nor for heavy processing: I ended up pulling all kinds of tricks to keep processing time limited, and at a few points resorted to writing SQL queries. It's pretty heavy on CPU and memory.
Post reply on HN