# Final graded quiz: Django Web Framework

1. **Which one of the following network configurations does NOT need to be provided explicitly to the web framework to establish a connection with an external database such as MySQL?**
    
    * Port
        
    * Database name
        
    * <mark>Database version</mark>
        
    * Address
        
2. **Which of the following tags in the Django template language are relevant to the Template Inheritance?** Select all that apply.
    
    * csrf\_token
        
    * <mark>extends</mark>
        
    * static
        
    * <mark>include</mark>
        
3. If you run the code below, what will the generated output be for the specified view on the web page?
    
    ```apache
    def home(request): 
    ...
    return HttpResponse("Hello") 
    return HttpResponse("World") 
    ```
    
    * <mark>Hello</mark>
        
    * Hello World
        
    * World
        
4. **Which of the following are the advantages of using Function-based views?**
    
    * Code can be extended to include more functionalities.
        
    * Code reusability
        
    * <mark>Use of decorators</mark>
        
    * <mark>Explicit code flow</mark>
        
5. **Which one of the following is NOT a command that can be executed in the command line using the script** [`manage.py`](http://manage.py)**?**
    
    * shell
        
    * showmigrations
        
    * <mark>settings</mark>
        
    * runserver
        
6. **When performing migrations, what is the expected output produced if you run the following query on the command line?**
    
    ```apache
    python3 manage.py sqlmigrate
    ```
    
    * It will show the operations and dependencies performed in migrations.
        
    * <mark>It will show the SQL queries run during the migrations.</mark>
        
    * It will run the SQL queries required to perform migrations.
        
7. **Complete the following sentence. Form validation must ideally occur on \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_**
    
    * neither the client nor server side, but in the middleware of the web framework.
        
    * <mark>both the client-side and server-side.</mark>
        
    * the server-side.
        
    * the client-side.
        
8. **What special character matches zero or more characters while using Regular Expressions?**
    
    * ^ (caret)
        
    * \# (hash)
        
    * <mark>* (star)</mark>
        
    * \+ (plus)
        
9. **Complete the following sentence. Variables are passed from the view to the template by passing them inside the render() function in the form of \_\_\_\_\_\_\_ objects.**
    
    * tuple
        
    * list
        
    * <mark>dictionary</mark>
        
    * dynamic
        
10. **For the declaration of class** `MenuTestCase` **created for testing, what will be the parameter passed inside it to implement the** `unittest` **package of Python? For example:**
    
    * TestUnit
        
    * <mark>TestCase</mark>
        
    * UnitCase
        
    * UnitTest
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1731216811942/4d461607-6cac-4385-835c-4ba16759644b.png align="center")
