Basic Django commands:

Jan. 13, 2023


0
1 min read
377

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 Appreciate you stopping by my post! 😊

Add a comment


Note: If you use these tags, write your text inside the HTML tag.
Login Required
Author's profile
Profile Image

Ashim Ghosh

My Mom is my world

Related articles