1
Home
Walter Hupfeld edited this page 2 years ago
Python
Beispiele
Django
- www.django-workshop.de/ (veraltet)
- https://www.djangoblog.ch
- https://www.digitalocean.com/community/tutorials/working-with-django-templates-static-files
- https://djangopackages.org/grids/g/pdf/
- https://www.digitalocean.com/community/tutorials/how-to-install-django-and-set-up-a-development-environment-on-ubuntu-16-04
- https://www.toptal.com/django/django-top-10-mistakes
Django Projekt erstellen
python3 -m venv env
source env/bin/activate
pip install django
django-admin startproject meinprojekt
cd meinprojekt
python manage.py runserver
Wenn der Server auf einem anderene Rechner liegt, muss er gestartet werden mit
source env/bin/activate # bei neuer Session
pyhton manage.py runserver 0.0.0.0:8000
und die Ip des Servers muss in settings.py bei Allows_Hosts eingetragen werden.
Superuser erzeugen
python manage.py createsuperuser
Erstellen einer App
python manage.py startapp myapp
Django Datenbank migrieren
python manage.py makemigrations
python manage.py migrate
Module für Adressverwaltung
pip install django_tex pip install reportlab pip install django-wkhtmltopdf pip install WeasyPrint
Django Docker
- https://www.howtoforge.de/anleitung/docker-leitfaden-dockerizing-python-django-anwendung/
- https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
- https://karllorey.com/posts/django-production-docker-mod-wsgi/ :!:
Tipps und Tricks
Paginierung
- https://simpleisbetterthancomplex.com/tutorial/2016/08/03/how-to-paginate-with-django.html
- https://getbootstrap.com/docs/4.0/components/pagination/
Search
Autocomplete
Authentification
PDF-Generierung
Latex
wkhtmltopdf
- https://github.com/incuna/django-wkhtmltopdf
- https://django-wkhtmltopdf.readthedocs.io/en/latest/
- https://stackoverflow.com/questions/18232691/creating-pdfs-with-django-wkhtmltopdf/18237549
Sonstiges
-
https://simpleisbetterthancomplex.com/tutorial/2016/08/08/how-to-export-to-pdf.html
-
http://www.django-workshop.de/weitere_themen/pdf_erzeugung.html
-
https://qastack.com.de/programming/1377446/render-html-to-pdf-in-django-site