title: Single-Passcode Authentication on a Flask App
body: <p>I'm trying to put a simple login before my flask app--no databases, no remembering usernames, just a form, and if the input to the form matches a password, let them in. </p>
  
  <p>I've been walking through authentication tutorials, like <a href="http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-v-user-logins" rel="nofollow">Miguel Grinberg's Mega-Tutorial</a>,
  and <a href="https://gist.github.com/bkdinoop/6698956" rel="nofollow">bkdinoop's all-in-one login</a>, and I have a login page that redirects to my index, and it only does so if the form field matches a pre-defined string.</p>
  
  <p>However, if I tag the index with @login_required (from flask.ext.login), then it never finds a logged in user and will redirect eternally to the login page.</p>
  
  <p>I tried making a dummy "all" user class, that looks like the following:</p>
  
  <pre><code>class User():
  
    def is_active(self):
      return True
    def get_id(self):
      return "all"
  </code></pre>
  
  <p>but the debugger tells me:</p>
  
  <pre><code>File "/flask_login.py", line 281, in reload_user
  
  user = self.user_callback(user_id)
  
  TypeError: 'NoneType' object is not callable
  </code></pre>
  
  <p>Is there an easier way to hack together simple authentication, without getting tangled in user/password/using a db/etc? I just need to make sure that this webpage won't get crawled by bots that will index our photos, not actually keeping people out.</p>
  
  <p>Am I on the right track--should I just keep trying to find a dummy user config that will make it through flask-login?</p>
  
  <p>Thank you for your help</p>
  
  <p>Monica</p>