没有合适的资源?快使用搜索试试~ 我知道了~
首页Flask_Web_Development,_2nd_Edition.pdf
About the Author Miguel Grinberg has over 25 years of experience as a software engineer. He blogs at blog.miguelgrinberg.com about a variety of topics including web development, robotics, photography, and the occasional movie review. Miguel lives in Portland, Oregon.
资源详情
资源评论
资源推荐
Preface
Flaskstandsoutfromotherframeworksbecauseitletsdeveloperstakethe
driver’sseatandhavefullcreativecontroloftheirapplications.Maybeyouhave
heardthephrase“fightingtheframework”before.Thishappenswithmost
frameworkswhenyoudecidetosolveaproblemwithasolutionthatisn’tthe
officialone.Itcouldbethatyouwanttouseadifferentdatabaseengine,or
maybeadifferentmethodofauthenticatingusers.Deviatingfromthepathsetby
theframework’sdeveloperswillgiveyoulotsofheadaches.
Flaskisnotlikethat.Doyoulikerelationaldatabases?Great.Flasksupports
themall.MaybeyoupreferaNoSQLdatabase?Noproblematall.Flaskworks
withthemtoo.Wanttouseyourownhomegrowndatabaseengine?Don’tneeda
databaseatall?Stillfine.WithFlaskyoucanchoosethecomponentsofyour
applicationorevenwriteyourownifthatiswhatyouwant.Noquestionsasked!
ThekeytothisfreedomisthatFlaskwasdesignedfromthestarttobeextended.
Itcomeswitharobustcorethatincludesthebasicfunctionalitythatallweb
applicationsneedandexpectstheresttobeprovidedbysomeofthemanythird-
partyextensionsintheecosystemand,ofcourse,byyou.
InthisbookIpresentmyworkflowfordevelopingwebapplicationswithFlask.
Idon’tclaimtohavetheonlytruewaytobuildapplicationswiththis
framework.Youshouldtakemychoicesasrecommendationsandnotasgospel.
Mostsoftwaredevelopmentbooksprovidesmallandfocusedcodeexamplesthat
demonstratethedifferentfeaturesofthetargettechnologyinisolation,leaving
the“glue”codethatisnecessarytotransformthesedifferentfeaturesintoafully
workingapplicationstobefiguredoutbythereader.Itakeacompletely
differentapproach.AlltheexamplesIpresentarepartofasingleapplicationthat
startsoutverysimpleandisexpandedineachsuccessivechapter.This
applicationbeginslifewithjustafewlinesofcodeandendsasanicelyfeatured
bloggingandsocialnetworkingapplication.
WhoThisBookIsFor
YoushouldhavesomelevelofPythoncodingexperiencetomakethemostof
thisbook.AlthoughthebookassumesnopreviousFlaskknowledge,Python
conceptssuchaspackages,modules,functions,decorators,andobject-oriented
programmingareassumedtobewellunderstood.Somefamiliaritywith
exceptionsanddiagnosingissuesfromstacktraceswillbeveryuseful.
Whileworkingthroughtheexamplesinthisbook,youwillspendagreatdealof
timeinthecommandline.Youshouldfeelcomfortableusingthecommandline
ofyouroperatingsystem.
ModernwebapplicationscannotavoidtheuseofHTML,CSS,andJavaScript.
Theexampleapplicationthatisdevelopedthroughoutthebookobviouslymakes
useofthese,butthebookitselfdoesnotgointoalotofdetailregardingthese
technologiesandhowtheyareused.Somedegreeoffamiliaritywiththese
languagesisrecommendedifyouintendtodevelopcompleteapplications
withoutthehelpofadeveloperversedinclient-sidetechniques.
IreleasedthecompanionapplicationtothisbookasopensourceonGitHub.
AlthoughGitHubmakesitpossibletodownloadapplicationsasregularZIPor
TARfiles,IstronglyrecommendthatyouinstallaGitclientandfamiliarize
yourselfwithsourcecodeversioncontrol,atleastwiththebasiccommandsto
cloneandcheckoutthedifferentversionsoftheapplicationdirectlyfromthe
repository.Theshortlistofcommandsthatyou’llneedisshownin“Howto
WorkwiththeExampleCode”.Youwillwanttouseversioncontrolforyour
ownprojectsaswell,sousethisbookasanexcusetolearnGit!
Finally,thisbookisnotacompleteandexhaustivereferenceontheFlask
framework.Mostfeaturesarecovered,butyoushouldcomplementthisbook
withtheofficialFlaskdocumentation.
HowThisBookIsOrganized
Thisbookisdividedintothreeparts:
PartI,IntroductiontoFlask,exploresthebasicsofwebapplicationdevelopment
withtheFlaskframeworkandsomeofitsextensions:
Chapter1describestheinstallationandsetupoftheFlaskframework.
Chapter2divesstraightintoFlaskwithabasicapplication.
Chapter3introducestheuseoftemplatesinFlaskapplications.
Chapter4introduceswebforms.
Chapter5introducesdatabases.
Chapter6introducesemailsupport.
Chapter7presentsanapplicationstructurethatisappropriatefor
mediumandlargeapplications.
PartII,Example:ASocialBloggingApplication,buildsFlasky,theopensource
bloggingandsocialnetworkingapplicationthatIdevelopedforthisbook:
Chapter8implementsauserauthenticationsystem.
Chapter9implementsuserrolesandpermissions.
Chapter10implementsuserprofilepages.
Chapter11createstheblogginginterface.
Chapter12implementsfollowers.
Chapter13implementsusercommentsforblogposts.
Chapter14implementsanApplicationProgrammingInterface(API).
PartIII,TheLastMile,describessomeimportanttasksnotdirectlyrelatedto
applicationcodingthatneedtobeconsideredbeforepublishinganapplication:
Chapter15describesdifferentunittestingstrategiesindetail.
Chapter16givesanoverviewofperformanceanalysistechniques.
Chapter17describesdeploymentoptionsforFlaskapplications,
includingtraditional,cloudandcontainerbasedsolutions.
Chapter18listsadditionalresources.
HowtoWorkwiththeExampleCode
ThecodeexamplespresentedinthisbookareavailablefromGitHubat
https://github.com/miguelgrinberg/flasky.
Thecommithistoryinthisrepositorywascarefullycreatedtomatchtheorderin
whichconceptsarepresentedinthebook.Therecommendedwaytoworkwith
thecodeistocheckoutthecommitsstartingfromtheoldest,thenmoveforward
throughthecommitlistasyoumakeprogresswiththebook.Asanalternative,
GitHubwillalsoletyoudownloadeachcommitasaZIPorTARfile.
IfyoudecidetouseGittoworkwiththesourcecode,thenyouneedtoinstall
theGitclient,whichyoucandownloadfromhttp://git-scm.com.Thefollowing
commanddownloadstheexamplecodeusingGit:
$gitclonehttps://github.com/miguelgrinberg/flasky.git
ThegitclonecommandinstallsthesourcecodefromGitHubintoaflasky2
folderthatiscreatedinthecurrentdirectory.Thisfolderdoesnotcontainjust
sourcecode;acopyoftheGitrepositorywiththeentirehistoryofchangesmade
totheapplicationisalsoincluded.
Inthefirstchapteryouwillbeaskedtocheckouttheinitialreleaseofthe
application,andthen,attheproperplacesyouwillbeinstructedtomove
forwardinthehistory.TheGitcommandthatletsyoumovethroughthechange
historyisgitcheckout.Hereisanexample:
$gitcheckout1a
The1areferencedinthecommandisatag,anamedpointinthecommithistory
oftheproject.Thisrepositoryistaggedaccordingtothechaptersofthebook,so
剩余321页未读,继续阅读
jiehongpian9543
- 粉丝: 1
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0