小编HEM*_*ARY的帖子

bootstrap 不适用于 django send_mail

在我的views.py中我有以下代码

def cpio(request):
    mainDict9=['hemant','jay','yash','Hari']
    args={'mainDict9':mainDict9,}

    msg_html =render_to_string('/home/user/infracom2/JournalContent/templates/JournalContent/test1.html', 
    {'mainDict9':mainDict9,})

   from_email = 'gorantl.chowdary@ak-enterprise.com'
   to_email = ['gorantla.chowdary@ak-enterprise.com']
   subject="TESTING MAIL"   
   send_mail('email title',subject,from_email,to_email,html_message=msg_html,)

return render(request,'JournalContent/test1.html',args)
Run Code Online (Sandbox Code Playgroud)

在我的 test1.html 中我有以下代码

<!DOCTYPE html>
    <html>
        <table class="table table-bordered">
        <thead>
            <tr>
                <th scope="col" class="table-secondary"><center>Modified Binaries/components</center></th>
                <th scope="col" class="table-secondary"><center>CRs</center></th>
           </tr>
        </thead>
        <tbody>
            {% for king in mainDict9 %}
            <tr>
                <td style="width: 10px;" class="table-active">{{ king }}</td>
                <td style="width: 10px;" class="table-active"></td>         
           </tr>
           {% endfor %}
       </tbody>
  </table>
</html>
Run Code Online (Sandbox Code Playgroud)

问题出在我的 GUI 中,引导代码工作正常,但是当我发送邮件中的内容时,引导函数不适用

python django bootstrap-4

4
推荐指数
1
解决办法
1036
查看次数

标签 统计

bootstrap-4 ×1

django ×1

python ×1