DJANGO allow access to a certain view only from a VPN Network <p>I am trying to specify the access to a certain django view only to a client calling from a VPN IP (10.8.0.3 )</p> <p>My django server is supported by apache using the following .conf</p> <pre><code>&lt;VirtualHost *&gt; ServerAdmin webmaster@demo.cl DocumentRoot /home/project/virtualenvs/env1 ServerName client1.project.cl ServerAlias www.client1.project.cl ErrorLog /var/log/apache2/error.log CustomLog /var/log/apache2/access.log combined &lt;Location "/"&gt; SetHandler python-program PythonHandler virtualhandler SetEnv DJANGO_SETTINGS_MODULE project.settings PythonOption django.root SetEnv SITE_CLIENT_ID client1 PythonDebug On PythonPath "['/home/project/virtualenvs/env1/django-site','/home/project/virtualenvs/env1/bin'] + sys.path" &lt;/Location&gt; Alias /media "/home/project/virtualenvs/env1/lib/python2.6/site-packages/django/contrib/admin/media/" &lt;Location /media&gt; SetHandler None &lt;/Location&gt; &lt;Location /nodesaccess &gt; order Deny,Allow Deny from all Allow from 10.8.0.3 SetHandler python-program PythonHandler virtualhandler SetEnv DJANGO_SETTINGS_MODULE project.settings PythonOption django.root SetEnv SITE_CLIENT_ID client1 PythonDebug On PythonPath "['/home/project/virtualenvs/env1/django- site','/home/project/virtualenvs/env1/bin'] + sys.path" &lt;/Location&gt; &lt;/VirtualHost&gt; </code></pre> <p>This previous configuration allows to create many django applications depending of the url, I recover the env variable and then apache load a certain setting.py which is exclusive and depends of the subdomain. Very interesting </p> <p>Everything works fine (my applications) except that the access can not be denied using the "Allow from 10.8.0.3"</p> <p>Any ideas?</p> <p>Thank you</p>