Django-ContentManager.Django ¿ë ´Ü¼øÇÑ Ç÷¯±× °¡´É ÄÜÅÙÃ÷ - °ü¸®ÀÚ | |
Áö±Ý ´Ù¿î·Îµå |
Django-ContentManager. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- BSD License
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Peter van Kampen
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://datatailors.com
Django-ContentManager. ű×
Django-ContentManager. ¼³¸í
DjangoÀÇ °£´ÜÇÑ Ç÷¯±× °¡´É ÄÜÅÙÃ÷ °ü¸®ÀÚ Django-ContentManager´Â ¼ÒÀ§ 'Àç»ç¿ë °¡´ÉÇÑ ¾Û'À̸ç, ±â´Ù¸®°í ÄÜÅÙÃ÷¸¦ °ü¸®ÇÕ´Ï´Ù. ±×°ÍÀº ƯÁ¤ À¯ÇüÀÇ ÄÜÅÙÃ÷¸¦ Á¦°øÇÏ´Â ¸ðµç ¼öÀÇ ¾ÛÀ» ÅëÇØ Èð¾îÁú ¼öÀÖ´Â Ç÷¯±×ÀÎÀ» »ç¿ëÇÕ´Ï´Ù. Ç÷¯±×ÀÎÀº °¡Àå ÀαâÀÖ´Â 10 °³ÀÇ ´º½º - À̾߱â, ÃÖ°í µî±ÞÀÇ Ã¤½Ä ¿ä¸®¸¦ ³ª¿Çϰųª »çÁø Ä÷º¼Ç ¾Û¿¡¼ ¼±ÅÃÇÑ °¶·¯¸®¸¦ Ç¥½Ã ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¹°·Ð Django-ContentManager´Â ¶ÇÇÑ (¸¶Å© ¾÷) text.quick start¸¦ ½ÃµµÇغ¸½Ê½Ã¿À. ÀúÀå¼Ò¸¦ º¹Á¦ÇÏ°í Demoproject-dir.assumingÀ» »ç¿ëÇÏ¿© PythonPath¿¡ Django°¡ ÀÖ°í ÀÌ·¯ÇÑ ¸í·ÉÀ¸·Î ½ÇÇàµÇ¾î¾ßÇÕ´Ï´Ù. $. / managepy syncdb --noinput ... $. / manage.py RunServerThen ºê¶ó¿ìÀú¸¦ ¿°í http : // localhost : 8000 /.ÀÌ ÆäÀÌÁö (ÀÌ README¸¦ »ç¿ëÇÏ¿©)·Î À̵¿ÇÕ´Ï´Ù. '´Ü¶ô'ÀÇ ¿¹. '·Î±×ÀÎ'¸µÅ©¸¦ µû¸£¸é Å×½ºÆ® / Å×½ºÆ®·Î ·Î±×ÀÎ ÇÒ ¼öÀÖ´Â °ü¸®ÀÚ·Î À̵¿ÇÕ´Ï´Ù. ±ÍÇÏÀÇ ÀÏ¹Ý ÇÁ·ÎÁ§Æ®¿¡¼ »ç¿ëÀÚ°¡ ·Î±×ÀÎ (¹× ¹ÛÀ¸·Î)À» ·Î±×ÀÎ ÇÒ ¼öÀÖ´Â ¸ÚÁø ¸ÞÄ¿´ÏÁòÀ» Á¦°øÇؾßÇÕ´Ï´Ù. ÀÌ´Â ´ÜÁö ºü¸¥ µ¥¸ð ÀÏ °ÍÀÔ´Ï´Ù. Reader.back¿¡¼ http : // localhost : backÀÇ ¿¬½ÀÀ¸·Î ³²°Ü µÓ´Ï´Ù. 8000 / ÀÌÁ¦ 'editmode on'¸µÅ©°¡ Ç¥½ÃµË´Ï´Ù. ÀÌ·¸°ÔÇϸé 'editmode'°¡ ÄÑÁö°í ³» oution, Á÷°üÀû ÀÎ ¹æ¹ýÀ¸·Î Ç÷¯±×ÀÎÀ» Ãß°¡, ÆíÁý ¹× »èÁ¦ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÆäÀÌÁö¿¡¼ ¹Ù·Î °Å±â¿¡ ÀÖ½À´Ï´Ù : °ü¸®ÀÚ¿Í 'frontend'»çÀÌ¿¡¼ ¿ÔÁö¸¸ Áï°¢ÀûÀÎ Çǵå¹é. ContentManagerto´Â ÇÁ·ÎÁ§Æ® ¶Ç´Â ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼ ContentManager¸¦ »ç¿ëÇÏ¿© ContentManager¸¦ settings.py¿¡¼ installation_apps¿¡ Ãß°¡ÇؾßÇÕ´Ï´Ù. installation_apps = (... 'contentManager', ...) settings.py:middleware_classes = (... 'contentManager.middleware.editmodeMiddleware)¿¡µµ ¹Ìµé¿þ¾î¸¦ Ãß°¡ÇϽʽÿÀ. ÇÁ·ÎÁ§Æ®°¡ ¿äû - ÄÁÅؽºÆ® ÇÁ·Î¼¼½º¸¦ »ç¿ëÇÏ´ÂÁö È®ÀÎÇϽʽÿÀ. template_context_processors = ( "django.core.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors. ¿äû ") ¹× ¸¶Áö¸·À¸·Î URLS.PY¿¡ ContentManager.URLÀ» Æ÷ÇÔÇÏ°í Autodiscover : UrlPatterns = ÆÐÅÏ ( '', ... (r '^ ContentManager /', 'ContentManager.URLS'Æ÷ÇÔ))À» Æ÷ÇÔÇÕ´Ï´Ù.) ContentManager¿¡¼ AutodisCoverAutodisvover () °¡Á® ¿À±â¿¡¼ ÅÛÇø´¿¡¼ ContentManager¸¦ ¿¬°áÇϽʽÿÀ. {% Load Co ntentmanagertags %} {% BLOCK CONTENCE} {% GET_AREA ¿äû 'ÄÜÅÙÃ÷'%} {% END BLOCK %} {% BLOCK »çÀÌµå ¹Ù %} {% GET_AREA ¿äû '»çÀÌµå ¹Ù'%} {% END BLOCK %} DEMOAPP¿Í PluginSinCluded ¾²±â ±âº» ¾ÆÀ̵ð¾î¸¦ Á¦°øÇϱâ À§ÇØ ¸î °¡Áö °£´ÜÇÑ Ç÷¯±×ÀÎ ¿¹Á¦ (BasicBlocks / Reveplugins.py)ÀÔ´Ï´Ù. ÀÚü Ç÷¯±×ÀÎÀ» ÀÛ¼ºÇÏ·Á¸é ContentManager.Plugins.BasePlugin (¶Ç´Â BasemodelPlugin)¿¡¼ ÀÀ¿ë ÇÁ·Î±×·¥ ¹× ÇÏÀ§ Ŭ·¡½º¿¡ RevePlugins ¸ðµâÀ» Ãß°¡ÇؾßÇÕ´Ï´Ù. °¡Àå ±âº»ÀûÀÎ Ç÷¯±×ÀÎÀº ÀÚ½ÅÀÇ ·»´õ¸µ ¸Þ¼Òµå¸¦ Á¤ÀÇÇؾßÇÕ´Ï´Ù. ·»´õ¸µ ¹æ¹ýÀº ¿äû °´Ã¼¸¦ Àü´ÞÇϸç (À¯´Ï ÄÚµå) ¹®ÀÚ¿À» ¹ÝȯÇؾßÇÕ´Ï´Ù. Ŭ·¡½º HelloWorld (ÀÚü, ¿äû) : "Hello World"¸¦ ¹ÝȯÇÏ¿© ContentManager¿¡¼ Ç÷¯±×ÀÎÀ» »ç¿ëÇÒ ¼ö ÀÖ°í ±Ã±ØÀûÀ¸·Î ÇÊ¿äÇÑ »ç¿ëÀÚ¸¦ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. µî·ÏÇÏ·Á¸é : ContentManager °¡Á® ¿À±â RegistryRegistry.Register (HelloWorld)¿¡¼ ·¹Áö½ºÆ®¸®¸¦ ä¿ì·Á¸é Projects Urls.py:From ContentManager °¡Á® ¿À±â AutodisCoverAutoDiscover () ¸ðµç RevePlugins ¸ðµâÀ» ¸ðµÎ ¼³Ä¡ ÇÑ ¸ðµç install_apps ¹×·ÎµåÇÕ´Ï´Ù. µî·Ï µÈ Ç÷¯±×ÀÎ. Âü°í À̸§ ÁöÁ¤ Ãæµ¹À» ¸·±â À§ÇØ ´Ü¼øÈ÷ 'Ç÷¯±×ÀÎ'À» ÅëÇØ À̸§À» ÁöÁ¤Çß½À´Ï´Ù. ContentManager°¡ Revecms¿¡¼ Áõ·ùµÇ¹Ç·Î ÀûÀýÇÑ À̸§ÀÌ ÃæºÐÈ÷ º¸¿´½À´Ï´Ù. Revecms ÀÚü´Â Django-Models¿Í µ¿ÀÏÇÑ Çã°¡ ½Ã½ºÅÛÀ» ´ë·«ÀûÀ¸·Î µû¸£Áö ¸¸, ±×ÀÇ ÇüÁ¦ Gerard¿Í È¥µ¿µÇÁö ¾Êµµ·Ï ³×´ú¶õµå ÀÛ°¡ÀÇ À̸§À» µû¼ ¸í¸íÇÕ´Ï´Ù. Ç÷¯±×ÀÎÀÌ µî·ÏµÇ¸é ContentManager´Â ÀÚµ¿À¸·Î Ãß°¡, º¯°æ ¹× »èÁ¦ ±ÇÇÑÀ» »ý¼ºÇÕ´Ï´Ù. ÀÌ·¯ÇÑ »ç¿ë ±ÇÇÑÀÌ ¸ðµ¨ ±ÇÇÑ°ú Ãæµ¹ ÇÒ ¼ö ÀÖÀ¸¹Ç·Î ¸ðµç Ç÷¯±×ÀÎ »ç¿ë ±ÇÇÑÀº ContentManager '³×ÀÓ ½ºÆäÀ̽º'(Á¤¸»·Î ¾Ë°í ½ÍÀº °æ¿ì Content_Type Ç÷¯±×ÀÎ À¯Çü¿¡ ¸µÅ©)¿Í '_PLUGIN'À¸·Î Ãß°¡µË´Ï´Ù. ¿¹¸¦ µé¾î, HTML Ç÷¯±×ÀÎÀº ±ÇÇÑ 'contentmanager.add_html_plugin', 'contentmanager.delete_html_plugin', 'contentManager.DELETE_HTML_PLUGIN'.PLUGINS´Â has_add_permission, has_change_permission, has_delete_permission ¸Þ¼Òµå¸¦ °¡Áö°í ÀÖÁö¸¸ À§¿¡¼ ¼³¸íÇÑ ÀûÀýÇÑ ÄÚµå À̸§À» »ç¿ëÇÏ´Â °æ¿ì Ç¥ÁØ Django ±ÇÇÑ ½Ã½ºÅÛÀ» »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. TemplateCode.Plugins´Â PlugIntype¿¡ ¸ðµÎ '¹ÙÀεå'¶ó´Â °ÍÀ» Á¦¿ÜÇÏ°í Django ¸ðµ¨°ú µ¿ÀÏÇÑ ¹æ½ÄÀ¸·Î Ãß°¡ »ç¿ë ±ÇÇÑÀ» Ãß°¡ ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽㠡¤ Àå°í
Django-ContentManager. °ü·Ã ¼ÒÇÁÆ®¿þ¾î