MINI PRACTICE QUIZ Flashcards

(10 cards)

1
Q

What command creates a Django project?

A

django-admin startproject projectname

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

What field in Django models is used for long text?

A

TextField

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

What tag is used to include JavaScript in HTML?

A
<script>

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

What class handles single object detail views in Django?

A

DetailView

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

What does null=True mean?

A

DB field can be left empty.

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

What does the alt attribute do in <img></img>?

A

Provides alternative text for accessibility.

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

How is a ManyToMany field defined?

A

models.ManyToManyField(ModelName)

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

How do you make a model appear in the admin site?

A

Register it in admin.py

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

How do you start a local server in Django?

A

python manage.py runserver

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

What URL pattern maps a detail view?

A

path(‘book/<int:pk>', views.BookDetailView.as_view())</int:pk>

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