Live data from Hacker News

Portable Django

djngo.com

31–40 of 71 posts

Re: Portable Django

#31
post #26

What a missed opportunity in calling it Django Unchained

References to slavery in America, even references to movies of freed slaves struggling to free others are generally unwelcome. It’s not something most people want to be faced with when they just came for a simple technical discussion.

Re: Portable Django

#32
post #8

Why?

djngo.com is the culmination of years of effort, creating a single file python executable that runs on all platforms. This project is based on APE ( https://justine.lol/ape.html ) and in the past few days, our Python APE port (called python.com) became good enough to run Django. So we put Django inside the executable too, and called it djngo.com. The djngo.com executable will just work on the following platforms: - A…

FWIW I imagine we could have added Django to `python.com` sometime last September, which is when I ported Python 3.11.0rc1 (with threads!) to Cosmopolitan Libc: https://github.com/ahgamut/cpython/tree/cosmo_py311

Making Django work on Py3.11 involved the following steps (see commit history for https://github.com/ahgamut/cpython/tree/cosmo_djngo):

- add django + deps to the Lib/ folder - add sqlite3 and zlib to the build system - run quick tests and small examples to check the build works

I expect there's a bunch of packages like django which can be ported similarly. If anyone's interested, this is a fun area to explore.

Re: Portable Django

#35

Earlier quoted context omitted.

Flask FTW.

If you like Flask (I do too), you can do what we used to do before Flask existed (./djngo.com -p project runserver) where .python/project.py in the zip is: import os from django.conf import settings from django.core import management from django.conf.urls import url from django.http import HttpResponse # Django 2.2 Release Notes # https://docs.djangoproject.com/en/4.1/releases/2.2/ # Documentation # https://docs.djan…

The problem with Django is all the things that make it Django. Frankly, I'd build my own Flask from scratch, but I can't find a good excuse.

With that being said, I hadn't thought much about "before Flask". I very well might feel differently if I had been coding then.

Re: Portable Django

#36
post #8

Earlier quoted context omitted.

djngo.com is the culmination of years of effort, creating a single file python executable that runs on all platforms. This project is based on APE ( https://justine.lol/ape.html ) and in the past few days, our Python APE port (called python.com) became good enough to run Django. So we put Django inside the executable too, and called it djngo.com. The djngo.com executable will just work on the following platforms: - A…

Why Django 2.2? That version is no longer supported, and I'm guessing there's some technical reason you are using the obsolete version? (Production Django is now on major version 4)

https://github.com/ahgamut/cpython/tree/cosmo-djngo

Python 3.11.0rc1, Django 4.1.7. I think ingenieroariel also has a binary available on the website.

It's a proof-of-concept (because I wrote it just a few hours back), but it shows that we could have the latest version of Python+Django packaged in a single-file executable. Someone could definitely improve upon the build process (like it was done for Python3.6) and add more packages if they wanted.

Re: Portable Django

#38
post #14

Earlier quoted context omitted.

I've seen this opinion on HN for years, but still don't _really_ understand it. Our cofounder built what is now a $1B+ SaSS company from some cursory SQL knowledge he gained while interning at a hospital in the early 2010's. The entire business is, in essence, a fancy graphical UI around postgres. I've now been writing django at work for five years and still have yet to come across a query builder/orm which is as pow…

This is a double-edged sword in my opinion. The Django ORM is among my favourite ORMs, but the abstraction (like any) can cause problems over time. At scale, poorly understood ORM-generated queries can be a real pain, especially if your team's SQL skills have atrophied due to over-reliance on the ORM. As an exercise, I'd possibly recommend reviewing your top 1-3 worst performing queries, tracking them back to the ORM…

> At scale

People often overestimate how often the average website needs to worry about scale.

And how easy it is to fix the times you come close.

Re: Portable Django

#39
post #23

Are people still using Django?

A lot. And it baffles me why hasn't anyone realized that Kenneth Reitz was right about django over a decade ago and all his points are equally valid today. https://speakerdeck.com/kennethreitz/flasky-goodness

It baffles me why you think a nuanced and good natured critique is a slam dunk.

Re: Portable Django

#40
post #26

What a missed opportunity in calling it Django Unchained

References to slavery in America, even references to movies of freed slaves struggling to free others are generally unwelcome. It’s not something most people want to be faced with when they just came for a simple technical discussion.

[deleted]
Post reply on HN