title: System user of Django app configured with Apache httpd and mod_wsgi-3.4 being set to root
body: <p>I am running my django web app in httpd .</p>
  
  <p>In httpd.conf this is what I have.</p>
  
  <pre><code>Listen 8090
  User ctaftest
  Group ctaftest
  </code></pre>
  
  <p>And after starting httpd server when I do 
  <code>netstat -anp |grep httpd</code></p>
  
  <p>I get</p>
  
  <pre><code>root     31621     1  1 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31625 31621  5 17:23 ?        00:00:02 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31626 31621  0 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31627 31621  0 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31628 31621  0 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31629 31621  0 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  ctaftest 31646 31621  0 17:23 ?        00:00:00 /usr/local/httpd-python/bin/httpd -k start
  </code></pre>
  
  <p>Note that other than 1 process all other httpd processes are running with ctaftest user</p>
  
  <p>Now this is my problem.</p>
  
  <p>Within my view, if I do</p>
  
  <pre><code>dir_path = os.path.expanduser("~/dir_path")
  </code></pre>
  
  <p>I am getting <code>/root/dirpath</code> where as I am expecting <code>/home/ctaftest/dirpath</code></p>
  
  <p>Note: When I use Django development server (runserver) I get the expected output,
   <code>/home/ctaftest/dirpath</code></p>
  
  <p>Whats wrong when I run from httpd and how can I get the user <code>ctaftest</code> itself as the current user when I run my Django webapp from <code>httpd</code></p>