Now I am moving my small Google App Engine application to the Heroku platform. I actually do not use Bigtable, but webapp2significantly reduces the cost of migration.
Now I am stuck in processing static files.
Are there any good practices? If yes, bring me there, please.
Thanks in advance.
EDIT
Well, now I use pastefor my WSGI server. And it paste.StaticURLParser()should be what I need to implement a static file handler. However, I do not know how to integrate it with webapp2.WSGIApplication(). Can anyone help me?
Perhaps I need to override the class webapp2.RequestHandlerto load correctly paste.StaticURLParser();
import os
import webapp2
from paste import httpserver
class StaticFileHandler(webapp2.RequestHandler):
u"""Static file handler"""
def __init__(self):
pass
app = webapp2.WSGIApplication([(r'/static', StaticFileHandler)], debug=True)
def main():
port = int(os.environ.get('PORT', 5000))
httpserver.serve(app, host='0.0.0.0', port=port)
if __name__ == '__main__':
main()
Any help would be appreciated!