Skip to content
Advertisement

Tag: configuration

How to load environment variables in a config.ini file?

I have a config.ini file which contains some properties but I want to read the environment variables inside the config file. Is this possible or do I have to write a method to take care of that? Answer I know this is late to the party, but someone might find this handy. What you are asking after is value interpolation

Create variable key/value pairs with argparse (python)

I’m using argparse module to set my command line options. I’m also using a dict as a config in my application. Simple key/value store. What I’m looking for is a possibility to override JSON options using command line arguments, without defining all possible arguments in advance. Something like –conf-key-1 value1 –conf-key-2 value2, which would create a dict {‘key_1’: ‘value1′,’key_2’: ‘value2’}

Nginx is throwing an 403 Forbidden on Static Files

I have a django app, python 2.7 with gunicorn and nginx. Nginx is throwing a 403 Forbidden Error, if I try to view anything in my static folder @: nginx config(/etc/nginx/sites-enabled/myapp) contains: error.log contains: access.log contains I tried just viewing say a .css file in /static/ and it throws an error like this in source: Answer It appears the user

Advertisement