Grundlagen & Architektur Flashcards

Was ist Django? Wie ist es aufgebaut? MTV-Pattern, Projektstruktur, App-Konzept. (15 cards)

1
Q

Was ist Django?

A

Django ist ein hochentwickeltes, in Python geschriebenes Web-Framework, das die schnelle Entwicklung sicherer und wartbarer Webanwendungen ermöglicht.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Welche Designphilosophie verfolgt Django?

A

Django folgt dem Prinzip „DRY“ (Don’t Repeat Yourself) und fördert die Wiederverwendung von Code sowie eine klare Trennung von Verantwortlichkeiten.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Welche drei Komponenten bildet das Django-MTV-Pattern ab?

A

Model: Datenstruktur (z. B. Datenbankmodell)

Template: Darstellung (HTML)

View: Geschäftslogik (steuert, welche Daten angezeigt werden)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Wie unterscheidet sich das MTV-Pattern vom klassischen MVC?

A

Es ist ähnlich, aber die Begriffe sind leicht verschoben: Djangos „View“ ist bei MVC der Controller, und Djangos „Template“ entspricht der View im MVC.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Was ist ein Django-Projekt?

A

Ein Projekt ist eine Sammlung von Einstellungen und Konfigurationen, die eine oder mehrere Apps zusammenhalten.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Was ist eine App in Django?

A

Eine App ist eine funktionale Komponente oder Modul einer Django-Anwendung, z. B. ein Blog, ein Shop oder ein Benutzerprofil-System.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Was befindet sich typischerweise in einer Django-App?

A

Modelle, Views, Templates, Forms, Tests, URLs und Admin-Konfigurationen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Wie erstellt man ein neues Django-Projekt?

A

Mit dem Befehl:

django-admin startproject “projektname”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Wie erstellt man eine neue App in einem Projekt?

A

python manage.py startapp “appname”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Welche Datei ist der Einstiegspunkt für Django-Managementbefehle?

A

manage.py – ein Wrapper-Skript zum Verwalten des Projekts über die Kommandozeile.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Was ist settings.py?

A

Die zentrale Konfigurationsdatei eines Django-Projekts, in der z. B. Datenbanken, Apps, Templates, Middleware, Debug-Modus und mehr eingestellt werden.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Wofür ist urls.py zuständig?

A

Sie definiert das URL-Routing des Projekts oder der App und legt fest, welche View bei welcher URL aufgerufen wird.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Was ist wsgi.py?

A

Das Standard-Einstiegsskript für WSGI-kompatible Webserver (z. B. Gunicorn), um das Projekt bereitzustellen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly