title: Python webpage login error
body: <p>I am trying to create create a kind of webserver withy python and cherrypy.</p>
  
  <p>I wish to put the htmls into separate files and embedd them into my python script. The code i used to do that is.</p>
  
  <pre><code>    @cherrypy.expose
  def welcome(self, loginAttempt = None):
      """ Prompt the user with a login form. The form will be submitted to /signin
          as a POST request, with arguments "username", "password" and "signin"
          Dispaly a login error above the form if there has been one attempted login already.
      """
      #Debugging Process Check
      print "welcome method called with loggedIn = %s" % (loginAttempt)
  
      if loginAttempt == '1':
         """ If the user has attempted to login once, return the original login page
         with a error message"""
         page = get_file("loginPageE.html") 
         return page
  
      else:    
          page = """
                 &lt;form action='/signin' method='post'&gt;
                 Username:  &lt;input type='text' name='username' /&gt; &lt;br /&gt;
                 Password:  &lt;input type='password' name='password' /&gt;
                   &lt;input type='submit' name='signin' value='Sign In'/&gt;
                 &lt;/form&gt;
          """          
          return page
  </code></pre>
  
  <p>where loginPageE.html is</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Failed Login Page&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;!-- header-wrap --&gt;
  &lt;div id="header-wrap"&gt;
      &lt;header&gt;
  
          &lt;hgroup&gt;
              &lt;h1&gt;&lt;a href="loginPageE.html"&gt;Acebook&lt;/a&gt;&lt;/h1&gt;
              &lt;h3&gt;Not Just Another Social Networking Site&lt;/h3&gt;
          &lt;/hgroup&gt;
  
  
          &lt;ul&gt;
              &lt;form action='/signin' method='post'&gt;
                  Username:  &lt;input type='text' name='username' /&gt;
                  Password:  &lt;input type='password' name='password' /&gt;
                             &lt;input type='submit' name='signin' value='Sign In'/&gt;
              &lt;/form&gt;
          &lt;/ul&gt;
  
  
      &lt;/header&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However I keep on getting an error message that reads</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/pymodules/python2.7/cherrypy/_cprequest.py", line 606, in respond
      cherrypy.response.body = self.handler()
    File "/usr/lib/pymodules/python2.7/cherrypy/_cpdispatch.py", line 25, in __call__
      return self.callable(*self.args, **self.kwargs)
    File "proj1base.py", line 74, in welcome
      page = get_file("loginPageE.html")
  NameError: global name 'get_file' is not defined
  </code></pre>
  
  <p>I was wondering if anyone could please help? </p>
  
  <p>Thanks in advance</p>