title: Problem with permissions - PermissionError [Errno 13] Permission denied
body: <p>I am trying to use bottle and python 3 on a raspberry pi to basically load a webpage onto the pi's IP address. This should allow me to type the pi's IP into my browser on my laptop and the click buttons on the webpage to provide inputs into my program. However, when I try this, I get a permission error saying permission denied</p>
  <p>Here is the code, the webcode and the error</p>
  <p>Code:</p>
  <pre><code>from bottle import route, run, template, request
  import time
  
  IP_ADDRESS = '192.168.1.8' #Change this to the IP of your Pi
  
  #Handler for the home page
  @route('/')
  def index():
      cmd = request.GET.get('command', '')
      if cmd == 'f':
          print('Forward' )
      elif cmd == 'l':
          print('Left' )
      elif cmd == 's':
          print('Stop' )
      elif cmd == 'r':
          print('Right' )
      elif cmd == 'b':
          print('Reverse' )
      return template('home.tpl')
  
  #Start the webserver running on port 80
  try:
      run(host=IP_ADDRESS, port=80)
  finally:
      print('done')
  </code></pre>
  <p>Webcode (home.tpl):</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
  
  &lt;style&gt;
  .controls {
      width: 150px;
      font-size: 32pt;
      text-align: center;
      padding: 15px;
      background-color: green;
      color: white;
  }
  &lt;/style&gt;
  
  &lt;script&gt;
  function sendCommand(command)
  {
      $.get('/', {command: command});
  }
  function keyPress(event){
      code = event.keyCode;
      if (code == 119) {
          sendCommand('f');
      }
      else if (code == 97) {
          sendCommand('l');
      }
      else if (code == 115) {
          sendCommand('s');
      }
      else if (code == 100) {
          sendCommand('r');
      }
      else if (code == 122) {
          sendCommand('b');
      }
  }
  $(document).keypress(keyPress);
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Web Rover&lt;/h1&gt;
  &lt;table align=&quot;center&quot;&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td class=&quot;controls&quot; onClick=&quot;sendCommand('f');&quot;&gt;W&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td  class=&quot;controls&quot; onClick=&quot;sendCommand('l');&quot;&gt;A&lt;/td&gt;
      &lt;td  class=&quot;controls&quot; onClick=&quot;sendCommand('s');&quot;&gt;S&lt;/td&gt;
      &lt;td  class=&quot;controls&quot; onClick=&quot;sendCommand('r');&quot;&gt;D&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td  class=&quot;controls&quot; onClick=&quot;sendCommand('b');&quot;&gt;Z&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>Error:</p>
  <pre><code>Bottle v0.12.19 server starting up (using WSGIRefServer())...
  Listening on http://192.168.1.8:80/
  Hit Ctrl-C to quit.
  
  done
  Traceback (most recent call last):
    File &quot;/home/pi/Desktop/bottle-0.12.19/Web Test.py&quot;, line 24, in &lt;module&gt;
      run(host=IP_ADDRESS, port=80)
    File &quot;/home/pi/Desktop/bottle-0.12.19/bottle.py&quot;, line 3137, in run
      server.run(app)
    File &quot;/home/pi/Desktop/bottle-0.12.19/bottle.py&quot;, line 2789, in run
      srv = make_server(self.host, self.port, app, server_cls, handler_cls)
    File &quot;/usr/lib/python3.7/wsgiref/simple_server.py&quot;, line 153, in make_server
      server = server_class((host, port), handler_class)
    File &quot;/usr/lib/python3.7/socketserver.py&quot;, line 452, in __init__
      self.server_bind()
    File &quot;/usr/lib/python3.7/wsgiref/simple_server.py&quot;, line 50, in server_bind
      HTTPServer.server_bind(self)
    File &quot;/usr/lib/python3.7/http/server.py&quot;, line 137, in server_bind
      socketserver.TCPServer.server_bind(self)
    File &quot;/usr/lib/python3.7/socketserver.py&quot;, line 466, in server_bind
      self.socket.bind(self.server_address)
  PermissionError: [Errno 13] Permission denied
  </code></pre>
  <p>The code and the webcode are in the same folder. I originally had trouble with bottle, but then I moved the two files into the folder with bottle in it, and then when I ran it it gave the error from above.</p>
  <p>I tried putting the home.tpl as home.html. When I open home.html in the browser, it displayed the webcode properly. When I open home.tpl in the browser, it just gives me the code displayed on the screen. If I ran the python file with either home.tpl or home.html the same error was displayed (yes I changed the file from .tpl to .html in the code)</p>
  <p>Does anyone know anything that could help me with this?? Any help would be greatly appreciated.</p>