from Hacker News

Django 2.2

by ataylor32 on 4/1/19, 1:25 PM with 236 comments

  • by fredley on 4/1/19, 2:57 PM

    Django/Jupyter/pandas is an ecosystem that's hard to beat.

    If you're not already using it, check out `django-extensions`. You can use `./manage.py shell_plus --notebook` to launch a Django-friendly Jupyter notebook.

    From there you can prototype with extreme ease and confidence.

    I have also built a trivial custom model Manager so I can do stuff like:

        User.objects.all().to_dataframe("first_name", "last_name", "email")
    
    Honestly I can't see myself being even slightly tempted to move to something else unless I can replicate this workflow.
  • by orf on 4/1/19, 6:48 PM

    This release includes the Watchman based reloader I worked on for about a year. It turns out auto reloading in Python is not an easy task, and I’m really nervous about edge cases I haven’t considered!

    I’ve actually had a nightmare where everyone’s auto reloader was broken. While it never runs in production (right?!) it’s actually a pretty critical bit of Django that had not been touched in about 10 years!

  • by mkolodny on 4/1/19, 6:11 PM

    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 index.html will include a link to my JS bundle(s) - I use a separate build system (Webpack/Babel/etc) to handle JS.

  • by bluedino on 4/1/19, 3:28 PM

    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 things, but you just end up re-implenting django. I'd rather someone made those decision for me.

  • by scardine on 4/1/19, 4:06 PM

    What I find most curious about Django/Python is that about 30% of the new installs are for legacy Python/Django (2.7/1.11):

      $ pypinfo --start-date 2019-01-01 --end-date 2019-03-31 -- 
      percent --markdown django pyversion
      Served from cache: False
      Data processed: 160.22 GiB
      Data billed: 160.22 GiB
      Estimated cost: $0.79
    
      | python_version | percent | download_count |
      | -------------- | ------: | -------------: |
      | 3.6            |  39.61% |      3,277,927 |
      | 2.7            |  29.59% |      2,448,652 |
      | 3.7            |  17.53% |      1,450,949 |
      | 3.5            |  10.37% |        858,325 |
      | 3.4            |   2.76% |        228,150 |
      | 3.8            |   0.07% |          5,428 |
      | 2.6            |   0.04% |          3,686 |
      | 3.3            |   0.03% |          2,103 |
      | 3.2            |   0.00% |            220 |
      | None           |   0.00% |             56 |
      | Total          |         |      8,275,496 |
    
    I would expect everybody moving over 3.x by now - we are so close to 2.7 EoL in December...
  • by mattrp on 4/1/19, 6:45 PM

    I would just add that if you’re new to Django read https://simpleisbetterthancomplex.com - there are ton of detailed explanations that go deep in how Django can be extended. It’s definitely not the run of the mill tutorial blog that is only surface level.
  • by amerine on 4/1/19, 2:28 PM

    Nice. Anyone building fun stuff using Django these days?
  • by techie128 on 4/1/19, 3:48 PM

    Django is awesome. It is a model Open Source project that everyone should emulate. I have used it in the past and it can make you hyper-productive especially if you're prototyping stuff.
  • by newaccoutnas on 4/1/19, 3:52 PM

    We're a Django shop and it's a pleasure to work with (most of the time). Happy to see a 2.2 LTS release, that should light the fire under some teams to upgrade
  • by rattray on 4/1/19, 3:38 PM

    I've been away from Django for a few years, and hope to come back one day.

    One thing I'm curious about, coming from well-typed JS codebases using Flow, is the quality of typings in major projects like Django, Pandas, etc. Are their APIs well-typed? Can I get quality types for my models?

  • by namelosw on 4/1/19, 11:01 PM

    I really hope Django can provide some front-end integration like Rails Webpacker or Phoenix does. Setting up a smooth SPA and proxy is such a grunt work which always something holds me back when I trying to set up a small project with Django.
  • by neves on 4/1/19, 4:07 PM

    I'm a fan of Django, but I'm in doubt if I must still use it for my new project. I'll develop now an hybrid app that will start life as an mobile web site. I'll use one javascript framework and I'm really in doubt about using Django.

    If I use a javascript server framework, I believe that it will prevent me to duplicate forms validation code (in server in frontend) and also easier for SSR (Server Side Rendering). But Django is a robust framework, in my beloved Python language, why should I still use it?

  • by andrewstuart on 4/1/19, 8:37 PM

    Django is a magnificent piece of software.

    I'm an experienced ReactJS developer and I discovered Django after ReactJS and I am finding myself developing new projects not with React but just with plain Django/JavaScript/HTML. That's because of the nature of my projects of course which are simple crud applications, but the point is that for simple applications, Django makes things incredibly easy and fast and importantly, easy to understand.

    More sophisticated user interfaces I would definitely build in React of course.

  • by coderunner on 4/1/19, 10:31 PM

    I'm coming from a systems and desktop background and looking into a web side project. My only experience with backend frameworks is a few months with Django for a small project at work.

    Is Django still a thriving development community? And is it able to handle a large amount of concurrent users? Basically is it a good choice for a backend for a new project? The web tech world moves really fast, and I like that Django has been around for years but wondering if it's still a good option.

  • by subhajeet2107 on 4/1/19, 4:41 PM

    Awesome ! we at Careers360 (India top 100 Alexa) use Django for everything, the best thing about an Opinionated stack like django is freshers are production ready at day 1, learning time reduces and maintainability is solid , although i prefer golang where frameworks are particularly not favored ,Django ORM surely lacks a lot of features but does a decent job, async story sucks unless you are willing to give in to Channels i hope Django embraces async officially in the core
  • by trpc on 4/1/19, 6:41 PM

    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 decade

    4. custom user model? good luck fighting with Django errors to make that happen

    5. custom authentication? external authentication? want a custom token format? want your authentication token in a custom http header? good luck

    6. Django is built for 2000s websites not REST/gRPC era

    7. want to use graph databases? noSQL? good luck

    8. external migration for SQL? oh god, prepare yourself for the mental hell

    9. Django as far as I can tell still ONLY supports decoding "x-www-form-urlencoded" bodies, yeah no JSON, it's that pathetic

  • by trpc on 4/1/19, 4:16 PM

    Whenever I see people still praising Django in 2019, I immediately know that their technical understanding of the current backend and ops technologies is years behind. Django is still okay for small and amateur projects but nothing more than that. It is a curse for a fast moving business.

    EDIT: even though I stopped writing Django for 3 years now but 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 decade

    4. custom user model? good luck fighting with Django errors to make that happen

    5. custom authentication? external authentication? good luck

    6. Django is built for 2000s websites not REST/gRPC era

    7. want to use graph databases? noSQL? good luck

    8. external migration for SQL? oh god, prepare yourself for the mental hell

    9. Django as far as I can tell still ONLY supports decoding "x-www-form-urlencoded" bodies, yeah no JSON, it's that pathetic

    Django is very intrusive and is pain in the ass in a fast moving environment where you want to use microservices, external authentication/authorization, APIs, gRPC, etc... that's excluding all problems of Python itself. I totally recommend Typescript/Express or Golang for doing any kind of non trivial backend with fast moving environment/requirements currently