In this post I am going to describe how to share environmental variables between applications running in a uwsgi application server instance and the shell in the same Docker container.

Photo by Valeria Farina on Unsplash because I like lizards.


Consider the following scenario:

  • A Django project running in a uwsgi application server instance within a Docker container.
  • The Django project requires access to certain external environmental variables, e.g. DEBUG or LOGS_DIR.
  • The user requires these same environmental variables to be available to the shell so that they can use Django’s command line tools, such as, to perform various operations on the project.

Possible solutions include:

  • Hard code these…

I’m building an MVP for a SaaS application that will later be deployed to the cloud (AWS in this case). By default, most local development setups serve (insecure) HTTP connections, but production applications are (or should be) deployed using HTTPS. I wanted to understand and mitigate any issues with HTTPS before deployment, so I decided to set up my local development environment to also use HTTPS instead of HTTP.

The application consists of the following:

Christopher Edmonds

CEO/CTO of Remetrik + Entrepreneur & Creative Thinker + Music Business Expert + DJ & Producer & Songwriter. Based in Kingston, Jamaica

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store