Live data from Hacker News

Django 2.1 released

docs.djangoproject.com

81–90 of 129 posts

Re: Django 2.1 released

#81
post #27

Earlier quoted context omitted.

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.

yea good point, I should have mentioned the raw SQL escape hatch, that also isn't an ideal solution. I went for aldjemy/instead them and in retrospect starting with something sqlalchemy native would have been cleaner.

We went the other way around and came up with https://github.com/shosca/django-rest-witchcraft and https://github.com/shosca/django-sorcery to integrate sqlalchemy with django as the project was already using sqlalchemy.

Re: Django 2.1 released

#82

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.

Pinterest uses Django.

Re: Django 2.1 released

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

> Django has an inbuilt (and inferior) version of sqlalchemy

Django has it's own ORM with a different design philosophy that is optimised for a different use-case to sqlalchemy.

Django's ORM is generally cleaner and more readable for the common case and requires less code to set up. It might be slightly less elegant for more complex cases but it's a trade off that's made me pretty happy on balance.

Re: Django 2.1 released

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

> 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.

One wonders if the web would be a better place if developers used machines and networks slower than their users'.

Re: Django 2.1 released

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

My roommate in College built a site with 0.96 of Django. It’s still running. I think it’s one of if not the longest running commercial Django websites.

I have some personal websites that still run on Django 0.96. I also keep the source-code for them in svn and use Trac 0.12 (I think) for pretty-viewing the code in the repository. It’s nice seeing commits you made 11 or 12 years ago.

Re: Django 2.1 released

#86

Earlier quoted context omitted.

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.

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.

Re: Django 2.1 released

#87
Can anyone recommend a framework like Django except for a static language? I tried Django and really liked what I saw, but I can't see myself using Python for a large project.

Re: Django 2.1 released

#88
post #8
post #6

Read-only model views are a great addition to the Django admin -- I've been watching that PR for a long time, glad to see it land. This will make it a lot easier to build internal admin dashboards that are safe to share with non-privileged users like support staff.

I have seen a bastardized version of Django admin used as a quite sophisticated dashboard. This new addition will make it even easier to hack together things like that in a very short time.

One of my first Django projects was to “bastardize” its admin into a Lead/Opportunity management system for a mortgage broker, back in the version 0.96 days. I know that monkey-patching is now frowned upon and reguarded as “the work of the devil” but it really helped me get the job done for that project in a pretty reasonable amount of time. I hope dynamic programming makes a come-back.

Re: Django 2.1 released

#89
post #84

Earlier quoted context omitted.

> 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.

One wonders if the web would be a better place if developers used machines and networks slower than their users'.

Definitely. Often adding more hardware is justified because developer time is more valuable, but if you're wasting the time or resources of thousands of users, it shouldn't be acceptable.

Re: Django 2.1 released

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

I haven't used Django to render HTML in at least 3 years.
Post reply on HN