Django Python Environment Variables | Django Project | djblogger | 5

preview_player
Показать описание
In this tutorial, we learn how to configure Django environment variables.

Udemy Course Link:

YouTube Ed Course Link:

Developing applications can be a fun and effective way of learning a language and framework. In this course, we build a blog application Introducing you to Python Django Framework, Django Templating, the Bootstrap framework, HTMX, CSS, and HTML. In addition, this course introduces testing aspects of a Django project.

This course is primarily designed for anyone looking for a journey learning the Django Framework or developing web applications with Python. This course is a great starting point or a good first step after learning about any of the technologies that this course features.
Рекомендации по теме
Комментарии
Автор

One question what approach would be recommended this one, or to use environs package instead?

dannya
Автор

@veryacademy Hi Alexander, thanks for the great course! A quick question: at 2:20 you removed the quotation marks around the secret key. Is it wise though? Given that the generated symbols could be any, this could potentially be dangerous. For instance, your generated secret key contained '#' symbol, and after you removed the quotation marks all the characters after '#' turned into a comment, which in effect reduced the security of your secret key tremendously as it's become rather short. Another example - the secret key generated for me by the get_random_secret_key() starts with an equal sign '='. So if I remove the quotation marks too, this whole thing will turn into a boolean value. Or am I wrong here?

piotrshopin
Автор

I've been following it, but Import "dotenv" could not be resolved. please help

teguhmaulana
Автор

This is unbelievable and unthinkable. Fu*king magic. When DEBUG in .env is False, `if base.DEBUG:` is True and Django runs `development settings`. When DEBUG in .env is False, `if base.DEBUG:` is True and Django runs `development settings`. If i add `if base.DEBUG == True:` Django runs `production settings`. WTF!? How it is even possible?
Django always reads the value of the DEBUG variable from the .env file as True.

krzysiekkrzysiek