Django+jenkins+python+RESTful framework 转发邮件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Django+jenkins+python+RESTful framework 转发邮件相关的知识,希望对你有一定的参考价值。

Django的设置:

project 下的settings.py 文件中加入以下配置信息:

EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend‘
EMAIL_USE_TLS = False
EMAIL_HOST = ‘xx‘
EMAIL_PORT = 25
EMAIL_HOST_USER = ‘‘
EMAIL_HOST_PASSWORD = ‘‘
DEFAULT_FROM_EMAIL = ‘xx‘


url.py 的文件中加入
urlpatterns = [
url(r‘^sendmail/$‘, send_emails.sendEmail,name=‘sendMails‘),
]
完整代码:
"""SendMail URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r‘^$‘, views.home, name=‘home‘)
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r‘^$‘, Home.as_view(), name=‘home‘)
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r‘^blog/‘, include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
from testEmail.test import Send_Email

urlpatterns = [
url(r‘^sendmail/$‘, send_emails.sendEmail,name=‘sendMails‘),
url(r‘^admin/‘, include(admin.site.urls)),
]
 

以上是关于Django+jenkins+python+RESTful framework 转发邮件的主要内容,如果未能解决你的问题,请参考以下文章

Django+jenkins+python+RESTful framework 转发邮件

Django+jenkins+python+RESTful framework(基于方法的视图) 转发邮件

Django+jenkins+python+RESTful framework(基于Class的视图) 转发邮件

Jenkins部署python项目

linux+jenkins+svn环境搭建以及自动部署django项目构建配置

Jenkins 持续化部署实例