Live data from Hacker News

Django 2.1 released

docs.djangoproject.com

61–70 of 129 posts

Re: Django 2.1 released

#61
post #44

For anyone thinking about picking up Django and is worried about the framework being obsolete I encourage you to take a look. Django is fantastic. I've worked with it for a number of years now and it can really help in the early stages of prototyping. Things I especially like about Django: * The built in admin letting you edit and view objects easily. * Being able to use it without using the views. Add django rest fr…

A huge reason some people consider frameworks like Django obsolete is because they are focused on an older web paradigm of constructing elaborate html pages on the server side and pushing it out and letting some basic extra js stuff augment it.

That's what lead to things like server side HTML form definition and form handling code.

After the emergence of things like React, Angular, etc those "html templating" facilities get in the way because that stuff is baked into the react app and is focused on the client side, it may get server side rendered with nodejs. A modern fancy web application using React in 2018 doesn't need something like Django forms or Flask-WTF and those types of things conflict and overlap with things like React.

The backend is turning more into a data/API/GraphQL service than "get html" service that was popular when these frameworks emerged.

Re: Django 2.1 released

#62
post #44

For anyone thinking about picking up Django and is worried about the framework being obsolete I encourage you to take a look. Django is fantastic. I've worked with it for a number of years now and it can really help in the early stages of prototyping. Things I especially like about Django: * The built in admin letting you edit and view objects easily. * Being able to use it without using the views. Add django rest fr…

Are there people going around saying that Django is obsolete? I've seen a lot of people argue against using Django in favor of RoR or Flask, but that's usually based on personal preference. I've never seen anyone say that it's "obsolete".

I’ve had a few frontend engineering candidates quiz me as to why our backend is written in Python and not JavaScript, and implying that Python is “legacy”. This is not true, but there are developers who think that.

Re: Django 2.1 released

#63

Earlier quoted context omitted.

Not OP, but I've also been using Django for (more than) my whole career and I use React on the frontend. If you're curious about the frontend path I took, it was roughly: * jQuery with no framework * Backbone (for a couple years) * Backbone + Marionette (for a couple more years) * Angular (for about a week) * React (for the past few years)

When you moved to Angular and later to React did you have any jQuery heavy libraries? I'm using stuff like slickgrid[0], jquery-ui datepicker, json-editor[1] and wonder how I will drive these components from something like Angular or React? doh, quickly googled for the github links below and saw there now a slickgrid-es6[2] fork which I have not tried. But my question still stand: how do you drive jquery libs from ne…

You can access the raw DOM node from a React component.

On component mount/unmount, you can apply a jQuery library to the DOM node and optionally clean it up.

It's the same way you can wrap a node with a React component and otherwise do all your draws outside of React (like for a game). This way the node is still integrated into your React app but React does nothing more than create/remove it.

Re: Django 2.1 released

#64

Earlier quoted context omitted.

Are there people going around saying that Django is obsolete? I've seen a lot of people argue against using Django in favor of RoR or Flask, but that's usually based on personal preference. I've never seen anyone say that it's "obsolete".

I’ve had a few frontend engineering candidates quiz me as to why our backend is written in Python and not JavaScript, and implying that Python is “legacy”. This is not true, but there are developers who think that.

Would be interested to know how many backend engineers would say something so silly.

Re: Django 2.1 released

#65
post #7

I've been working with Django for almost my whole career, since 1.1. It's a joy to use, and blows any other web framework I've used out of the water when it comes to actually just building stuff. Django is a fantastic boring[1] tool, and seeing boring updates like this is great. 1: http://mcfunley.com/choose-boring-technology

I have been using symfony since the 2-3 years because the product is build on symfony. Now i like symfony, because i’m not a big fan of PHP. Anybody knows how Django compares to Symfony. I have glanced through Django documentation few times and it look a little similiar. If somebody has used both frameworks, what are the main advantages of Django over Symfony?

Re: Django 2.1 released

#66

Earlier quoted context omitted.

Why would anyone consider it obsolete to begin with ? If anything, I would consider someone making that statement miss informed

There are not currently many well-known products that use it. (Bitbucket cloud being the exception.) That's not the best of reasons; just because Django is not used by Google doesn't mean it isn't the perfect tool for you.

Doesn't Instagram count as a well-known product? :)

Re: Django 2.1 released

#67
post #61
post #44

For anyone thinking about picking up Django and is worried about the framework being obsolete I encourage you to take a look. Django is fantastic. I've worked with it for a number of years now and it can really help in the early stages of prototyping. Things I especially like about Django: * The built in admin letting you edit and view objects easily. * Being able to use it without using the views. Add django rest fr…

A huge reason some people consider frameworks like Django obsolete is because they are focused on an older web paradigm of constructing elaborate html pages on the server side and pushing it out and letting some basic extra js stuff augment it. That's what lead to things like server side HTML form definition and form handling code. After the emergence of things like React, Angular, etc those "html templating" facilit…

> because they are focused on an older web paradigm

Which usually is faster and easier to use.

> A modern fancy web application using React in 2018

Takes ages to load and melts your CPU.

Re: Django 2.1 released

#68
post #28

Earlier quoted context omitted.

Sure you can. See the documentation: https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/f...

Thank for the quick reply. Now I need to understand how the "__" magic work; And I wonder what would django do if my key is "animal__breed". Will it understand: Dog.objects.filter(data__animal__breed='collie') But this is maybe questions I should rather ask on #django or stackoverflow.

You probably simply can't do a `data['animal__breed']` query (not with that syntax anyway; you can implement custom lookups though) if your key happens to contain a double underscore.

Re: Django 2.1 released

#69
post #7

I've been working with Django for almost my whole career, since 1.1. It's a joy to use, and blows any other web framework I've used out of the water when it comes to actually just building stuff. Django is a fantastic boring[1] tool, and seeing boring updates like this is great. 1: http://mcfunley.com/choose-boring-technology

As a counter point, I tried to use Django for a data-visualisation project and ran into some problems. Everything is built on models, which are kind of activerecord pattern. Django has an inbuilt (and inferior) version of sqlalchemy, so that when you want to push sql past a certain point (define queries more complex than the api) you're pretty much stuck. Now you have codebase with two different database libraries in…

Pyramid is often forgotten. It's genuinely designed to be extended (vs. Flask's approach of "here you have a magic-global variable (that's magically working like a stack of dicts), go put some stuff into it"); a good example would be renderers. In Django it's still kinda awkward to use other/multiple templating engines; Flask doesn't really help. Pyramid on the other hand has a simple and extensible interface to support multiple templates and other renderers ( https://docs.pylonsproject.org/projects/pyramid/en/latest/na.... ). This is a common theme with Pyramid. Another is avoiding global state; they're quite successful at that (vs. "I declare my entire app/blueprint within a function"-Flask and "I don't know how this works, it's just like magic. I go to my model class and, BAM, suddenly I'm connected to some database"-Django). Django ORM is awkward and not that good, but awkward to replace.

Re: Django 2.1 released

#70
I work with a lot of clients and for every project, it's Django. I love how readable the code is. I've even had non-technical clients peer into the code and make correct observations.

And it's been said already, but Django Admin is a crown jewel. I can't tell you how many clients have jumped with delight when they realize they get that functionality out of the box. It ends up turning into a great admin dashboard and pseudo analytics tool---atleast for the short term.

If you're jumping on the GraphQL train, I'd encourage you to check out Graphene. It's a Django library that serves as a GraphQL provider. Reasonably well documented and production ready, IMO. If you're looking a Django + GraphQL + React starter project, mbrochh's project [0] is a good place to start. It is slightly outdated but the core patterns are still reusable.

[0] - https://github.com/mbrochh/django-graphql-apollo-react-demo

Post reply on HN