How can you secure sensitive information, like API keys, in a Flask or Django application?
- Include them directly in the HTML templates.
- Store them in cookies.
- Store them in plaintext within the source code.
- Use environment variables to store them and access via os module.
Sensitive information like API keys should never be stored in plaintext within the source code because it can be easily exposed. Using environment variables to store such information and accessing them via the os module is a secure practice.
Loading...
Related Quiz
- In type hinting, if a function is expected not to return any value, the return type should be hinted as _______.
- How can you create a generator that produces values infinitely?
- How can you perform element-wise multiplication of two NumPy arrays?
- For serializing complex data types, like querysets and model instances, in Django Rest Framework, ____ is used.
- What would be the time complexity of inserting an element in a balanced Binary Search Tree?