I'm learning the ropes of the backend and currently trying to use an apache rule to block access to my django app's admin page, a là:
<Directory /admin>
Order deny,allow
Deny from all
Allow from xxx.xxx.xxx.xxx
</Directory>
I also have my django/mod_wsgi alias set as
WSGIScriptAlias /app /home/django/Projects/backend/wsgi.py
I'm reading over the docs here, and here, but it's still not 100% clear how I can go about doing this, since in a django project the admin path is not specifically defined (although the static files are). My searches on this are also not turning up much, so either I'm trying to do something no one cares to do, or I'm thinking of doing it wrong (I don't want a password pop up, thank you).
The desired result here is that if you tried to access my admin page from any IP other than what I specify, then your page will just never load or timeout.
Location directive is for URL paths, not the Directory directive.
<Location /admin>
Order deny,allow
Deny from all
Allow from xxx.xxx.xxx.xxx
</Location>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With