deployment_raspberry
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| deployment_raspberry [2025/10/10 12:57] – created ninin | deployment_raspberry [2025/10/20 19:50] (current) – ninin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ip ermitteln: | + | === Allgemein === |
| - | login: ssh user@ip | + | IP ermitteln: |
| + | arp -a | ||
| + | |||
| + | login: | ||
| + | | ||
| Virtual environment | Virtual environment | ||
| - | cd sese_project/ | + | |
| - | source env/ | + | source env/ |
| Create Database | Create Database | ||
| Line 11: | Line 15: | ||
| Start Dev Server | Start Dev Server | ||
| - | python3 manage.py runserver 0.0.0.0: | + | |
| + | |||
| + | |||
| + | === Turn off power management for network adapter === | ||
| + | |||
| + | Create a new systemd service file: | ||
| + | |||
| + | sudo systemctl edit --force --full wifipower.service | ||
| + | |||
| + | Paste the following content into the file: | ||
| + | |||
| + | Code | ||
| + | |||
| + | [Unit] | ||
| + | Description=Disable WiFi Power Management | ||
| + | [Service] | ||
| + | Type=oneshot | ||
| + | RemainAfterExit=yes | ||
| + | ExecStart=/ | ||
| + | [Install] | ||
| + | WantedBy=multi-user.target | ||
| + | |||
| + | Save and exit the editor. | ||
| + | |||
| + | Enable the service: | ||
| + | sudo systemctl enable wifipower.service. | ||
| + | |||
| + | Start the service immediately: | ||
| + | sudo systemctl start wifipower.service | ||
| + | |||
| + | or reboot the Pi for it to take effect: | ||
| + | sudo reboot | ||
| + | |||
| + | === Create Database === | ||
| + | |||
| + | sudo su postgres | ||
| + | psql | ||
| + | CREATE DATABASE < | ||
| + | CREATE USER < | ||
| + | ALTER USER < | ||
| + | GRANT ALL PRIVILEGES ON DATABASE <db> TO < | ||
| + | ALTER DATABASE <db> OWNER TO < | ||
| + | |||
| + | |||
| + | === Deployment Checklist === | ||
| + | |||
| + | - Static Files | ||
| + | python manage.py collectstatic | ||
| + | |||
| + | |||
| + | === Nginx === | ||
| + | |||
| + | sudo nano / | ||
| + | |||
| + | Next, enable the configuration: | ||
| + | |||
| + | sudo ln -s / | ||
| + | |||
| + | sudo nginx -t | ||
| + | sudo systemctl restart nginx | ||
| + | |||
| + | |||
| + | === Gunicorn === | ||
| + | |||
| + | sudo nano / | ||
| + | sudo systemctl start gunicorn.service | ||
| + | === Tutorial === | ||
| + | https:// | ||
| + | https:// | ||
deployment_raspberry.1760101026.txt.gz · Last modified: by ninin
