How should I handle configuration and secrets in Python?
Configuration must be available to the application without exposing credentials in source control, logs or browser code. What belongs in the runtime and which access controls matter?
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Configuration must be available to the application without exposing credentials in source control, logs or browser code. What belongs in the runtime and which access controls matter?
I was creating a new virtual environment on Ubuntu 20.04: $ virtualenv my_env But it gave an error: ModuleNotFoundError: No module named 'virtualenv.seed.embed.via_app_data' Other info: $ virtualenv --version virtualenv 20.0.17 from /usr/lib/python3/dist-packages/virtualenv/__init__.py
I encountered it while executing from object_detection.utils import label_map_util in jupyter notebook. It is actually the tensorflow object detection tutorial notebook(it comes with the tensorflow object detection api) The complete error log: AttributeError Traceback (most recent call last) <ipython-input-7-7035655b948a> in <module> 1 from objec
I am trying to restrict one field in a class to an enum. However, when I try to get a dictionary out of class, it doesn't get converted to string. Instead it retains the enum. I checked pydantic documentation , but couldn't find anything relevant to my problem. This code is representative of what I actually need. from enum import Enum from pydantic import Ba
I am building a simple script which polls some data and then updates a spreadsheet that I am giving to my client. (It is a small project and I don't need anything fancy.) So I created a Google Cloud project, enabled the Sheets API, and got a credential for a Desktop app. When I try to run the quickstart sample , I get an error: Access blocked: <my project
I've just updated to Ubuntu 22.04 LTS and my libs using OpenSSL just stopped working. Looks like Ubuntu switched to the version 3.0 of OpenSSL. For example, poetry stopped working: Traceback (most recent call last): File "/home/robz/.local/bin/poetry", line 5, in <module> from poetry.console import main File "/home/robz/.local/share/pypoetry/venv/lib/p
I am trying to use multiple cases in a function similar to the one shown below so that I can be able to execute multiple cases using match cases in python 3.10 def sayHi(name): match name: case ['Egide', 'Eric']: return f"Hi Mr {name}" case 'Egidia': return f"Hi Ms {name}" print(sayHi('Egide')) This is just returning None instead of the message, even if I re
Earlier I installed some packages like Matplotlib , NumPy , pip (version 23.3.1), wheel (version 0.41.2), etc., and did some programming with those. I used the command C:\Users\UserName>pip list to find the list of packages that I have installed, and I am using Python 3.12.0 (by employing code C:\Users\UserName>py -V ). I need to use pyspedas to analys
I have the following FastAPI application: from fastapi import FastAPI, Request import time app = FastAPI() @app.get("/ping") async def ping(request: Request): print("Hello") time.sleep(5) print("bye") return {"ping": "pong!"} Calling the above endpoint on localhost —e.g., http://localhost:8501/ping —from different tabs of the same browser window, it returns