Giter Site home page Giter Site logo

django-login's Introduction

Django-Login

#进入项目 cd C:\project\Django-Login\DjangoLogin

#进入环境变量 C:\Users\wengmq\Virtualenv\DjangoLogin_env\Scripts\activate

#退出环境变量 deactivate

#安装依赖包 pip install -r requirements.txt 若是安装不行可以依次执行以下命令: python -m pip install --upgrade pip easy_install --upgrade pip

#创建项目 django-admin startproject DjangoLogin

#数据库迁移 python manage.py makemigrations python manage.py migrate

#创建管理账号,访问http://127.0.0.1:8000/admin/ python manage.py createsuperuser

在Django中发送邮件 其实在Python中已经内置了一个smtp邮件发送模块,Django在此基础上进行了简单地封装。

首先,我们需要在项目的settings文件中配置邮件发送参数,分别如下:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.sina.com' EMAIL_PORT = 25 EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = 'xxxxxxxxxxx' 第一行指定发送邮件的后端模块,大多数情况下照抄! 第二行,不用说,发送方的smtp服务器地址,建议使用新浪家的; 第三行,smtp服务端口,默认为25; 第四行,你在发送服务器的用户名; 第五行,对应用户的密码。

django-login's People

Contributors

wengmq avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.