Live data from Hacker News

Django 2.1 released

docs.djangoproject.com

101–110 of 129 posts

Re: Django 2.1 released

#101
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…

Django REST framework (1) gives you the best of django + a RESTful API really, and is just another `pip install` and a few lines added to settings file.

You still have some of the same performance issues as with any ORM - but it makes setting up a Django based RESTful API fairly trivial.

Some things I like about DRF:

- viewsets which allow RESTful read + CRUD ops on an existing django model.

- easy to set up different serializers for a model view: flat, nested with child relations etc.

- auto generated API docs in the browsable format of your choosing.

1 - https://www.django-rest-framework.org/

Re: Django 2.1 released

#102
post #61

Earlier quoted context omitted.

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…

You are not required to use Django's templating engine. It works great with React, Vue, Angular, etc. if you use Django Rest Framework as the intermediary.

Yeah this seems to be the key point that is confused.

Re: Django 2.1 released

#103
post #78
post #61

Earlier quoted context omitted.

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…

> 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. Sounds like an awesome idea. > That's what lead to things like server side HTML form definition and form handling code. You make these sound like bad things. > those types of things conflict and overlap with things like React So why presume the thing to abandon isn't Rea…

Yes! There are an awful lot of web sites out there--including the one we're on right now--which are, well, web sites, not web apps.

I have a strong suspicion this conflation comes from reasoning kind of like this:

(1) My web site would benefit from some kind of API. (2) Hey, if it has an API, wouldn't it be simpler if it just had an API, and all interaction was through clients? (3) So, [insert JavaScript framework] to the rescue! It'll be just like the original web site, but better!

Except that it isn't automatically "better" for either performance or usability. Content-focused sites tend to perform very well using the server-side model.

Re: Django 2.1 released

#104
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?

While "it's in Python and not PHP" immediately comes to mind, a less snarky answer is that Django feels optimized for building bespoke content management systems. Take some time to play around with the automatic admin generation.

Re: Django 2.1 released

#105
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?

I use both, but we choose Django for all new projects. For advantages of Django vs Symfony, there's first advantages of Python over PHP...

In a web design context probably the biggest advantage is having things like asynchronous code where it makes sense and websockets without having to use another technology stack such as node.js.

Otherwise I simply find we are more productive using Django, it allows less boilerplate code for similar functionality, there is less complexity involved overall.

Disadvantage is maybe for really large projects with many developers, Symfony might be easier to have someone pick up the code since it's more standardized.

Re: Django 2.1 released

#106

Django is the only web framework where I see consistently positive discussions about it on HN. Bravo Django, and congratulations on another release!

This aspect has me looking at getting into Django; what have the discussions on HN regarding ASP.NET Core (the new open-source stuff) been like? I'm mainly in pre-Core MVC and looking to move up to something I can deploy to any Docker-hosting environment.

I can't help you with ASP.NET Core, as I have no experience building and/or deploying it.

What I can chime in with though is: In my days as a web dev I started off and learned the ropes with ASP.NET (MVC was recently coming up), and after moving to django for another project I felt right at home.

It's very impressive how the django project was able to rival a behemot like Microsoft in terms of usability, reasonable defaults and developer convenience, overall design, documentation, upgradability.

The REST stuff (django rest framework) and some aspects of managing models were actually quite ahead of ASP.NET at the time for getting you up to speed with things.

Of course the tech stack around them is completely different and something you'll want to think about, but in terms of features and how things are laid out you don't need to worry, django has you covered.

Re: Django 2.1 released

#107
post #86

Earlier quoted context omitted.

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

They're juniors who also think SQL is obsolete because you can't POST a json into it. They'll understand that in order to solve problems efficiently you need a toolbox of a reasonable size.

Yep I’ve had this recently too. Three devs joined the team who had no experience in relational databases, didn’t even know what SQL was for.

A few weeks later they told this story of using MongoDB and how they had layered some rules on top to ensure data consistency...

Re: Django 2.1 released

#108
post #73
post #18

Earlier quoted context omitted.

It is worth noting that Pyramid Web Framework is also awesome to use. I see it as a middle ground between Django and Flask. The scaffolds make some design decisions for project and you can pick from what you like the most. Pyramid allows for extensible applications and never gets in your way. The most critical Python infrastructure (PyPi) is now built with it, if you haven't tried it give it a shot. It is one of most…

I'm a very happy ist of Pyramid. Using it professionally for various larger applications as well as for pet projects. It's very well thought through. We're providing a GraphQL and integrating it was a breeze.

I would be interested to hear about how you did pyramid and graphql, ive been following graphene but are there specific tie ins for pyramid? books? articles?

Re: Django 2.1 released

#109
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…

Check out my library for using react in Django easily.

https://github.com/pycampers/react-pages

Re: Django 2.1 released

#110
Open question re: django:

https://docs.djangoproject.com/en/2.1/ref/models/fields/#nul...

I've got a colleague who has been using django for a couple of years (and has 15+ years experience with python outside of web, as well as java, php, arduino hacking, 3d printing, etc).

He pointed me to the link above re: nulls - I can't figure out why the default would be to convert a null to an empty string. All major databases can understand nulls just fine.

"... If a string-based field has null=True, that means it has two possible values for “no data”: NULL, and the empty string. In most cases, it’s redundant to have two possible values for “no data;”..."

An empty string is "no user supplied data" and a null is "no value has been given at all". It seems rather ... odd(?) to try to conflate the two.

Am I missing something?

I've got perhaps a slight bias against django, in that the only people I've known who've used it were either junior devs who had no experience in anything else (and raved about it), or senior folks who've inherited a relative django mess (usually the result of the aforementioned junior devs).

Post reply on HN