随笔分类 - django
摘要:setting.py 1 # 邮件配置 2 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 3 EMAIL_HOST = 'smtp.exmail.qq.com' # 发送邮件的服务器地址 4 EMAIL_HOST_USER
阅读全文
摘要:需求:访问xx.com 跳转到xx.com/index 修改setting 同级别的urls.py 文件
阅读全文
摘要:一. uwsgi 安装 检验 配置uwsgi.ini 1. 安装 2. 检验 方法一(uwsgi启动文件): test.py内容如下: def application(env, start_response): start_response('200 OK', [('Content-Type','t
阅读全文
摘要:效果如下: 脚本: 1. 脚本结构 from django.utils.safestring import mark_safe class Page: ''' current_page: 当前页码 data_count: 数据总个数 per_page_count: 每页展示几个数据 pager_nu
阅读全文
摘要:请跳转: https://ops-coffee.cn/s/JVh4UnS2Tql9gUVaBSoGuA 补充: 创建: 方法一: d = { "name": "he", "age" : 17, } rec = models.Student.objects.create(**d) print("rec
阅读全文
摘要:from django.contrib.auth import login,authenticate,logoutfrom django.contrib.auth.decorators import login_requiredsetting.py AUTH_USER_MODEL = 'mytest
阅读全文