资源描述:
《OReilly.Flask.Web.Development.May.2014》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、FlaskWebDevelopmentMiguelGrinbergFlaskWebDevelopmentbyMiguelGrinbergCopyright©2014MiguelGrinberg.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,busin
2、ess,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:800-998-9938orcorporate@oreilly.com.Editors:MeghanBlanchetteandRachelRoumeliotisCoverDesigner:RandyCom
3、erProductionEditor:NicoleShelbyInteriorDesigner:DavidFutatoCopyeditor:NancyKotaryIllustrator:RebeccaDemarestProofreader:CharlesRoumeliotisMay2014:FirstEditionRevisionHistoryfortheFirstEdition:2014-04-25:FirstreleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=978144937262
4、0forreleasedetails.NutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.FlaskWebDevelopment,thepictureofaPyreneanMastiff,andrelatedtradedressaretrademarksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellers
5、todistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumen
6、oresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedherein.ISBN:978-1-449-37262-0[LSI]ForAlicia.TableofContentsPreface.......................................................................xiPartI.IntroductiontoFlask1.Installation...
7、..............................................................3UsingVirtualEnvironments4InstallingPythonPackageswithpip62.BasicApplicationStructure...................................................7Initialization7RoutesandViewFunctions8ServerStartup9ACompleteApplication9T
8、heRequest-ResponseCycle12ApplicationandRequestContexts12RequestDispatching14RequestHooks1