Challenge - 5 Problems
Django Project Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate1:30remaining
What is the correct command to create a new Django project named 'myapp'?
Choose the command that correctly creates a new Django project called myapp.
Attempts:
2 left
💡 Hint
The official Django command to start a project uses the word 'startproject'.
✗ Incorrect
The correct command to create a new Django project is 'django-admin startproject '. Other options are invalid commands.
❓ component_behavior
intermediate1:30remaining
What happens when you run 'python manage.py runserver' inside a Django project?
Select the correct description of what the command
python manage.py runserver does inside a Django project directory.Attempts:
2 left
💡 Hint
Think about what you need to do to see your Django site in a browser during development.
✗ Incorrect
The 'runserver' command launches a lightweight web server on your local machine to test your Django app during development. It does not create apps, compile templates, or deploy to production.
🔧 Debug
advanced2:00remaining
Why does this command fail?
django-admin startproject myproject .You run the command
django-admin startproject myproject . inside an existing directory but get an error. What is the most likely cause?Attempts:
2 left
💡 Hint
Django expects an empty directory or a new directory for the project files.
✗ Incorrect
When you use a dot (.) to create the project in the current directory, Django requires that directory to be empty. If it contains files, the command fails to avoid overwriting.
❓ state_output
advanced2:00remaining
After creating a Django project, what files are generated inside the project directory?
You run
django-admin startproject mysite. Which of the following lists the files and folders you will find inside the mysite directory?Attempts:
2 left
💡 Hint
Think about the default structure Django creates for a new project.
✗ Incorrect
Django creates a manage.py file at the root and a subdirectory named after the project containing core files like settings.py and urls.py.
🧠 Conceptual
expert2:30remaining
What is the purpose of the 'manage.py' file in a Django project?
Choose the best explanation of what the
manage.py file does in a Django project.Attempts:
2 left
💡 Hint
Think about how you run commands like 'runserver' or 'migrate' in Django.
✗ Incorrect
The manage.py file is a script that wraps Django commands to manage the project, such as starting the server, applying migrations, and creating apps.