Django-likeable.¸ðµç ÄÜÅÙÃ÷ À¯ÇüÀÇ "ÁÁ¾ÆÇÏ´Â"À» ÃËÁøÇÏ´Â °£´ÜÇÑ Django ¾Û | |
Áö±Ý ´Ù¿î·Îµå |
Django-likeable. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- The Apache License 2.0
- °Ô½ÃÀÚ À̸§:
- Thane Thomson
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://github.com/thanethomson/
Django-likeable. ű×
Django-likeable. ¼³¸í
¸ðµç ÄÜÅÙÃ÷ À¯ÇüÀÇ "ÁÁ¾ÆÇÏ´Â"À» ¿ëÀÌÇÏ°ÔÇÏ´Â °£´ÜÇÑ Àå°í ¾Û Django-likeableÀº ÁÁ¾ÆÇÏ´Â °ÍÀ» ÃËÁø ÇÒ ¶§ Á÷Á¢ Ŭ·¡½º »ó¼Ó ´ë½Å Ãß»óÀû ÀΠŬ·¡½º¸¦ ¼±È£ÇÔÀ¸·Î½á ±Ô¸ð Ä£ÈÀû ÀÎ (Django-nonrel ÂüÁ¶)À» ¸ñÇ¥·ÎÇÏ´Â "ÁÁ¾ÆÇÏ´Â"±â´ÉÀ» Ãß°¡ÇÏ´Â Django ¾ÛÀÔ´Ï´Ù. ContentTypes Framework¿¡ µî·Ï µÈ ¸ðµç ¸ðµ¨À» ¿øÇϽʴϱî?ÀÌ ¾ÛÀÌ ¾ÆÁ÷ ±Ô¸ð¿¡¼ Å×½ºÆ®µÇÁö ¾Ê¾ÒÁö¸¸ °¡±î¿î Àå·¡¿¡ ¾î¶² ½ÃÁ¡¿¡ÀÖÀ» °ÍÀÔ´Ï´Ù. ±× µ¿¾È, ¸ðµ¨¿¡ "ÁÁ¾ÆÇÏ´Â"±â´ÉÀ» ´Ü¼øÈ÷ Ãß°¡ÇÕ´Ï´Ù. ¼³Ä¡ 1. Django-likeable ¾ÛÀ» Python °æ·Î¿¡ Ãß°¡ÇϽʽÿÀ .2. ÇÁ·ÎÁ§Æ® ¼³Á¤¿¡ install_apps ¸ñ·Ï¿¡ likeableÀ» Ãß°¡ÇϽʽÿÀ .3. likevelymeablefrom django.contrib.auth.models import userclass blogentry (likeable) : ÀÛ¼ºÀÚ = models.forenignkey () created = models.datetimefield (auto_now_add = true) created blogentryComment (Likible) : Entry = models.ForeignKey (BlogEntry) ÀÛ¼ºÀÚ = models.Forenigney (»ç¿ëÀÚ) Created = Models.TextField (Auto_Now_Add = True) Content Content YoulyUTYUTYULUTILESYUTYUTYUTYUTYUTYUTYULUTYULUTYYUTYUTYUTYUTYYUTY ÀÚµ¿À¸·Î Á¦°ø ÇÒ ¼ö ÀÖ½À´Ï´Ù. ÁÖ¾îÁø »ç¿ëÀÚÀÇ Æ¯Á¤ °³Ã¼¿Í °°ÀÌ : Likevely import from ¸ðµ¨ blogentry, blogentrycommentfrom django.contrib.auth.models »ç¿ëÀÚ °¡Á® ¿À±â ... # Çظ®´Â ºí·Î±× enttryharry = user.objects.create (username = 'harry) ') blog_entry = blogentry.objects.create (ÀÛ¼ºÀÚ = Çظ®, ÄÜÅÙÃ÷ = "ÀÌ°ÍÀº ³» ù ¹ø° °Ô½Ã¹°ÀÔ´Ï´Ù."... # »ø¸®´Â blog entrysally = user.objects.create (username ='sally ') blog_entry.create (username ='sally ') (Sally) Á¦°øµÈ ÄÜÅÙÃ÷¸¦ ÁÁ¾ÆÇÏ´Â ºä ¸¶ÀÌÅ©¸¦ ÅëÇØ ÇÁ·ÎÁ§Æ®ÀÇ urls.py ÆÄÀÏÀ» È®ÀÎÇϽʽÿÀ. ooks´Â ´ÙÀ½°ú °°½À´Ï´Ù. django.conf.urls.defaults °¡Á® ¿À±â ÆÐÅÏ, urlurlpatterns = ÆÐÅÏ ( '', # ... django-likeableÀÇ URL URL (r '^ like /', include (likeyl.urls) '), # ...) »ç¿ë °¡´É URLSLIKE // ¿äûÀÌ ÀÏ¹Ý GET ¿äû ¶Ç´Â AJAX ¿äûÀ» ÅëÇØ µé¾î¿À´ÂÁö ¿©ºÎ¸¦ ÀÚµ¿ °¨ÁöÇÏ°í ´ÙÀ½ µÎ VIEWS¿¡ µû¶ó ó¸®ÇÕ´Ï´Ù. @ @ @ @ object_id> ÄÜÅÙÃ÷ Çü½Ä ID¿Í ±âº» Å°°¡ (¾çÀÇ Á¤¼ö ¸ðµÎ) ÀÎ ¿ÀºêÁ§Æ®¸¦ ÁÁ¾ÆÇÏ´Â °ÍÀ» ½ÃµµÇÕ´Ï´Ù. ÀÌ ±â´ÉÀº ÁÖ¾îÁø °´Ã¼¸¦ ÁÁ¾ÆÇÏ´Â ÈÄ¿¡ »ç¿ëÀÚ¸¦ ÂüÁ¶ÇÏ´Â URL·Î ÀÚµ¿À¸·Î ¸®µð·º¼ÇÇÏ·Á°í ½ÃµµÇÕ´Ï´Ù. ÁÖ¾îÁø ±âÁØ°ú ÀÏÄ¡ÇÏ´Â °´Ã¼°¡ ¹ß°ßµÇÁö ¾ÊÀ¸¸é HTTP 404 ¿À·ù°¡ »ý¼ºµË´Ï´Ù. @
/
Django-likeable. °ü·Ã ¼ÒÇÁÆ®¿þ¾î
Àå°í - À̸ÞÀÏ ¼ºñ½º
°¡Àå Àß ¾Ë·ÁÁø ÀϺο¡ ´ëÇÑ ÀüÀÚ ¸ÞÀÏ ¹é¿£µå ¹× ÇØ´ç ¼ºñ½º °´Ã¼¸¦ Á¦°øÇÏ´Â Django ¾Û ... ...
72