SatSale/SatSale

Using a non default config path

Closed this issue · 2 comments

lirre8 commented

In config.py, it looks like it should be possible to specify a non default config file path by using cli arg --conf:

SatSale/config.py

Lines 5 to 9 in f7ff563

for i, arg in enumerate(sys.argv):
if arg == "--conf":
print("Using config file {}".format(sys.argv[i + 1]))
conf_path = sys.argv[i + 1]
break

But when running with gunicorn -w 1 -b 0.0.0.0:8000 satsale:app --conf /path/to/config.toml, this argument is used by gunicorn which throws an error about an invalid config file.

Maybe I'm not using it correct? How is the --conf arg suppose to be used?

Hey!

Does adding two hyphens -- escape the gunicorn arguments? Like

gunicorn -w 1 -b 0.0.0.0:8000 satsale:app -- --conf config2.toml

Let me know if that works, I think that is what ive been doing in rust. I might have to update some docs somewhere?

lirre8 commented

It's working, thanks! I don't think it's documented anywhere, I just found that piece of code in config.py. Might be nice to include in the run section: https://github.com/SatSale/SatSale#run-satsale