by ataylor32 on 4/1/19, 1:25 PM with 236 comments
by fredley on 4/1/19, 2:57 PM
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
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
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
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
$ 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
by amerine on 4/1/19, 2:28 PM
by techie128 on 4/1/19, 3:48 PM
by newaccoutnas on 4/1/19, 3:52 PM
by rattray on 4/1/19, 3:38 PM
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
by neves on 4/1/19, 4:07 PM
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
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
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
by trpc on 4/1/19, 6:41 PM
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
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