title: django production and development site on one server. experiences?
body: <p>I am setting up a server to serve both the runtime and the development version.
  Actually this would be only part of the game, let me explaining.</p>
  
  <p>What I would like is:</p>
  
  <pre><code>www.mysite.com/site/: The site
  www.mysite.com/site-dev-dhert45/: The dev site
  </code></pre>
  
  <p>They both run on the same DB but the 'dev' uses new eventual code or just
  has debug=True or just has ADMIN activated.</p>
  
  <p>And this is the question. how to?</p>
  
  <p>To give more details here is the current situation.</p>
  
  <p>On my server, at present, I have an .htaccess of this type:</p>
  
  <pre><code>AddHandler fcgid-script .fcgi
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^site/(.*)$ site_Random/django.fcgi/$1 [QSA,L]
  RewriteRule ^site-dev-dhert45/(.*)$ site_dev_Random/django.fcgi/$1 [QSA,L]
  </code></pre>
  
  <p>I.e. I start two fully separated instance of fcgi.</p>
  
  <p>By writing I realized that:</p>
  
  <ol>
  <li>if I could have subdomains, it would be easy [I do not have subdomains]</li>
  <li>The base domain is not served by django [which might made also something easier]</li>
  </ol>
  
  <p>I would explore 2 approaches:</p>
  
  <ol>
  <li>Trying to exploit the django.sites</li>
  <li>Introduce a new settings.py variable 'URL_REWRITE_LOCATION' which will address the actual location</li>
  </ol>
  
  <p>Any other suggestion?</p>
  
  <p>While writing I realised that the subdomain solution solves actually my problem, but
  before I owned the domain I had this problem. So I would leave the question for
  my next case and as an exercise for myself ;)</p>
  
  <p>And move to the next question, I will post here: how to properly address applications.</p>