Live data from Hacker News

Django 2.0 released

docs.djangoproject.com

71–80 of 177 posts

Re: Django 2.0 released

#71
post #32

Earlier quoted context omitted.

The advantage of Django is it comes bundled with everything you could need. Flask is simple, but then you need user authentication. Which library do you use? Is it updated and maintained? What about an ORM, forms, templating, localzation. Do they all work together? Suddenly it's not so simple. That being said, if your app really is simple (single file, under 100 lines) flask is excellent.

Oh, come on. There are plenty of large websites written in flask. It's not that hard to use at all, and all those things you list are definitely a part of it. Hell, I have a 20 KLOC website written in bottle, and no one ever said it was poorly done, insecure, and so on. The problem is that a lot of people writing Python web stacks don't know how to write Python at all, and no framework will save that shortcoming.

Part of my point was that if your site is going to be 20 KLOC then why not use a framework that is aimed at building 20 KLOC large sites rather than one that is aimed at writing 200 line sites.

Flask is advertised as a micro framework. if you want to rebuild Django with it then sure you can, but I personally can't see why you'd want to.

Re: Django 2.0 released

#73
post #4

This is probably your best bet if you're just going to build a nice CRUD frontend for a business app, possibly with an API (via DRF). I am doing this right now on a project as it's the shortest path to a win. The API however is written in Java 8 / vertx.

Just out of curiosity, if the API is already being built in Java, why not just build a single-page-app to utilize the API instead of Django? I'd assume the deployment and overhead of maintaining a single-page-app would be way lower than Django. (i.e. uploading to s3 and setting up CDN vs. setting up a VM for Django with nginx, uwsgi, etc.)

One reason would be because you don’t know react or angular or whatever the latest js framework is. You have known Django for a decade and it still works so why waste time learning some js framework which might be out of fashion in 2 years.

Generate dynamic HTML on the server, that still works just fine. And codebase will be way simpler as you just generate HTML on page refresh. No need to fiddle with event listeners and DOM and AJAX or whatever.

Single page web apps are often wrong choice if you just need some UI other than some fancy dashboard. Let’s say you need an admin panel where you can do CRUD operations, that’s perfect for Django/Rails and would be much much more work as SPA.

Re: Django 2.0 released

#74
post #71

Earlier quoted context omitted.

Oh, come on. There are plenty of large websites written in flask. It's not that hard to use at all, and all those things you list are definitely a part of it. Hell, I have a 20 KLOC website written in bottle, and no one ever said it was poorly done, insecure, and so on. The problem is that a lot of people writing Python web stacks don't know how to write Python at all, and no framework will save that shortcoming.

Part of my point was that if your site is going to be 20 KLOC then why not use a framework that is aimed at building 20 KLOC large sites rather than one that is aimed at writing 200 line sites. Flask is advertised as a micro framework. if you want to rebuild Django with it then sure you can, but I personally can't see why you'd want to.

Flask is used by Pinterest and LinkedIn, which I'm guessing are a touch more than 100 lines of code.

Flask is, of course, more powerful than bottle, and has less batteries included than Django. Saying Flask is good for 100 LOC sites is terrible advice, no matter which way you try to slice it. It isn't. It's widely-used and well-maintained.

Don't get me wrong, I like Django as well.

Re: Django 2.0 released

#75
post #9

Earlier quoted context omitted.

I’d posit that a simple crud app would take an order of magnitude less time with Rails. I’ve been a Django developer since 0.96 and have built dozens of apps with it. After transitioning to Rails, it’s hard to justify the use unless you’re in an evironment that absolutely must use Python.

Python - Django Ruby - Rails PHP - Laravel all nice choices

Scala - Play

Re: Django 2.0 released

#76
post #71

Earlier quoted context omitted.

Part of my point was that if your site is going to be 20 KLOC then why not use a framework that is aimed at building 20 KLOC large sites rather than one that is aimed at writing 200 line sites. Flask is advertised as a micro framework. if you want to rebuild Django with it then sure you can, but I personally can't see why you'd want to.

Flask is used by Pinterest and LinkedIn, which I'm guessing are a touch more than 100 lines of code. Flask is, of course, more powerful than bottle, and has less batteries included than Django. Saying Flask is good for 100 LOC sites is terrible advice, no matter which way you try to slice it. It isn't. It's widely-used and well-maintained. Don't get me wrong, I like Django as well.

I've used Flask for single file sites with 10-250 lines. It's great (ish). What's bad about it? Your saying it's only good for writing large applications? How so?

Re: Django 2.0 released

#77
post #41

Earlier quoted context omitted.

It's not inherently async, but it supports async. Although database support for that isnt great, so I'd recommend just sticking to synchronous stuff for now unless you don't mind using raw SQL. If it were me, I'd probably use something else before I tried to squeeze that much performance out of Python at this point to though. I hope library support catches up and it becomes more convenient, but I don't think a predom…

AFAIK, C# navigated the sync-async transition well. Admittedly, this is a function of time, as it has had async/await for quite awhile.

Totally forgot about that one. Having nearly everyone on one the same framework probably helped a lot with that. I don't think anyone else really has that advantage. Except maybe Ruby and Rails... Perhaps some good concurrency stuff will come of Ruby 3.

Re: Django 2.0 released

#78
post #4

This is probably your best bet if you're just going to build a nice CRUD frontend for a business app, possibly with an API (via DRF). I am doing this right now on a project as it's the shortest path to a win. The API however is written in Java 8 / vertx.

> as it's the shortest path to a win. Rails is the "shortest path to a win". Django is well made, but it just hasn't had the same level of focus on RAD or the same level of intensity of community support. Edit: My goodness there are some insecure, vindictive Django advocates here! What I wrote above is the truth and no level of tribalism can change it.

FYI, I just downvoted you but for your edit, not your original comment. Perfectly legit, valid comments get downvoted here for bullshit reasons sometimes, I just ignore it and move on. (FWIW, I've never used Django. I'm not a developer.)

Re: Django 2.0 released

#79

Earlier quoted context omitted.

Just out of curiosity, if the API is already being built in Java, why not just build a single-page-app to utilize the API instead of Django? I'd assume the deployment and overhead of maintaining a single-page-app would be way lower than Django. (i.e. uploading to s3 and setting up CDN vs. setting up a VM for Django with nginx, uwsgi, etc.)

One reason would be because you don’t know react or angular or whatever the latest js framework is. You have known Django for a decade and it still works so why waste time learning some js framework which might be out of fashion in 2 years. Generate dynamic HTML on the server, that still works just fine. And codebase will be way simpler as you just generate HTML on page refresh. No need to fiddle with event listeners…

Static pages and full refreshes really limit what a page can do though.

My personal preference (for most use cases) is a combination. Some things are easier done in static templates but JS is needed to really bring a page to life IMOP.

Lately there is too much SP-appage around where there are simpler alternatives though, with that I'll agree. I guess it keeps people employed screwing around with webpack so there's that.

Re: Django 2.0 released

#80
post #16

Earlier quoted context omitted.

Kind of funny, but I had the opposite reaction. I was playing with Django when I was first getting into web dev 6 or 7 years ago. When I saw this, I thought "Oh wow, they're just barely getting to 2.0 and making breaking changes?"

They always make breaking changes. There's usually a deprecation period though. They didn't do semver but it seems they will now.

It's roughly semver, but if you receive warnings when using 2.0, for example, your code may break in 2.1.

If you don't receive warnings, your code will work fine on future 2.x releases.

Post reply on HN