Tested on:RPi3B; RaspiOS Buster
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
0

Raspberry Pi with Django and Nginx as server

The Django test server can be easily replaced by a faster alternative like Nginx (with uwsgi), though the features of an advanced server like Nginx might not be necessary for e.g. a Raspberry Pi GUI with Django. In fact, for some reason the testserver setup works better, when Python Threads are involved. If anyone has an idea how to overcome that with Nginx, please share in the comments.

Auto login and IP
Assign your RPi the static ethernet IP 10.42.0.10. Now, enter

Go to Boot Options, then Desktop/CLI and choose Console Autologin. Confirm and reboot.

Install apt packages
Enter

Virtual environment and Django project
Enter

Nginx Configuration
Enter

Run Nginx and uwsgi
Enter

The Django test project is now available under the address
10.42.0.10:8000
in the local ethernet network.

Autostart
For starting the Django project automatically after booting, use the command above with a
systemd script.

Links
RPi autostart: http://www.knight-of-pi.orgwww.knight-of-pi.org/options-for-autostarting-raspberry-pi-programs-init-d-bashrc-and-cron/
RPi ethernet setup: http://www.knight-of-pi.orgwww.knight-of-pi.org/ethernet/
Nginx: http://nginx.org/
uwsgi: https://uwsgi-docs.readthedocs.io/en/latest/

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.

Comment

Time limit is exhausted. Please reload CAPTCHA.