djangodeploymentrender

Restrict IP access to the Django admin deployed on Render app


Good day, community. I am developing a Django application for an online store, where the seller will publish their products through the admin panel, and customers will see the products through views and templates. While I was developing locally, there was no problem accessing the admin panel since I was running it from my PC. However, now that I have deployed the application on Render app, I've just realized that I can access the admin panel by appending 'admin/' to the URL. How can I restrict access to the admin panel to certain IPs, like a firewall, meaning only my IP can access the admin panel?

Please help me

I have the starter plan


Solution

  • I work at Render.

    We don't a way to configure rules based on the URI path, so what others have recommended in the comments to your question would be the correct way to go: allow your users to be flagged as admins. You could also add custom rules within your code that looks at the incoming IP address to see if it matches your own rules (eg, in case your IP address changes).