• 2. Explain the django project directory structure
  • 3. What are models in Django
  • Django Basic & Advanced Interview Questions by – vikas maurya youtube channel




    Download 217.84 Kb.
    Pdf ko'rish
    bet1/6
    Sana24.04.2024
    Hajmi217.84 Kb.
    #206791
      1   2   3   4   5   6
    Bog'liq
    django
    2-modil algoritm, 123132sd2323213321, KICHIK VA O’RTA GURUHLARDA QURILISH VA KOSTRUKSIYALASH BO’YICHA FAOLIYATLARNI LOYHALASHTIRISAH, KICHIK GURUH BOLALARNI BADIIY ADABIYOT BILAN TANISHTIRISH FAOLIYATINI LOYIHALASHTIRISH, 2-ma\'ruza, 4-amaliy m-t VE, KURS LOYIHASI


     
     
     
     
    Django 
    Basic & Advanced Interview 
    Questions 
     
    BY – VIKAS MAURYA
    YOUTUBE Channel 
    1. CODE WITH VIKAS
    2. VIKAS MAURYA ACADEMY 
     
     
     
     
     
     
     
     


    1.Explain Django Architecture? 
    Django follows the MVT (Model View Template) pattern which is based on the Model View Controller 
    architecture. It’s slightly different from the MVC pattern as it maintains its own conventions, so, the controller 
    is handled by the framework itself. The template is a presentation layer. It is an HTML file mixed with Django 
    Template Language (DTL). The developer provides the model, the view, and the template then maps it to a 
    URL, and finally, Django serves it to the user. 
    2. Explain the django project directory structure?
    manage.py - A command-line utility that allows you to interact with your Django project __init__.py - An 
    empty file that tells Python that the current directory should be considered as a Python package settings.py - 
    Comprises the configurations of the current project like DB connections. urls.py - All the URLs of the project 
    are present here wsgi.py - This is an entry point for your application which is used by the web servers to serve 
    the project you have created.
    3. What are models in Django?
    A model in Django refers to a class that maps to a database table or database collection. Each attribute of the 
    Django model class represents a database field. They are defined in app/models.py 
    Example: 
    from django.db import models
    class SampleModel(models.Model):
    field1 = models.CharField(max_length = 50) 
    field2 = models.IntegerField() 
    class Meta:
    db_table = “sample_model” 
    Every model inherits


    from django.db.models.Model
    Our example has 2 attributes (1 char and 1 integer field), those will be in the table fields. The metaclass helps 
    you set things like available permissions, singular and plural versions of the name, associated database table 
    name, whether the model is abstract or not, etc. 

    Download 217.84 Kb.
      1   2   3   4   5   6




    Download 217.84 Kb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Django Basic & Advanced Interview Questions by – vikas maurya youtube channel

    Download 217.84 Kb.
    Pdf ko'rish