Skip to content

Instantly share code, notes, and snippets.

@crackcell
Created February 18, 2013 03:10
Show Gist options
  • Save crackcell/4974902 to your computer and use it in GitHub Desktop.
Save crackcell/4974902 to your computer and use it in GitHub Desktop.
BAE(Baidu App Engine) static files config for python and flask
handlers:
- url: /static/(.*)
static_files: templates/static/$1
- url : /.*
script: app.py
#!/usr/bin/env python
# -*- encoding: utf-8; indent-tabs-mode: nil -*-
#
# Copyright 2013 Menglong TAN <tanmenglong@gmail.com>
#
import os
from flask import Flask, g, request, config, session, render_template
# set static file path
app = Flask(__name__,
static_folder=os.path.join(os.path.dirname(__file__),
"templates/static"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment