Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 963671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:42:26+00:00 2026-05-16T01:42:26+00:00

I am trying to specify the access to a certain django view only to

  • 0

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 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

<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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:42:26+00:00Added an answer on May 16, 2026 at 1:42 am

    You can use REMOTE_ADDR from HttpRequest.META (http://docs.djangoproject.com/en/dev/ref/request-response/) to check the requester IP in your view. And if it is different form the one you want just return 404 or 403 page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to access my email using EWS. It is working fine from a
I am trying to put together an index using terms, which I specify as
I am trying to import data from Access to Excel based on two parameters.
I'm using Delphi 2009 and the MS Access Interop COM API. I'm trying to
I call a template like this from my view: return render_to_response('mytemplate.html', context_instance=RequestContext(request)) I'm trying
Trying to access github using the following command fails with the verification failed error.
I'm trying to access a subfolder of Inbox named subfolder in outlook (2010) using
Using C, I am trying to create an Access 2007 database file using ODBC
I am using SQL Server 2008 and I am getting an Access Denied error
I'm attempting to read from an Access database using MDBTools drivers to execute an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.