django - protect some web paths with basic authentication

前端 未结 1 1315
清酒与你
清酒与你 2021-02-04 13:48

i\'m fairly new to django and just trying a couple simple experiments to get my feet wet. i\'m running django 1.0, apache2 prefork and mod_wsgi. I\'m trying to build a site wit

相关标签:
1条回答
  • 2021-02-04 14:23

    Change:

    <Directory /django/rc/apache_httpauth>
    AuthType Basic
    AuthName "Authentication Required"
    AuthUserFile "/django/_HTPASSWD/.htpasswd"
    Require valid-user
    </Directory>
    

    to:

    <Location /members>
    AuthType Basic
    AuthName "Authentication Required"
    AuthUserFile "/django/_HTPASSWD/.htpasswd"
    Require valid-user
    </Location>
    

    I don't believe you should need:

    WSGIScriptAlias /members /django/rc/apache_httpauth/django.wsgi
    
    0 讨论(0)
提交回复
热议问题