Djrill. ¼øÀ§ ¹× ¿ä¾à
- °Ô½ÃÀÚ À̸§:
- Kenneth Love and Chris Jones
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- https://github.com/brack3t/
Djrill. ű×
Djrill. ¼³¸í
DjrillÀº MailChimp.an ¿É¼ÇÀÇ Django °ü¸® ÀÎÅÍÆäÀ̽º ¿É¼ÇÀÌ Æ÷ÇԵǾîÀÖ´Â Mandrill Æ®·£Àè¼Ç ÀüÀÚ ¸ÞÀÏ ¼ºñ½º¸¦ È°¿ëÇÏ·Á´Â Django »ç¿ëÀÚ¸¦À§ÇÑ À̸ÞÀÏ ¹é¿£µå ¹× »õ·Î¿î ¸Þ½ÃÁö Ŭ·¡½ºÀÔ´Ï´Ù. °ü¸® ÀÎÅÍÆäÀ̽º¸¦ »ç¿ëÇÏ¸é ´ÙÀ½À» ¼öÇà ÇÒ ¼ö ÀÖ½À´Ï´Ù. - Mandrill API ¿¬°á »óŸ¦ È®ÀÎÇϽʽÿÀ .- À̸ÞÀÏ º¸³½ »ç¶÷ Ãß°¡ / ºñÈ°¼ºÈ. PYPI¸¦ ÅëÇØ ¼³Ä¡ÇÏÁö ¾ÊÀ¸¸é Dopip ¼³Ä¡ RequestSconfigurationIn settings.py:1À» ¼³Ä¡ÇؾßÇÕ´Ï´Ù. interval_apps¿¡ djrillÀ» Ãß°¡ÇϽʽÿÀ. installed_apps = (... "djrill") 2. ´ÙÀ½ µÎ ÁÙÀ» Ãß°¡ÇÏ¿© Mandrill_api_key¸¦ ´ëüÇÕ´Ï´Ù. mandrill_api_key = "BRACK3T-IS-AWESOME"mandrill_api_url = "http://mandrillapp.com/api/1.0"3). ´ÙÀ½ ÁÙ·Î ±âÁ¸ ÀüÀÚ ¸ÞÀÏ ¹é¿£µå¸¦ ÀçÁ¤ÀÇÇϽʽÿÀ. email_backend = "djrill.mail.backends.djrill.djrillbackend"4. (¼±Åà »çÇ×) DjangoÀÇ Admin ¶Ç´Â ¸Þ½ÃÁö¿¡ ´ëÇÑ Åë°è¸¦ ÅëÇØ º¸³½ »ç¶÷À» Ãß°¡ÇÏ·Á¸é Djrill °¡Á® ¿À±â DjrillAdminsite Admin.site = DjrillAdminsite ( ) Admin.autodiscover () ... URLPATTERNS = ÆÐÅÏ ( '', ... URL (r '^ admin /', include (inval.site.url)),) Usagesince Àü¿ª Email_Backend¸¦ ´ëüÇÏ°íÀÖ´Â ¸ðµç À̸ÞÀÏÀº MandrillÀÇ ¼ºñ½º¸¦ ÅëÇØ º¸³Â½À´Ï´Ù. DjangoÀÇ ³»Àå Send_Mail ¹× send_mass_mail ¸ÞÀÏÀ» ÅëÇØ À̸ÞÀÏÀ» º¸³»±â À§ÇØ MandrillÀ» »ç¿ëÇÏ°í ½Í½À´Ï´Ù. À§ÀÇ ±¸¼º Áß 1 ´Ü°è¿¡¼ 3 ´Ü°è¸¦ ¼öÇàÇÏ´Â °ÍÀÔ´Ï´Ù. ¸Þ½ÃÁö´Â HTML ¹öÀüÀ» Æ÷ÇÔÇϰųª ÅÂ±× ¶Ç´Â ÃßÀû µÈ URLÀ» À̸ÞÀÏ¿¡ ÷ºÎÇϱâ À§ÇØ DjangoÀÇ EmailmultialTernatives ÁÖÀ§ÀÇ ¾ãÀº ·¡ÆÛ ÀÎ DJRillMessage Ŭ·¡½ºÀÇ »ç¿ë¹ýÀÌ ÇÊ¿äÇÕ´Ï´Ù. view : django.views.Generic °¡Á® ¿À±â ViewFrom djrill.mail °¡Á® ¿À±â djrillmessageClass sendeMailview (º¸±â) : de f get (self, ¿äû) : subject = "djrill message"from_email = "djrill@example.com"# ½ÂÀÎ µÈ ¹ß½ÅÀÚ Áß Çϳª°¡µÇ¾î¾ßÇÕ´Ï´Ù. .two @ example.com "] text_content ="À̸ÞÀÏÀÇ ÅؽºÆ® ¹öÀüÀÔ´Ï´Ù "html_content ="À̸ÞÀÏÀÇ HTML ¹öÀüÀÔ´Ï´Ù
Djrill. °ü·Ã ¼ÒÇÁÆ®¿þ¾î