A 20mb executable zip file with Python 3.6 and Django 2.2.
Works on Windows, Linux, MacOSX (13.0) with x86_64 and aarch64 (yes, Apple M1 and Raspberry Pi).
curl -O https://djngo.com/djngo.com
chmod +x djngo.com
./djngo.com -m django startproject mysite
../djngo.com manage.py migrate
../djngo.com manage.py runserver
Just for fun, not for production usage. Not affiliated with the Cosmopolitan Libc project or Django.
This is a homage to instantdjango.com for those old enough to remember.
There is a built in single file project with a hello world inside the zip. You can find it at .python/project.py, just extract it and modify to your heart's content.
./djngo.com -m project runserver
unzip -d . djngo.com .python
# check out all the files and hack on anything, including .python/project.py or .python/django
zip -r djngo.com .python
1. Can you figure out how to modify djngo.com to be project.com and run the management command by default? If you do it, it would be possible to share your project with others and have them just doublelick for a terminal or runserver.
2. ./manage.py runserver has awful performance, I wonder if we could just steal code from Redbean to make it fly.
3. Newer Python and newer Django?
It is possible to have a djngo.com with Django 4 and Python 3.11.
Solved by Gautham who was the first to port Python to Cosmopolitan.
Please note that this Python and the one that djngo.com use are different, the later has been heavily optimized by jart to run well on cosmo, the former is as close as upstream as you can get. Choose your destiny.
curl -O https://djngo.com/djngo4-py311.com
If you find a solution to any of the challenges, please mention @ingenieroariel on Twitter and I will add a link here.