@app.route(‘/‘)
def home():
#mysql_manager.sql_connect()
return render_template(‘index.html‘)
@app.route(‘/signup‘, methods=[‘POST‘])
def signup():
#session[‘username‘] = request.form[‘username‘]
session[‘message‘] = request.form[‘message‘]
return redirect(url_for(‘message‘))
像这样,利用app.route就可以直接获得网页路径,render_template(‘index.html‘)就是打开index页面。它的文件结构可以给大家看下,所有的html都是存放在template文件夹,然后css这些配置文件还有数据库可以放到static文件夹。headers = {
‘User-Agent‘:‘Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6‘
}
req = urllib2.Request(
url=‘http://blog.csdn.net/‘+name,
headers = headers
) handlers:
- url : /.*
script: __init__.pyflask MySQL-python
if __name__ == ‘__main__‘:
app.run()from bae.core.wsgi import WSGIApplication application = WSGIApplication(app)
lsof -i:5000

/********************************
* 本文来自博客 “李博Garvin“
* 转载请标明出处:http://blog.csdn.net/buptgshengod
******************************************/
python+flask+html/css+mysql+BAE 打造CSDN简历自动生成系统(附网站完全源码)
原文地址:http://blog.csdn.net/buptgshengod/article/details/40541949