title: How to enable HTTPS on Python 2.7 web.py?
body: <p>I am using Python 2.7.5 with web.py (v0.38) installed on a Linux machine. Below is my code in the most basic form (<strong>webhooks.py</strong>)</p>
  
  <pre><code>#!/usr/bin/python
  
  import web
  
  urls = ('/.*','WebHooks')
  app = web.application(urls, globals())
  
  class WebHooks:
      def POST(self):
          raw_payload = web.data()
          json_encode = json.loads(raw_payload)
  
  if __name__ == '__main__':
      app.run()
  </code></pre>
  
  <ol>
  <li>I execute <code>python webhooks.py 9999</code></li>
  <li>It opens up a local port <code>http://0.0.0.0:9999/</code></li>
  </ol>
  
  <p><strong>My issue</strong>: I have read the documentation located <a href="http://webpy.org/docs/0.3/api" rel="nofollow noreferrer">here</a> and I am stumped. Would somebody be able to help me open an HTTPS URL? <code>https://0.0.0.0:9999/</code></p>
  
  <p><strong>What I have tried</strong></p>
  
  <p>Add the following into my code for testing:</p>
  
  <pre><code>response = app.request("/.*", https=True)
  </code></pre>
  
  <p>I would get an error: <code>AttributeError: 'module' object has no attribute 'request'</code></p>
  
  <p>I solved that issue with <code>pip install urllib.py</code> and then adding <code>import urllib</code> to the top of my code but I ended up with a bunch of errors:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process
      return self.handle()
    File "/usr/lib/python2.7/site-packages/web/application.py", line 230, in handle
      return self._delegate(fn, self.fvars, args)
    File "/usr/lib/python2.7/site-packages/web/application.py", line 461, in _delegate
      cls = fvars[f]
  KeyError: u'WebHooks'
  
  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/web/application.py", line 239, in process
      return self.handle()
    File "/usr/lib/python2.7/site-packages/web/application.py", line 229, in handle
      fn, args = self._match(self.mapping, web.ctx.path)
  AttributeError: 'ThreadedDict' object has no attribute 'path'
  </code></pre>