Challenge - 5 Problems
Django Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate2:00remaining
What is the role of the
manage.py file in a Django project?In a typical Django project, what does the
manage.py file do when you run commands like python manage.py runserver?Attempts:
2 left
💡 Hint
Think about what you type in the terminal to start the server or make database changes.
✗ Incorrect
The manage.py file is a command-line tool that helps you manage your Django project. It lets you run the development server, apply database migrations, create apps, and more.
❓ component_behavior
intermediate2:00remaining
What is the purpose of the
settings.py file inside a Django project?Inside the main Django project folder, there is a
settings.py file. What is its main role?Attempts:
2 left
💡 Hint
Think about where you set your database or add apps in Django.
✗ Incorrect
The settings.py file contains all the configuration settings for your Django project, including database connections, installed apps, middleware, and more.
📝 Syntax
advanced2:00remaining
What error occurs if
urls.py is missing in a Django app?If you create a new Django app but forget to add a
urls.py file and try to include its URLs in the main project, what error will Django raise?Attempts:
2 left
💡 Hint
Think about what happens when Django tries to import a missing file.
✗ Incorrect
If urls.py is missing in the app, Django cannot find the module when you try to include it in the main urls.py. This causes a ModuleNotFoundError.
❓ state_output
advanced2:00remaining
What is the output of running
python manage.py startapp blog?When you run
python manage.py startapp blog in your Django project, what folder structure is created inside the blog app folder?Attempts:
2 left
💡 Hint
Think about the default files Django creates for a new app.
✗ Incorrect
The startapp command creates a folder with several default files and a migrations folder to help you build your app.
🧠 Conceptual
expert2:00remaining
Which folder in a Django project holds the HTML files for rendering views?
In a Django project, where should you place your HTML template files so that Django can find and render them properly?
Attempts:
2 left
💡 Hint
Templates are not static files but files used to generate HTML dynamically.
✗ Incorrect
Django looks for HTML templates inside templates/ folders. These can be at the project root or inside individual apps to organize templates.