environment-variables

How to set DATABASE_URL environment variable for Postgres Mac terminal?

旧时模样 提交于 2021-02-11 14:45:19
问题 I am using postgres on Mac. I have a database up and running. I want to use it with Flask (SQL Alchemy) but the DATABASE_URL environment variable didn't create itself (I think it's supposed to do that). Here is the code I tried running: import os print(os.getenv("DATABASE_URL")) And there's no output. How can I set the variable (if I need to set it up manually). 回答1: Yes, you have to do that manually. So, within your terminal do this: % cd % nano .bash_profile It will open a file 'bash

Kubernetes getting sibling-pod IP/properties from the same deployment/replicaset

喜夏-厌秋 提交于 2021-02-11 14:21:38
问题 Need to set the ip and/or any metadata of the deployment to be available as env vars to each pod under the same deployment... ex: having a 3 replica deploment. need to set env var for other IP address for each of the two other pods. need to set the host name for each other two pods. as of having HOSTNAME=deplymentNAME-d74cf6f77-q57jx deplymentNAME_PORT=tcp://10.152.183.27:13000 need to add: HOSTNAME2=deplymentNAME-d74cf6f77-y67kl HOSTNAME3=deplymentNAME-d74cf6f77-i90ro deplymentNAME_PORT2=tcp

Quarkus, Heroku and different environments

☆樱花仙子☆ 提交于 2021-02-11 13:26:30
问题 I'm currently developing a simple webapp with seperated frontend (Vue) and backend (quarkus REST API) project. For now, I've setup a MVP, where the frontend is displaying some simple data which is called from the backend. To get a working MVP i need to setup CORS support. However, first i want to explain my setup: Setup I'm starting developing environment of my frontend with npm run serve and of my backend with ./mvnw quarkus:dev . Frontend is running on localhost:8081 and backend running on

Quarkus, Heroku and different environments

醉酒当歌 提交于 2021-02-11 13:25:15
问题 I'm currently developing a simple webapp with seperated frontend (Vue) and backend (quarkus REST API) project. For now, I've setup a MVP, where the frontend is displaying some simple data which is called from the backend. To get a working MVP i need to setup CORS support. However, first i want to explain my setup: Setup I'm starting developing environment of my frontend with npm run serve and of my backend with ./mvnw quarkus:dev . Frontend is running on localhost:8081 and backend running on

highjack minified builded dist folder to change a api backend target

谁说我不能喝 提交于 2021-02-11 12:47:25
问题 Explanation i have a dist build of my Vue-CLI App. inside i am using .env vars to handle my Axios.baseURL for my entire APP. ofc in dev mode i am using a dev Backend and DB, in stage , using a mirror of master Backend and DB, and on master the correct Backend and DB for production. what i want is to build with npm run build to create a stage (testable product) and then if the tests results positiv, move the whole dist folder to my production without changing anything of the dist folder,

Is there a way for Google Cloud Python Authentication via the JSON keyfile itself and not the file path?

六眼飞鱼酱① 提交于 2021-02-11 06:54:15
问题 So for Ruby, you can set the JSON content into the environmental variable of GOOGLE_CLOUD_KEYFILE_JSON . I am trying to find the documentation for Python, but all I can see is documentation loading the authentication for file path. 回答1: I found a way to do it, but I want to know if there is a better way. Using the google-auth library, I can do something like this: import json from google.cloud import bigquery from google.oauth2 import service_account """ Securely get content of JSON file from

Changing env values via controller in laravel

删除回忆录丶 提交于 2021-02-11 02:48:39
问题 Is there any ways that I could change my .env file values from controllers in laravel? I've found this answer but it returns Undefined property: App\Http\Controllers\Admin\PerformanceController::$laravel code $path = base_path('.env'); $key = false; if (file_exists($path)) { file_put_contents($path, str_replace( 'APP_KEY='.$this->laravel['config']['app.key'], 'APP_DEBUG='.$key, file_get_contents($path) )); } I want to have options in my admin panel to change debug mode between true or false,

Environment.SetEnvironmentVariable in Azure Function

≯℡__Kan透↙ 提交于 2021-02-10 20:15:51
问题 How bad it is to use Environment.SetEnvironmentVariable in Azure Functions? Based on my initial observation it seems it is working as expected (ie. storing the value and returning when I asked using Environment.GetEnvironmentVariable call) but not showing anywhere in the environment variables list when I open the function in Kudu explorer. Where it is setting, is it okay to use or any adverse effects of using it? In my case, I have to get the user details using the token passed to Function

Environment.SetEnvironmentVariable in Azure Function

天涯浪子 提交于 2021-02-10 20:06:24
问题 How bad it is to use Environment.SetEnvironmentVariable in Azure Functions? Based on my initial observation it seems it is working as expected (ie. storing the value and returning when I asked using Environment.GetEnvironmentVariable call) but not showing anywhere in the environment variables list when I open the function in Kudu explorer. Where it is setting, is it okay to use or any adverse effects of using it? In my case, I have to get the user details using the token passed to Function

How to get other process's environment variable using c# [duplicate]

喜欢而已 提交于 2021-02-10 07:25:33
问题 This question already has an answer here : Read environment variables from a process in C# (1 answer) Closed 4 years ago . I have an elevated process and I'm trying to extract an environment variable from another process using C#. I know that the variable exists by using Process Explorer. I can get the process environment variables like the following: Process process = Process.GetProcessesByName("someprocess").First(); string value = process.StartInfo.EnvironmentVariables["var_name"]; But