flask_reddit

我要开发同款
匿名用户2021年12月10日
141阅读

技术信息

授权协议
MIT License

作品详情

flask_reddit

flask_redditisaextedable+miimalistRedditcloe.

ThiswasbuiltsobegierswhowatastadardCRUD+reddit-likeapplicatiocaquicklygettowork.

Weutilize:

flaskasthewebframework.gixastheHTTPserverguicoasthewsgiserver.MySQLforourdatabaseflask-sqlalchemyasourORM.bootstrap-jouralthememakesusbeautiful.virtualevemcompasseseverythig.supervisordmakessureourserviceevercrashes.

Adthatsprettymuchit!

Allofthecofigutatiosareithisrepository.Deploymetistructioswillbeoutsoo.

FeaturesthreadedcommetsupvotigsubredditsuserkarmasearchratelimitigajaxformpostiguserprofilesBuildIstructiosSetupaistaceofMySQLoyourserver.Noteyouruserameadpassword.sudoapt-getupdatesudoapt-getupgradesudoapt-getistallmysql-serverlibmysqlcliet-devSetupaistaceofgixoyourserver.I'veprovidedthe.cofscriptseededforourserversithe/serverdirectory.

sudoapt-getistallgix

Cofigureyourgixsettigslocatediflask_reddit/server/gix.cof.

Addyoursettigsitoyourglobalcoffilelocatedi/etc/gix/gix.cof

Restartgixtorecogizeyoursettigssudoservicegixrestart

Setupsupervisordtomoitoryourprojecttomakesureitevercrashes.Supervisorisalsocoveietforsimplyrestartig/startigyourprojectwithease.

sudoapt-getistallsupervisor

WheSupervisorisistalledyoucagiveitprogramstostartadwatchbycreatigcofigfilesithe/etc/supervisor/cof.ddirectory.I'veprovidedthecoffilewhichweuseitherootdirectoryofthisrepoassupervisor.cof.AexamplesupervisorcommadwouldberuigsupervisorctlrestartYOUR_APP_NAMEtorestartguicoradbrigupewchages.

Istallvirtualevadsetupaprojectrootwhereeveryouwat.

sudoapt-getistallpytho-virtualev;cd/path/to/project;virtualevreddit-ev;cdreddit-ev;sourcebi/activate;#viola,youareowiaeclosedpythoworkspace.Dowloadtherepositoryadistallalloftherequiredpythomoduleswhichthisserveruses.gitcloehttps://github.com/codelucas/flask_reddit.git;cdflask_reddit;pipistall-rrequiremets.txt

Duetosesitivecofiguratioiformatio,Ihavehiddemypersoalcofig.pyfileithegitigore.But,Ihaveprovidedacleaadeasytousecofigtemplateithisrepoamedapp_cofig.py.

Fillouttheflask_reddit/app_cofig.pyfilewithyourowiformatioadthereameittocofig.pysoflaskrecogizesitbyusigmvapp_cofig.pycofig.py.Pleasebesuretofilloutthemysqldbsettigssimilarlytohowyousetitup!,userame,pass,etc

Ruthekickstart.pyscripttobuildthefirstuseradsubreddits.

pytho2.7kickstart.py

flask_reddithastaskswhichmustoccuroregulartimeitervals.Tomakethishappe,weusethecrotab,whichispresetoUNIXsystems.

Acrotabisadashwhichallowsyoutospecifywhatprogramstoruadhowofte.I'veprovidedflask_reddit'sexamplecrotabitherootdirectoryasjobs.cro.

Toviewyourcurretcrotab,rucrotab-l.Toedityourcrotab,rucrotab-e.

Pastethecotetsofjobs.croitoyourcrotabbyruigcrotab-eadpastig!Moredirectiosarepresetithejobs.crofile.

Rutheguicorserver.Youwo'thavetodothiseveragaiifsupervisorissetupproperly.

sudoshru_guicor.sh

Notethatwehaveowdeployedtwoservers:gixadguicor.gixisouriteretfacigHTTPserveroport80whileguicorisourwsgiserverwhichisservigupourflaskpythoapplicatiolocally.gixreadsclietrequestsaddecideswhichrequeststoforewardtoourguicorserver.Forexample,gixservesstaticcotetlikeimagesverywellbutitforwardsurlroutestothehomepagetoguicor.

Forafulllistofdetails,viewourcofigsatserver/gix.cofadserver/guicor_cofig.py.

Note,forthisbuildtoworktherearepathsthatyoumustchageithewsgi.pyfile,theservercofigslocatediserverdirectoryadtheru_guicor.shfile.

Refertotheflaskprojectcofiguratiooptiostouderstadwhattoputiyourowcofig.pyfile.

Doothesiatetocotactmeforhelporcocers.

功能介绍

flask_reddit flask_reddit is an extendable + minimalist Reddit clone. This was built so beginners...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论