Live data from Hacker News

Django 2.2

djangoproject.com

151–160 of 257 posts

Re: Django 2.2

#151
post #141

Why Django is not good, here are some of my reasons as far as I can remember: 1. mediocre routing (no nesting, all routes have to be declared in one place) 2. mediocre middleware (middleware is global) 3. mediocre ORM (easy only for very easy stuff, more pain in the ass than writing raw SQL itself when it comes to complex aggregations and joins) not to mention some of the famous ORM bugs that have been open for like…

A lot of these are pretty inaccurate, at least for modern Django.

1. I'm pretty sure that's not true if I'm correctly interpreting what you mean...You can do things like `path('myapp/', include(myapp.urls))`

4. Custom User models are now very straightforward (and recommended for non-trivial projects since it's easier to start with a Custom model that defaults to the default model for all options then modify it later)[1]

5. All these things are fairly straightforward and libraries like Django-Auth/Django-Rest-Auth cover a huge set of the normal use cases (OAuth, JWT, tokens, etc.)

6. Django Rest Framework is a best-in-class solution for Rest APIs

9. See 6.

[1] https://wsvincent.com/django-custom-user-model-tutorial/

Re: Django 2.2

#152

I love Django. I've used it for the last 8 years. I'm happy to see the project is still thriving. At this point, for me Django is pretty much synonymous with Django REST framework ( https://www.django-rest-framework.org/ ). I can't imagine a better API than Django w/ REST framework. For static sites I use Django's templates. Otherwise, I just use Django w/ REST framework for my API, and to serve up index.html. My ind…

DRF is awesome. If you're considering moving to or implementing GraphQL, though, Django + Graphile is amazingly productive and performant. No affiliation, just good experiences.

https://www.graphile.org/postgraphile/

Re: Django 2.2

#153

Earlier quoted context omitted.

I have used both Ruby on Rails and Django in large production web applications over 2+ years. Speaking strictly about the web framework, RoR is the slightly better framework IMHO. This includes but is not limited to: - cleaner internal APIs, models, methods - a lot more stuff that "just works" out of the box where you would need a third-party package in Django (e.g. RoR gives you different settings for development/st…

> better static file handling Don't you just let nginx/CDN handle these?

I think he’s referring to the app being aware of static files so it can resolve their URLs, etc (without having to hardcode paths).

You develop by just assuming all your static files would be served by Django itself (and they will - using the dev server) and then change the project’s configuration to use a CDN or S3 (using a library - which will automatically collect & upload your files too) with no change to the underlying code.

Re: Django 2.2

#154
post #151
post #141

Why Django is not good, here are some of my reasons as far as I can remember: 1. mediocre routing (no nesting, all routes have to be declared in one place) 2. mediocre middleware (middleware is global) 3. mediocre ORM (easy only for very easy stuff, more pain in the ass than writing raw SQL itself when it comes to complex aggregations and joins) not to mention some of the famous ORM bugs that have been open for like…

A lot of these are pretty inaccurate, at least for modern Django. 1. I'm pretty sure that's not true if I'm correctly interpreting what you mean...You can do things like `path('myapp/', include(myapp.urls))` 4. Custom User models are now very straightforward (and recommended for non-trivial projects since it's easier to start with a Custom model that defaults to the default model for all options then modify it later)…

Also #7, "want to use graph databases? noSQL? good luck" Is incorrect. How do I know? I've built a non-trivial Django app with a Neo4J backend. It included an API using Django REST framework. There are some parts of Django that are tied to the ORM, mainly the admin and some generic views. But you can certainly use Django without those pieces.

Re: Django 2.2

#155
post #8

Earlier quoted context omitted.

Django is still by far the best web framework as far as I can tell. Every couple years I check what's out there for GoLang, Rust, Nodejs, and Swift, and it seems like it will be a decade or more before anything else comes even close. Even though a lot of people don't like Django's ORM, at least it does almost everything you would want to do with Postgres. (And if you want more you can always use SqlAlchemy.) Most of…

IMO PHP's Laravel is competitive with Django. I think Django, Laravel, and Rails are really the only 3 frameworks with the levels of ecosystem and built in functionality that these 3 have (unless there's something in Java-land that I'm not aware of). ASP.NET Core is close, but the ecosystem around it is weaker.

I reviewed these sort of web frameworks some time ago and went with ASP.NET Core because of the language attached being more to my liking and industrial-strength than Python, PHP or Ruby. I go in assuming every project will be 500KLOC someday, because it can happen. I've seen codebases this large in Python, and it was no bueno. Static typing, forward migration / backwards compatibility take top priority for me.

Laravel was my 2nd choice, the recent adoption of a JIT into the core really adds some desirability to the space. Not to mention HHVM and how much Wordpress is out there.

Re: Django 2.2

#156

The projects/app relationship never 'clicked' with me. I also have a dislike for the awkward 'polls' example in the django tutorial. That said, I like Django. Of course, I liked Rails better, but maybe that's because it was my 'first' and I never used any of the big php frameworks for a long period of time. I quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller…

Two Scoops books about Django have awesome tips and tricks about many topucs and architecture is one of them.

Even if the latest version is for 1.11, the concepts are relevant.

Re: Django 2.2

#157

Earlier quoted context omitted.

I do wish Django REST Framework shipped with faster serializer code.

You can use Serpy for that, although it will require some hacking for de serialization (a previous client of mine had a custom-built solution that used Serpy for responses but plain Form classes for parsing requests, but that seemed fine and they were handling 3k/requests per second at peak time).

I never quite got Serpy working, but swapping to uJSON and the DRF renderer[0] helped quite a bit in some cases.

[0] https://github.com/gizmag/drf-ujson-renderer

Re: Django 2.2

#158

The projects/app relationship never 'clicked' with me. I also have a dislike for the awkward 'polls' example in the django tutorial. That said, I like Django. Of course, I liked Rails better, but maybe that's because it was my 'first' and I never used any of the big php frameworks for a long period of time. I quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller…

For small projects, I usually have two apps, the frontend and backend apps.

Re: Django 2.2

#159

The projects/app relationship never 'clicked' with me. I also have a dislike for the awkward 'polls' example in the django tutorial. That said, I like Django. Of course, I liked Rails better, but maybe that's because it was my 'first' and I never used any of the big php frameworks for a long period of time. I quit wasting my time with Flask for projects a while ago. It's a really great project and suited for smaller…

We split into multiple apps within one project/site for separation of concerns instead of reusability. We have ~370 apps and nest them quite heavily, probably ~30 at the top level. This works well for us and we've managed to scale nicely to 15 people working on the codebase quite nicely.

What do you mean by nesting apps? Like group them into domain folders and have multiple apps within a domain folder?

Re: Django 2.2

#160
post #145
post #138

Earlier quoted context omitted.

Could you please stop? Flamewars are just what we're trying to avoid on HN. When accounts behave like this we eventually have to ban them. https://news.ycombinator.com/newsguidelines.html

I am not trying to start any flamewar, I am just stating why Django is not good imo, simple as that

I believe that you started out that way. The problem with that first comment was that you began with an insult ("I immediately know that their technical understanding of the current backend and ops technologies is years behind"), which provokes people rather than informing them. Also, your comment included name-calling, which the site guidelines ask you not to do. Could you please review https://news.ycombinator.com/newsguidelines.html and follow the rules when posting here?

After that, you followed up with personal attacks and incivility. That's definitely flamewar. You weren't the only one doing it, but that doesn't make it ok.

Post reply on HN