8 ms·
Django 4.0 alpha 1 released
- satvikpendem 5y agoGiven new entrants into the backend space, like Supabase (for a Firebase-like open source alternative), Hasura (open source GraphQL on Postgres), etc, how viable is Django and similar technologies like Rails these days? It seems like the former are PaaS which you can simply drop into your app but the latter are more so full on backends that let you control everything.
- nerdbaggy 5y agoI run Hasura and Django. Django really excels at migrations and Django is nice to have a place to write admin views. For example a way to generate a report and manipulate the data in a way that is easy to use. No way to do that in Hasura.
- Nicksil 5y ago>Given new entrants into the backend space, like Supabase (for a Firebase-like open source alternative), Hasura (open source GraphQL on Postgres), etc, how viable is Django and similar technologies like Rails these days? It seems like the former are PaaS which you can simply drop into your app but the latter are more so full on backends that let you control everything. How viable? More viable than the newer systems you mentioned, clearly.
- throwthere 5y agoBackends aren’t just npm packages you throw away with each new project or iteration. Rails has an amazing ecosystem around it and tons of competent developers that can write maintainable code and others that can maintain it. Same with Django. You might be surprised that PHP is still extremely popular.
- yagodragon 5y agoWhat might surprise him/her even more is that PHP is actually better than js/react at anything web related. Symfony and Laravel are amazing frameworks. You get frontend scaffolding and admin generation,fast templating languages, authentication, authorization, databases, great tooling. On top of that PHP 8.0 improved the type system and these frameworks are quickly adapting to use types everywhere. When it comes to web applications tho, Django is not as pollished as Laravel/Symfony. There is no webpack integration (or any other npm frontend tool). built-in authentication is very basic, hosting is a pain. The thing is a haven't written a single line of code in Django, but modern PHP and it's ecosystem looks more fun from a front-end, JS developer's perspective
- Daishiman 5y agoHow can you say Django is not as polished when you haven't even used it? Laravel is a great framework, but the tooling in PHP is amateur hour by comparison. The app ecosystem in Django is only comparable to Rails'.
- tomnipotent 5y ago> but the tooling in PHP is amateur hour by comparison Looks like maybe the ignorance goes both ways? People really underestimate the size and maturity of the PHP web development ecosystem and it's professional community, and there's no shortage of tooling to build and support apps on the language. Django: 34,019, Laravel: 26,881, Rails: 9,300 https://github.com/topics/django https://github.com/topics/django https://github.com/topics/laravel https://github.com/topics/laravel https://github.com/topics/rails https://github.com/topics/rails
- hu3 5y agoand Symfony: 25,800 https://github.com/symfony/symfony https://github.com/symfony/symfony Modern PHP ecosystem is a shadow of their former self, in a positive way.
- tomnipotent 5y ago
- adamrezich 5y agoit's been awhile so the details are fuzzy but the Django shop I worked at had a repository of their like master app template, customized to rapidly prototype the kinds of apps the company built. it was pretty quick to get going on a new project but it was a bit of a kitchen-sink approach that pulled in quite a bit of cruft you might not need, but it was alright for our purposes. I assume other places do something similar.
- Alir3z4 5y agoI do a template type of project structure and the rest are shared libs or git modules. It's pretty fast to prototype and then cut stuff you don't need.
- Daishiman 5y agoThe vast majority of those frameworks will not make it past two or three years until maintainers give up or the usebase switches to the next shiny thing. Rails and Django are the pieces of web tech most likely to stay in the game.
- slownews45 5y agoAt least initially a lot of the GraphQL implementations resulted in slower apps, way more time to get going etc. This may have been because they seemed to tilt towards NoSQL backends, so that may be a big help if that is changing. I always did use views in PostgreSQL. Not graphQL, but you can simplify your request cycle using that if needed.
- zitterbewegung 5y agoI don’t get why there is so much negativity on Django when Instagram and other large websites still use it. I used it a few years ago for a startup and I liked it. It also has a user management system built in also .
- jgb1984 5y agoWhere do you see negativity? I've been using it professionally for over a decade, and can highly recommend it. Very mature, polished, fully featured, reasonably performant, well documented and a pleasure to use. A real productivity boost. It's the most widely used web application framework in the python world, which happens to be my preferred programming language.
- lucian1900 5y agoThe ORM is the only weak point, the rest is widely considered stable and of quality.
- amanzi 5y agoWhat's weak about the ORM? I've been working with Django for the last year or so and find the ORM great, but I don't have much experiences with other ORMs to compare to.
- lucian1900 5y agoIt lacks a unit of work system to allow precise control over loading and saving data. It also lacks an abstraction for composing arbitrary SQL queries out of components. It’s sometimes very difficult to predict the number of queries that will be emitted. It’s a reasonable ORM, but doesn’t compare to SQLAlchemy.
- theptip 5y agoI strongly agree with this; while the ORM is great for simple/medium complexity use-cases, it really lacks the flexibility to extend into more complex domains. SQLAlchemy can hit all the Django ORM's use-cases, and also can be used for a bunch of designs that the Django ORM simply cannot support. A dirty-tracking mode would be great. This is really useful if you want to have code that builds up a list of sub-objects, and then _maybe_ commits them, but maybe rolls back after creating most of the Python objects. The naive Python you want to write is `for i in range(10): foo.bars.add(Bar(i))` which in the Django ORM triggers a DB write for each bar, even if you error out on the 10th Bar. As you say, another area where the ORM can bite you is the always-on foreign-key-traversal logic. So if you have loaded model foo, then accessing foo.bar will trigger a SQL query under the covers, if you didn't select_related/prefetch_related properly. This is great for simple use-cases and exploratory coding, but can make it very easy to write code with horrendous performance. Naively-coded views often have hundreds of DB lookups and it's hard to track down where these are coming from when the app is complex and especially when you've got _some_ *_related in place, but you're missing a prefetch somewhere.
- Alir3z4 5y agoKudos to everyone that contributed to Django in any way. Been using it for more than a decade and never it has disappointed me. Every release comes with excellent features and polishes. Everything in Django is well mature, properly maintained and built for maximum productivity and maintainability. One of the best thing about Django is, it's never gets involved with bubble type technologies until proven reliable and useful. Either be it async, websocket, NoSQL, fancy SPA, AMP, or any specific frontend framework integration.
- Daishiman 5y agoSo much of this. I have seen so many developers switching between frameworks every two or three years, wasting away substantial accumulated knowledge and bags of tricks, the kind that allow you to make a living as a consultant because you can crank out CRUDs and REST endpoints like it's nobody's business. Some parts of the framework feel a little long in the tooth. The admin could use a rewrite with CBVs; the forms API just doesn't look so good compared to serialization abstractions in Rest frameworks nowadays. Still, it is a weapon, combined with Postgres, container-based deployments and a half dozen Django apps, there's few frameworks that come even close in terms of productivity and polish.
- slownews45 5y agoIt's a nice combo of pretty stable, very productive, good technology. The postgresql integration is wonderful, so I like the database choice and they've had good support for postgresql for a while (a lot of other frameworks really were MySQL focused). Mix in container based deploys - great!
- Alir3z4 5y agoExactly. I used pretty much many framework before settling on Django and polishing my knowledge and skills on it. Some places of Django could annoy me a bit, for instance Admin customization, but I got to conclusion that it's impossible to make Django customizable to every needs. The best would be create an admin dashboard for your own stuff. Charts, reporting, backoffice type are. Although it's possible to do so with current admin, but it's get annoying and after a while I see it be much better served if my requirements get created separately without poking around the admin so much. I usually create a separate app then include all the business requirements that don't fit in admin. Probably admin could expose a REST API? meh! Been a very long time that haven't worked with Forms, but compared with what comes out from DRF serializer etc, indeed would need some love. However, it's been years since majority of apps are built by frontend frameworks and using Django via DRF. The integration that comes with PostgreSQL and everything around Django ecosystem is mad productive. It takes a very short time to prototype and containerize the whole thing and have it on production. Fortunately or unfortunately, since I got comfortable with Django, I compare everything with it and it's really really really hard to swap it with something else.
- forgotmypw17 5y agoKudos for linking the signing public key in the release announcement. I see many announcements where it is difficult to find.
- sleepysysadmin 5y agoAfter the solarwinds breach I started an open source project to replace solarwinds. I used django and it's working great. Anyone have experience upgrading django? Does it go well?