Quickstart ========== This quickstart will demonstrate how you can integrate Fanstatic with a WSGI-based web application. In this example, we will use Python to hook up Fanstatic to your WSGI application, but you could also use a WSGI configuration framework like `Paste Deploy`_. For more information about this, see :doc:`our Paste Deploy documentation `. .. _`Paste Deploy`: http://pythonpaste.org/deploy/ A simple WSGI application ------------------------- A simple WSGI application will stand in for your web application:: def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) return [''] As you can see, it simply produces the following web page, no matter what kind of request it receives:: You can also include some code to start and run the WSGI application. Python includes ``wsgiref``, a WSGI server implementation:: if __name__ == '__main__': from wsgiref.simple_server import make_server server = make_server('127.0.0.1', 8080, app) server.serve_forever() For real-world uses you would likely want to use a more capable WSGI server, such as Paste Deploy as mentioned before, or for instance mod_wsgi_. .. _mod_wsgi: https://code.google.com/p/modwsgi/ Including resources without Fanstatic ------------------------------------- Let's say we want to start using jQuery in this application. The way to do this without Fanstatic would be: * download jQuery somewhere and publish it somewhere as a static resource. Alternatively use a URL to jQuery already published somewhere on the web using a content distribution network (CDN). * modify the ```` section of the HTML in your code to add a `` Now you're off and running with Fanstatic!