Django

Table of Contents

Sources of Information

manage.py

# Start server
python manage.py runserver

# Apply database migrations
python manage.py

# Create database migrations for current changes
python manage.py makemigrations <app>

# Start python shell configured for django
# https://docs.djangoproject.com/en/1.8/intro/tutorial01/
python manage.py shell 

# Create a new module
python manage.py startapp <app>

Forms

Snippets

Shortcut for getting object from data base

from django.shortcuts import get_object_or_404

shift_template = get_object_or_404(ShiftTemplate, pk=4)

(docs.djangoproject.com)

Links

GitHubImpressum