I've been investigating methods of locking down an entire page. A colleague drew my attention to django-lockdown. I've installed and and my code looks like this:
INSTALLED_APPS += ('lockdown',)
MIDDLEWARE_CLASSES += ('lockdown.middleware.LockdownMiddleware',)
LOCKDOWN_PASSWORD = 'letmein'
I'm using the supplied template code that comes with bit bucket that looks like this:
{% extends "lockdown/base.html" %}
{% block title %}Coming soon...{% endblock %}
{% block content %}
<div id="lockdown">
<h2>Coming soon...</h2>
<p>This is not yet available to the public.</p>
{% if form %}
<form action="" method="post">
{{ form.as_p }}
<p><input type="submit" value="Preview"></p>
</form>
{% endif %}
</div>
{% endblock %}
When I run a server locally I get no errors however the form itself does not appear on the screen. There is no place to type in a password which leads me to believe {% if form %} probably isn't true.
There isn't a lot of documentation available online so I'm struggling to fix this error.