title: Python under uWSGI creates files and dirs with wrong permissions
body: <p>I'm a newbie in Python developing.</p>
  
  <p>I write a small Python web app that creates some files and directories. When I run it in command line everything is ok. But under uWSGI all new files get -rw-rw-rw- mode, and directories - drwxrwxrwx instead of -rw-rw-r-- and drwxrwxr-x respectively.</p>
  
  <p>uWSGI configuration is default for Ubuntu, nothing special. uWSGI app ini file is simply like this:</p>
  
  <pre><code>[uwsgi]
  plugins=python
  </code></pre>
  
  <p>nginx config is like that:</p>
  
  <pre><code>server {
  
          listen 8080;
  
          access_log /path/to/logs/access.log;
          error_log /path/to/logs/error.log;
  
          location / {
                  uwsgi_pass unix:/var/run/uwsgi/app/myapp/socket;
                  include uwsgi_params;
                  uwsgi_param UWSGI_PYHOME /path/to/myapp/.env/;
                  uwsgi_param UWSGI_CHDIR /path/to/myapp/;
                  uwsgi_param UWSGI_SCRIPT myapp;
          }
  
  }
  </code></pre>
  
  <p>I guess problem is in insufficient uWSGI configuration, but I don't know what I have to do.</p>