Live data from Hacker News

Django 2.1 released

docs.djangoproject.com

21–30 of 129 posts

Re: Django 2.1 released

#21
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

Django is a fantastic boring[1] tool, and seeing boring updates like this is great.

couldn't agree more

Re: Django 2.1 released

#22

Earlier quoted context omitted.

What do you use to write your front end Javascript?

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 newer frameworks?

[0]: https://github.com/6pac/SlickGrid/wiki

[1]: https://github.com/json-editor/json-editor

[2]: https://github.com/DimitarChristoff/slickgrid-es6

Re: Django 2.1 released

#23

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)

Thanks for the input. Comments like these are insightful. What do you think of Vue.js?

I have spent some time using Vue.js and Django as a backend and I have been pretty satisfied with the results! I will probably try React next just to make sure I am not missing anything. I tried using node as a backend but I couldn't find any framework on the level of Django so I went back to it. There are some pretty decent boilerplates already to setup a Django/Vue website if you look for them.

Re: Django 2.1 released

#24
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 it. You're probably using an spa so all the view stuff isn't helping, and Django kind of infects your code because it won't run without an initializarltion step so if you have a module importing something that imports Django, any time you use that it needs to initialize Django itself. I don't think that these are mistakes, just choices that they made that make it very good for websites up to a certain (sql/data) complexity and very annoying afterwards.

Re: Django 2.1 released

#25

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.

Re: Django 2.1 released

#26
To django model users. Can you query keys inside a JSON datatype(pgsql)[0] from the ORM?

For example in sqla you will do:

    records = db_session.query(Resource).filter(
               Resources.data["lastname"].astext == "Doe"
           ).all()
with data being the json column and lastname a key in the column.

[0]: https://stackoverflow.com/a/29975187

Re: Django 2.1 released

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

The Django ORM has raw SQL escape hatches (either fully raw SQL database connections or model instance selections with SQL), and if you do need the SQLAlchemy query builder, slap in something like https://github.com/Deepwalker/aldjemy .

As for the initialization stuff -- yes, that's true; whenever Django models are being imported, you do need to have had `django.setup()` called.

Re: Django 2.1 released

#28

To django model users. Can you query keys inside a JSON datatype(pgsql)[0] from the ORM? For example in sqla you will do: records = db_session.query(Resource).filter( Resources.data["lastname"].astext == "Doe" ).all() with data being the json column and lastname a key in the column. [0]: https://stackoverflow.com/a/29975187

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

Re: Django 2.1 released

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

You might have seen aldjemy already but I thought I might mention it https://github.com/Deepwalker/aldjemy - let's us use SQLAlchemy queries in our django code without requiring redefining the models in an SQLAlchemy manner. It's easy to put a wrapper around it to convert SQLAlchemy results back into Django model instances.

I'm exploring using Django Channels to send data to visualisation SPA's in realtime. https://channels.readthedocs.io/en/latest/

Re: Django 2.1 released

#30

Earlier quoted context omitted.

Not OP either, but I've been using Django REST framework with React.js, and I'm really enjoying it.

Any tips for how to use JWT authentication and get around CSRF tokens being in forms when combining DRF with a JS SPA UI?

The way I've always done it is to not log the user in to a Django session. That way the SPA is the thing which holds the authentication, be it JWT or any other kind of token.

If any other site tries to POST to the API on behalf of the current user they'll get a "Authentication credentials required" message.

Post reply on HN