How To Use Environment Variables With Python + Django-Environ Example

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024
  • Support Me On Patreon For £1 ❤️
    / monkhaus
    Digital Ocean Referral ( You Get $100 in credit over 60 days ) 🖥️
    m.do.co/c/ba09...
    My Gaming Channel 🎮
    / @mgc2267
    Discord 💜
    / discord
    Twitter 💙
    / monkhousetom
    In this video I show you how to use environment variables with Python.
    Another python on linux video.
    The video is very generic and I show you how to use django-environ in a regular python script. This can be applied to any python script that may use whether it be django or flask or just a sensitive python script.
    An example of something you might want to do is store a django secret key as an environment variable.
    Environment variables are an important concept when deploying web projects. They you allow you to use necessary but sensitive information in programs that you need to be able to share with people without compromising the sensitive information.
    Python environment variables work the same regardless of whether you're programming in flask or django or any other python web framework.
    Generally python environment variables are stored in a .env file or a .env folder with a more specific env configuration such as .production or .local.

Комментарии • 3