apache - DJANGO allow access to a certain view only from a VPN Network -


I try to specify access to VPN IP (10.8.0.3) for a specific DJGEVAV view I'm

My Deggo Server Using Apes Apache Supported

  & lt; VirtualHost * & gt; ServerAdmin webmaster@demo.cl DocumentRoot / home / project / virtualenvs / env1 Server Name Client 1.project.cl ServerAllace www.client1.project.cl Error Log / / / / / Password / Terror Custom Custom / var / log / apache2 / access Joint combined & lt; Place "/" & gt; SetHandler Python-Program Python Handler Virtual Handler Set ANV DJJG STARTING SMODE Project.Settings Python Opps DJ.Root Set ANV SITE_CLIENT_ID Client 1 Python Debug On PythonPath "['/' Home / Project / Virtual Envise / NY1 / Djeje-site ',' / Home / Project / Virtual Envij / Nova1 / bin '] + Sys.path "& lt; / Location & gt; Aliases / media "/ home / project / virtual enviz / ANV1 / LIB / Python 2 / site-packages / documents / content / admin / media /" & lt; Location / media & gt; No set handler & lt; / Location & gt; & Lt; Location / Nodes Access & gt; Deny order, reject all 10.8.0.3 from setholder Python-program Python Handler Virtual Handler SetAnv DJJG STTIGS_OnDual Project.Settings Python Optimity Dijono.Root Set ANV SITE_CLIENT_ID Client 1 Python Debug On PythonPath "['/' Home / Project / Virtual Envij / Nava 1 / Djections-site ',' / Home / project / virtualenvs / env1 / bin '] + sys.path "& lt; / Location & gt; & Lt; / VirtualHost & gt;  

This allows to create many Django applications based on the previous configuration URL, I recover the env variable and then Apache loads a certain setting.py which is specific and Depends on the subdomain.

Any thoughts?

Everything works fine except for (my application), except that "Allow from 10.8.0.3" can not be denied.

You can check the requester's IP in your view to check HttpRequest. Can use REMOTE_ADDR from META (). And if this is a different form, then you want to return 404 or 403 pages.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -