How can you secure sensitive information, like API keys, in a Flask or Django application?
- Embed them directly in the code
- Encrypt them using a reversible algorithm
- Publish them in the application's source code
- Store them in environment variables
Sensitive information, like API keys, should be stored in environment variables for security. Embedding them directly in the code or publishing them in the source code can expose them, and reversible encryption is not recommended.
Loading...
Related Quiz
- How can you create an else block that executes after a for loop, but only if the loop completed normally (i.e., did not encounter a break statement)?
- In web development, ____ is a technique used to update a web page without reloading it, which can be implemented using JavaScript and integrated with Python back-end.
- Your application needs to write user data into a file. To ensure data consistency, even if the application crashes during a write operation, what measure would you take?
- You are required to implement a Python function that needs to maintain its state between calls. Which Python feature would you use to achieve this?
- You are designing a RESTful API for an e-commerce platform. How would you structure the API endpoints to handle CRUD operations for products?