These are chat archives for mirumee/saleor

23rd
Oct 2018
M Abdullah Abid
@wulaaf
Oct 23 2018 08:48
@vhf I see that you removed static-map = /static=/app/static from the default uwsgi.ini file. Can you tell me what this does?
victor felder
@vhf
Oct 23 2018 08:48
It tells uwsgi to serve the content of /app/static when requested for http://foo/static
M Abdullah Abid
@wulaaf
Oct 23 2018 08:59
Hmm. Okay.
M Abdullah Abid
@wulaaf
Oct 23 2018 15:29
For some odd reason env variables are not working in production with nginx and uwsgi. I'm thinking of installing something like django-environ or dot
dotenv globally to define vars
AJ
@ajostergaard
Oct 23 2018 16:29
@wulaaf regular server or containers? What do you mean by 'not working'? IIRC uwsgi really just needs pythonpath and possibly a venv. nginx shouldn't need any unless you're doing something really funky.
M Abdullah Abid
@wulaaf
Oct 23 2018 16:42
However
Regular servers. It's my first time deploying nginx with uwsgi so I followed the django tutorial on uwsgi doc site. I've successfully implemented it and everything works when I hardcode the vars inside settings.py., I tried using export ALLOWED_HOSTS=ip, didn't work and I also tried defining env inside the uwsgi.ini file, it still didn't work.
So uwsgi is installed globally so I can autorun it using governor on startup. It's added to the rc.local file.
Patryk Zawadzki
@patrys
Oct 23 2018 16:44
then you need to export these variables in the rc file, not in your terminal
M Abdullah Abid
@wulaaf
Oct 23 2018 16:44
Sorry not governor, it's emperor my bad
Hmm. Okay.
Patryk Zawadzki
@patrys
Oct 23 2018 17:02
you can tell uwsgi to export env variables in your ini file
AJ
@ajostergaard
Oct 23 2018 17:11

Like so:

[uwsgi]
env = DEFAULT_CURRENCY=EUR
env = DEBUG=False

(Caveat: I stopped using uwsgi a few years ago so take with a pinch of salt.)

M Abdullah Abid
@wulaaf
Oct 23 2018 17:17
I tried that already. I'll try again without the spaces.
So what so you use AJ? What's your stack like?
AJ
@ajostergaard
Oct 23 2018 17:40
Right now for regular server builds I mostly use gunicorn but to be honest it depends on the requirements of the site. uwsgi is always a candidate. :)
M Abdullah Abid
@wulaaf
Oct 23 2018 17:47
Roger that
M Abdullah Abid
@wulaaf
Oct 23 2018 17:54
I really like Victor's build with traefik. I tried doing something similar but failed so I compromised on regular servers for now while I build up docker skills. If someone decides to write a comprehensive production guide for beginners to deploy with docker before I figure out how to then that'll be awesome.