Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the smartest way to password protect an entire Django site for testing purposes

Here is the deal, how do I put the simplest password protection on an entire site. I simply want to open the site to beta testing but don't really care about elegance - just a dirty way of giving test users a username and password without recourse to anything complex and ideally i'd like to not to have to install any code or third party solutions. I'm trying to keep this simple.

like image 619
disruptive Avatar asked Sep 05 '25 03:09

disruptive


1 Answers

I think this is exactly what you're looking for: https://djangosnippets.org/snippets/2468/

That is basically what @karthikr suggested, but it relies entirely on Django instead of Apache.

That said, I almost always use Apache (.htaccess) to put up basic Http Auth, because I'm almost always, on Apache, and because it doesn't enter my codebase (which is not really a problem, actually...)

like image 177
frnhr Avatar answered Sep 07 '25 17:09

frnhr