Çöó½ºÅ© - °ÔÀ¸¸¥ ºä

°ÔÀ¸¸¥ ¹æ½ÄÀ¸·Î Çöó½ºÅ© ÀÀ¿ë ÇÁ·Î±×·¥ ¹× û»çÁøÀ»À§ÇÑ URL °æ·Î µî·Ï
Áö±Ý ´Ù¿î·Îµå

Çöó½ºÅ© - °ÔÀ¸¸¥ ºä ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • BSD License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • Igor Davydenko
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://github.com/playpauseandstop/

Çöó½ºÅ© - °ÔÀ¸¸¥ ºä ű×


Çöó½ºÅ© - °ÔÀ¸¸¥ ºä ¼³¸í

Flask-lazyViews´Â Çöó½ºÅ© ¾Û ¶Ç´Â °ÔÀ¸¸¥ ¹æ½ÄÀ¸·Î Flask-lazyviewsage¸¦ ¼³Ä¡ÇÒ ¼öÀÖ´Â Çöó½ºÅ© È®ÀåÀÔ´Ï´Ù. ApplicationProject / app.pyFrom Çöó½ºÅ© °¡Á® ¿À±â Flask.ext.lazyViews Flask.ext.lazyViews Çöó½ºÅ© (__ À̸§ __) views = lazyviews (app) views.add ( '/', 'views.home') views.add ( '/ page / page / ,'view / page / page / 'views.page') project / views.pyfrom flask °¡Á® ¿À±â render_templatedef home () : render_template ( 'home.html') def ÆäÀÌÁö (page_id) : page = get_page (page_id) bluePrintProject / app.py ... from project.test °¡Á® ¿À±â û»çÁø¿¡¼­ Render_Template ( 'page.html', page = ÆäÀÌÁö) test_blueprint ... app.register_blueprint (test_blueprint, url_prefix = '/ test') project / test / __ init __. pyfrom ÇÃ¶ó½º Å© import blueprintfrom flask.ext.lazyviews lazyviewsblueprint = blueprint ( 'test', __name __) views = lazyviews (û»çÁø, '.views') views.add ( '/', 'test') views.add ( '/ Advanced', 'Advanced_test', ¸Þ¼­µå = ( 'GET', 'POST')) ÇÁ·ÎÁ§Æ® / Å×½ºÆ® / views.pyfrom Çöó½ºÅ© °¡Á® ¿À±â render_ ÅÛÇø´, requestDef Advanced_Test () : context = generate_context (request.form) ¸®ÅÏ render_template ( 'test / advanced.html', ** ÄÁÅؽºÆ®) def test () : return renter_template ( 'test / test.html') ¼³¸í ¼³¸í Flask-lazyViews´Â Çöó½ºÅ© ¹®¼­¿¡¼­ Lazy Technique¸¦ »ç¿ëÇÏ¿© ¾Û ¹× û»çÁø¿¡ ´ëÇÑ ºä ¹× û»çÁø¿¡ ´ëÇÑ ºä¸¦ Ãß°¡ÇÏ´Â ÇÁ·Î¼¼½º¸¦ ´Ü¼øÈ­ÇÕ´Ï´Ù. ´ÙÀ½ ¸ñÇ¥´Â ViewName Á¤ÀǸ¦ ´Ü¼øÈ­ÇÏ´Â °ÍÀÔ´Ï´Ù. ´ëºÎºÐÀÇ °æ¿ìº¸±â ±â´ÉÀº ¾Û ¶Ç´Â û»çÁøÀÇ ¸ðµâÀ» ÂüÁ¶ÇϽʽÿÀ. ±×·¡¼­ ¿ì¸®´Â ÇØ´ç ¸ðµâ¿¡ ´ëÇÑ Àüü °æ·Î¸¦ ÀÔ·Â ÇÒ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. ÀÌ°ÍÀº ƯÈ÷ û»çÁø¿¡ ƯÈ÷ À¯¿ëÇÕ´Ï´Ù. ¿À¸®Áö³Î ½º ´ÏÆêÀ» »ç¿ëÇÏ´Â °æ¿ì À§ÀÇ ¿¹Á¦¸¦ ÂüÁ¶ÇϽʽÿÀ. BlueprintÀÇ ºä ¸ðµâ¿¡ ´ëÇÑ °æ·Î¸¦ Á¦°øÇؾßÇÕ´Ï´Ù. add_url (û»çÁø, '/', 'test.views.test') ±×·¯³ª ¿ì¸®°¡ Å×½ºÆ®¸¦ ¹«½ÃÇÒ ¼öÀÖ´Â Flask-lazyViews¿Í ÇÔ²² . ´Ù¸¥ Ãø¸éº¸±â ±â´ÉÀÌ ´Ù¸¥ À§Ä¡¿¡ Àְųª Àüü °æ·Î¸¦ Á¦°ø ÇؾßÇÏ´Â °æ¿ì ¿©ÀüÈ÷ DjangoÀÇ ÆÐÅÏÀ¸·Î ¿Ï·áµÈ °Íó·³ import_prefix¸¦ ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. views = lazyviews (¾Û, 'views') Views.add ( '/', 'home')º¸±â. '/ / PAGE / ', 'ÆäÀÌÁö', ¸Þ¼­µå = ( 'get', 'post')) import_prefix °ªÀ¸·Î Á¶½ÉÇØ Çöó½ºÅ© ÀÀ¿ë ÇÁ·Î±×·¥ À̸§ ¶Ç´Â û»çÁø import_nameÀ¸·Î __name__À» »ç¿ëÇß½À´Ï´Ù. »ó´ë °æ·Î¸¦ ¼³Á¤ÇÏ¸é ¼­¹ö ¿À·ù°¡ ¹ß»ýÇÒ ¼ö ÀÖ½À´Ï´Ù .Bugs, ±â´É ¿äû? Flask-LazyViews ¶óÀ̺귯¸®ÀÇ ¹ö±×¸¦ ãÀº °æ¿ì ÇÁ·ÎÁ§Æ®ÀÇ GitHub ¹®Á¦¿¡ »õ·Î¿î ¹®Á¦¸¦ Ãß°¡ÇϽʽÿÀ. Á¦Ç°ÀÇ È¨ÆäÀÌÁö


Çöó½ºÅ© - °ÔÀ¸¸¥ ºä °ü·Ã ¼ÒÇÁÆ®¿þ¾î