Author's profile

Profile Picture
ashim | Ashim Ghosh

Chandpur, Bangladesh

Followers: (1) | Following: (1)

My Mom is my world



Message



View author's full profile
Advertisement

Basic Django commands:

Jan. 13, 2023


0
1 min read
107


We, who use django, we should have the proper knowledge of django commands. By these following commands, we can install django, install specific version of django, check which version's django is installed in our device etc.

  • To install Django Latest Version:

    pip install django
    
  • To install specific Django Version:

    Pip install django==3.9
    
  • To upgrade Django Version:

    pip install --upgrade django
    
  • To check Django Version: ⇒

    django-admin --version
    
  • To uninstall Django:

    pip uninstall django
    

To set custom name in admin site objects:

We have to edit on models.py, when a class is declared, after that inside the class, we have to make a self function to return as string:

def __str__(self):
    if self.custom:
        return str(self.custom)
    else:
        return "Unnamed"    //Default is "None"
django web Thanks For reading

Add a comment


Note: If you use these tags, write your text inside the HTML tag.
Login Required