GoogleAppEgieBoilerplateLegacy
==============================
ThisProjectwasSposoredbyPyCharm
NOTE:ThisProjectisLegacyadusesthefirsttechologyusedbyGoogleAppEgie,likewebapp2asPythoFrameworkadDataStoreasDataBase.O2016thisprojectwaslegacyaditisrecommedabletousemodermtechologieslikeFlaskorDjagoasFramework,MySQLasdatabase.Thakseverybodyfortheircotributios,Thecreatorofthisprojectishooredthatithelpstobrigwebtechologytotheworld.
ItroGoogleAppEgieBoilerplategetsyourprojectoffthegroudquicklyusigtheGoogleAppEgieplatform.CreatepowerfulapplicatiosbyusigthelatesttechologysupportedoGoogleAppEgie.ItwillitroducesewdeveloperstoAppEgieadadvaceddeveloperstofollowbestpractices.
Tryaoliedemo
What'saBoilerplate?ABoilerplateisusedtodescribesectiosofcodethatcabereusedoveradoveriewcotextsorapplicatioswhichprovidesgooddefaultvalues,reducigtheeedtospecifyprogramdetailsieveryproject.(wikipedia)
WhatmakesthisBoilerplateAmazig?Itisfullyfeatured,activelymaitaied,adusesthelatestadmostsupportedtechologiesofGoogleAppEgie.
NewtoGoogleAppEgie?Learaboutitbywatchigthisvideoof@bslatkiorreadigtheofficialdocumetatio.
GetstartedijustafeweasystepsDowloadthelastversiooftheAppEgieSDKforLiux,MacOSorWidows.DowloadorcloethecodeofthisBoilerplate(here)Rulocally(istructios).Setyour'applicatio'ameiapp.yamlSetcustomcofigparametersibp_cotet/themescofig/localhost.py,cofig/testig.pyadcofig/productio.pylikesecretkey,recaptchacode,saltadother.Boilerplatewillidetifywhichcofigfiletouseilocal,uittestigadproductio.Togetstarted,lookthedefaultsettigsibp_icludes/cofig.py.Thosesettigswillbeoverwriteforyourcofigfiles.Mostofthedefaultsettigswilleedtobechagedtoyieldasecureadworkigapplicatio.SetAutheticatioOptiosdropdowtoFederatedLogiitheGoogleAppEgiecotrolpael(orifyoudootwatfederatedlogi,seteable_federated_logitofalseicofig.py)
Deployitolie(istructios-recommededsetup:pytho2.7,highreplicatiodatastore)
gcloudcofigsetprojectsadegie;gcloudappdeploy-qapp.yamlcro.yamlPleaseotethatyourcustomapplicatiocodeshouldbelocatedithebp_cotetfolderwithiyourowtheme.Theitetioisthatseparatigtheboilerplatecodefromyourapplicatiocodewillavoidmergecoflictsasyoukeepupwithfutureboilerplatechages.
FuctiosadfeaturesAutheticatio(SigI,SigOut,SigUp)FederatedLogi-logiviayourfavoritesocialetwork(Google,Twitter,etc...)poweredbyOpeIDadOAuthResetPasswordUpdateUserProfileCotactFormClietsideadserversideformvalidatioAutomaticdetectioofuserlaguageSupportformayLaguages(Eglish,Spaish,Italia,Frech,Chiese,Idoesia,Germa,Russia,etc)VisitorsLogNotificatiosadCofirmatioforuserswhetheychagetheiremailorpasswordResposiveDesigforviewigoPCs,tablets,admobilephoes(sychroizedwithTwitter-Bootstrapproject)MobileidetificatioUitTestigErrorhadligBasicusermaagemetfeaturesavailableuder/admi/users/forGoogleApplicatioAdmiistratorsResourcesBoilerplatehasaGooglegroup(gae-boilerplate)fordiscussiosadaTwitteraccout(@gaeboilerplate)forsharigrelatedresources.
OpeSourceIfyouwattoadd,fixorimprovesomethig,createaissueorsedaPullRequest.
Beforecommittigfixeswerecommedruigtheuitests(itheboilerplatepackage).Thiswillhelpguardagaistchagesthataccidetlybreakothercode.Seethetestigsectiobelowforistructios.
Feelfreetocommitimprovemetsorewfeatures.Feedback,commetsadideasarewelcome.
RuYoucaruthisprojectdirectlyfromtermialwithFabric.
fabstartAlsoyoucaruitclearigdatastore.
fabstart:clearUitTestigRequiremets
Istallpipwithdistributeiordertoistallextpackages.
Beforeruiguittestsitisecessarytoistallwebtest,mock,adpyqueryiyourlocalpythoistallatio.
sudopipistallwebtestsudopipistallmocksudopipistallpyqueryThebestwaytoruuittestsisthoughFabric.
sudopipistallFabricRuigUitTests
ToruuittestswithFabricrufabtestcommaditermial.AlsoUittestscaberuviatestrueroriEclipsebyrightclickigothewebfolderadselectig"ruas..."->"Pythouit-test".Youmayeedtoadd/boilerplate/exteraltoyourpythopath.AddigyoursUitTest
Pleaseadduittestsforyourapplicatiotoyourhadlerfolderiatest.pyfile.Yourowuittestscabecreatedsimilarlytothoseitheboilerplate.Iheritigfromboilerplate.lib.test_helpers.HadlerHelperswillprovideaccesstocoveiethadlertestigmethodsusedbytheboilerplate.DeployTodeployyourprojectwithFabric,justruthiscommadiTermial.
fabdeployRemembertochageapplicatio,versio,themeiapp.yamlaccordigtoyourproject.
TechologiesusedPytho2.7.5NDB1.0.10(ThebestdatastoreAPIfortheGoogleAppEgiePythorutime).Jija22.6(AfullyfeaturedtemplateegieforPytho).WTForms-1.0.2(Formsvalidatioframeworkkeepiguseriteractiosecureadflexiblewithorwithoutjavascript).Babel-0.9.6adgaepytz-2011h(Idustystadarditeratioalizatioredersthesiteimultiplelaguages).webapp22.5.2(AlightweightPythowebframework,themostcompatiblewithGoogleAppEgie).webapp2_extras.sessioswebapp2_extras.routeswebapp2_extras.authwebapp2_extras.i18CodewrittefollowigtheGooglePythoStyleGuideUittestigwithuittest,webtest,pyqueryOpeIDlibraryprovidedbyGoogleAppEgieOAuth2forfederatedlogiprovidersthatdootsupportOpeIDFrot-edTechologiesHTML5BoilerplateModerizr2.6.1jQuery1.8.2TwitterBootstrap3.1.1upgradedfrom2.2.1.TemplateforDesktopVersio.HelptotraslatetoewlaguagesorimproveoldtraslatiosIeachlocale//LC_MESSAGESdirectorythereisafilemessages.po.Pleasehelpustraslatethetextithesefiles.msgidisthetextiEglish.msgstristhetraslatiotothelaguageidicatedbythelocalecode.Forexample:
msgid"Chageyourpassword"
msgstr"Cambiartucotraseña"
Requiremets
Istallbeforepipwithdistribute_setup.py(Readtheevirometsetupdocumet)
sudopipistallbabelsudopipistalljija2Traslatig
Toexecutethetraslatio,ruthesetwocommads.(beforethesecodoe,gotolocalefoldertoicludeyourtraslatio)
fablagfablag:compileWorkigwithIteratioalizatio(i18)Thisboilerplatecomesbudledwithbabel,pytz,adautomaticlaguagedetectiowhichtogetherprovidepowerfuliteratioalizatiocapability.Texttobetraslatedeedstobeidicatedicodeadthetraslatedbyuserslikeyouafterwhichitiscompiledforspeed.
Addigorupdatigtexttobetraslatedoraddigewlaguagesrequiresmoreworkasidicatedithestepsbelow:
Texttobetraslatedshouldbeeclosedi_("texttotraslate")i*.pyfiles.
{{..._("texttotraslate")...}}{%..._("texttotraslate")...%}Ihtmltemplatestraslatedtextisidicatedby:
{%tras%}texttotraslate{%edtras%}NOTE:Traslatioscabeaddedtoothertypesoffilestoo.Seebabel.cfgadbabel.cfgdocumetatio
Obtaipybabeltoperformthestepsbelow.Youwilleedtoistalladcompilejija2adbabel.Notethatyoumayeedtofirstistallsetuptoolsadeasy_istall.pybabel.execaberufromtheScriptsdirectoryiyourpythoistallatio.
easy_istalljija2babelBabeltheeedstofidalltraslatioedtextblocksthroughoutcodeadtemplates.Afteristalligpybablruthiscommadtoextractmessages(assumig./isthelocatioofthisboilerplate):pybabelextract-F./locale/babel.cfg-o./locale/messages.pot./--sort-output--o-locatio--omit-header
Updatetraslatiosofexistiglaguagesoraddewlaguages
Updatetraslatiosofexistiglaguagesbyruigthiscommadforeachlocale:pybabelupdate-les_ES-d./locale-i./locale/messages.pot--previous--igore-obsoleteRuthiscommadforeachlocalebyreplaciges_ESithecommad.Localeamesarethedirectoryamesi./locale.Addewlaguages:Ruthiscommadforeachewlaguagetoadd.Youwilleedtoreplacees_ESithecommadwiththelocalecodetoadd:pybabeliit-les_ES-d./locale-i./locale/messages.potAddthelocaletothelocalesarrayiyourthemes/<your_theme>/cofig/.Istructiosohowtopickalocalecodeareprovidedithecommetsabovethearray.ProvidetraslatiosforeachlaguageIeachlocale//LC_MESSAGESdirectorythereisafilemessages.po.Userstraslatethestrigsithesefiles.msgidisthetextiEglish.msgstristhetraslatiotothelaguageidicatedbythelocalecode.Forexample:
msgid"Chageyourpassword"msgstr"Cambiartucotraseña"CompiletraslatiosRu:pybabelcompile-f-d./locale
Seewebapp2'stutorialadpybabel'sdocsformoredetails.
Disabligi18
i18cabedisabledadlaguageoptioshidde.Setlocalesicofig.pytoNoeoremptyarray[]todothis.Thismaybeusefultoprovideaperformaceboostorsimplifysitesthatserveamarketwitholyoelaguage.Thelocaledirectorycabesafelyremovedtosavespaceifoteededbutthebabeladpytzdirectoriescaotberemovedwithoutbreakigcode(importsadtrasstatemets)atthistime.
SecuritySSL
SSLiseabledsitewidebyaddigsecure:alwaystothesectio:-url:/.*iapp.yaml(removethislietodisable)SSLeitherrequiresafreegoogleappegie*.appspot.comdomaioracustomdomaiadcertificateAlterativelySSLcabeeabledatacotrollerlevelviawebapp2schemes.Usethesecure_schemeprovidediroutes.pyItisrecommededtoeablesslsitewidetohelpprevetsessiohijackigPasswords
PasswordsarehashedadecryptedwithSHA512adPyCrypto.CSRF
Cross-siterequestforgeryprotectioAckowledgemetsGoogleAppEgieBoilerplateisacollaborativeprojectcreatedbycotowhichisbrigigtoyouthakstothehelpoftheseamazigpeople
Top10:Primarycotributors:
TmeryuPeta15Sergue1SabirmostofaPmaacascopycat91Mooosef1shearpresvevaSorced-JimFlaskBoilerplates
gae-iitflask-boilerplateHerokuflask-appegie-template






评论