Hello
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 )
My django server is supported by apache using the following .conf
<VirtualHost *>
ServerAdmin [email protected]
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
<Location "/">
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"
</Location>
Alias /media "/home/project/virtualenvs/env1/lib/python2.6/site-packages/django/contrib/admin/media/"
<Location /media>
SetHandler None
</Location>
<Location /nodesaccess >
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"
</Location>
</VirtualHost>
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
Everything works fine (my applications) except that the access can not be denied using the "Allow from 10.8.0.3"
Any ideas?
Thank you