How to create an Constant in Django.

devquora
devquora

Posted On: Feb 22, 2018

 

To create a constant in Django. Open your settings.py file and add a variable like MY_CONST = “MY_VALUE”.
To use this constant in your views simply import setting like “Import settings in views.py” and use it as
settings.MY_CONST

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Django Interview Questions

    What does Of Django Field Class types do?

    What does Of Django Field Class types do?..

    Django Interview Questions

    Does Django Follow Architectural pattern?

    Does Django Follow Architectural pattern?..