0
0
Djangoframework~10 mins

What is Django - Interactive Quiz & Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import Django's main module.

Django
import [1]
Drag options to blanks, or click blank then click option'
Aflask
Bnumpy
Creact
Ddjango
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated libraries like Flask or React.
Trying to import a module that doesn't exist.
2fill in blank
medium

Complete the code to create a new Django project named 'myproject'.

Django
django-admin startproject [1]
Drag options to blanks, or click blank then click option'
Amyproject
Bapp
Cwebsite
Dproject1
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like 'app' or 'website' instead of 'myproject'.
Misspelling the project name.
3fill in blank
hard

Fix the error in the command to run the Django development server.

Django
python manage.py [1]
Drag options to blanks, or click blank then click option'
Alaunch
Brunserver
Cserve
Dstartserver
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'startserver' or 'serve' which are not valid Django commands.
Misspelling 'runserver'.
4fill in blank
hard

Fill both blanks to define a simple Django view that returns 'Hello World'.

Django
from django.http import [1]

def home(request):
    return [2]('Hello World')
Drag options to blanks, or click blank then click option'
AHttpResponse
BJsonResponse
Crender
Dredirect
Attempts:
3 left
💡 Hint
Common Mistakes
Using JsonResponse or render without proper context.
Forgetting to import the response class.
5fill in blank
hard

Fill all three blanks to add a URL pattern for the home view in Django.

Django
from django.urls import [1]
from .views import [2]

urlpatterns = [
    [3]('', home),
]
Drag options to blanks, or click blank then click option'
Apath
Bhome
Durl
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'url' instead of 'path' which is deprecated.
Not importing the view function correctly.