Django | 高级之 Auth模块

【Django】Django用户认证: 利用Django Auth模块实现用户注册、登录与登出 Django内置认证体系介绍 使用Django内置模块Auth 简化用户注册、登录、登录逻辑 阅读详情

Auth模块是什么

Auth模块式是jango自带的用户认证码模块

我们在开发一个网站的时候,无可避免的需要设计实现网站的用户系统,此时我们需要实现包括用户注册、用户登录、用户认证、注销、修改密码等功能。

Django作为一个完美主义者的中级框架,当然也会想到用户的这些痛点,所以它内置了强大的用户认证系统-Auth。它默认使用auth_user表来存储用户数据。

在执行数据库迁移命令的时候,会自动生成一个默认的表,其中有auth_开头的很多表。 auth_user表的作用:Django自带的后台管理系统所依赖的数据就在这张表中。默认情况下是空表,没有用户名和密码。因此我们需要自己创建用户数据。但是我们创建的需要是一个超级管理员才能登录

python3.10 manage.py createsuperuser

zhangjiejia@zhangjiejiasMBP Atyuki % python3.10 manage.py createsuperuser
Username (leave blank to use 'zhangjiejia'): JJ
Email address: Jeazhang828@sina.com
Password: 
Password (again): 
Superuser created successfully.


在auth_user表里面is_superuser是1就是超级用户,0就是普通用户

Auth模块常用方法

Auth模块的登录功能

from django.contrib import auth  
# Auth模块的登录功能  
def auth_login(request):  
  
    if request.method == 'POST':  
        # 接收前端传过来的数据  
        username = request.POST.get('username')  
        password = request.POST.get('password')  

        # 验证用户名和密码是否正确  
        # 1. 去哪个表中核验  
        # 2. 要哪个字段来比较  

        '''  
        这里的登录我们使用Auth模块,登录的时候我们使用的表是auth_user这张表  
        '''  

        # 查看了源码后,发现后面是**打散,所以我们用关键字参数传参  
        user_obj = auth.authenticate(request, username=username, password=password)  
        print(user_obj) # 打印出来后是 用户名。 这个就是用户登录成功之后的用户对象  
        print(user_obj.username)  
        print(user_obj.password)  

        '''  
        注意事项:  
        传递参数的时候,用户名和密码必须同时传入。  
        '''  

        # 如果登录成功  
        if user_obj:  
        # 保存用户登录的状态, 这里切记既然已经使用了auth模块就继续使用auth模块不要再自己创建方法了  
        auth.login(request, user_obj)  

        # 而且只要写了auth.login,那么就可以在全局任何有request对象的地方通过request.user拿到用户的对象  

        return redirect(request, '/home/')  
    return render(request, 'auth/auth_login.html')

Auth模块的登录验证功能

# Auth模块的验证登录功能  
@login_required(login_url='/auth_login/')  
def auth_check(request):  
    print(request.user.is_authenticated)  

    if request.user.is_authenticated:  
        # 处理登录后的逻辑  
        pass  
    else:  
        print('check')  
        # 没有登录,跳转登录界面  
        redirect('/auth_login/')  
  
    return HttpResponse("LOGGINED")

Auth模块的退出登录登录

# 退出登录功能  
def logout(request):  
    # 清除cookie或者session  
    # 因为源码中需要用到request,所以request必须传  
    auth.logout(request)  
    return redirect('/home/')

Auth模块的修改密码功能

# Auth更改密码的功能  
def set_password(request):  
  
    if request.method == 'POST':  
        print('check1')  
        old_pswd = request.POST.get('old_password')  
        new_pswd = request.POST.get('new_password')  
        aga_pswd = request.POST.get('aga_password')  

        # 先验证两次密码是否输入一直  
        if new_pswd == aga_pswd:  
            print('check2')  
            # 验证老密码是否正确,否则不让修改  
            is_right = request.user.check_password(old_pswd)  

            if is_right:  
            print('check3')  
            # 修改密码  
            request.user.set_password(new_pswd)  
            request.user.save()  
            return redirect('/login/')  
    return render(request, 'Auth/set_password.html')

Auth模块注册功能

from django.contrib.auth.models import User  
def register(request):  
    if request.method == 'POST':  
        username = request.POST.get('username')  
        password_raw = request.POST.get('password_raw')  
        password_check = request.POST.get('password_check')  

        if password_raw == password_check:  
            User.objects.create_user(username=username, password=password_raw)  
            return redirect('/login/')  
  
return render(request, 'auth/register.html')

Auth模块的扩展

默认情况下使用的就是Auth_user的默认字段,但是我们也可以扩展自己的字段

前提是:所有的模型类都能继承,扩展之后需要再配置文件中加一句话 在扩展表之前数据库不能迁移,扩展这个表需要再迁移数据库之前。

如果迁移了后,还想扩展怎么办?

1. 换库
2. 需要删除很多个应用的migrations文件夹,auth_migration表里面的迁移记录也需要删除

所以在扩展表之前要想好都需要什么字段

---------------------------END---------------------------

题外话

感谢你能看到最后,给大家准备了一些福利!

感兴趣的小伙伴,赠送全套Python学习资料,包含面试题、简历资料等具体看下方。


👉优快云大礼包🎁:全网最全《Python学习资料》免费赠送🆓!(安全链接,放心点击)

一、Python所有方向的学习路线

Python所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照下面的知识点去找对应的学习资源,保证自己学得较为全面。

img

二、Python兼职渠道推荐*

学的同时助你创收,每天花1-2小时兼职,轻松稿定生活费.
在这里插入图片描述

三、最新Python学习笔记

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。

img

四、实战案例

纸上得来终觉浅,要学会跟着视频一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。

img

👉优快云大礼包🎁:全网最全《Python学习资料》免费赠送🆓!(安全链接,放心点击)

若有侵权,请联系删除

Django之Auth模块 文章目录一、 Auth模块是什么二、 auth模块常用方法authenticate()login(HttpRequest, user)logout(request)is_authenticated()login_requierd()create_user()check_password(password)set_password(password)三、 User对象的属性四、 扩展默认的auth_user表五、 auth模块补充六、 总代码主页 auth_page.htmlhome.html登录 login 阅读详情

相关推荐

Django自定义用户模型与社交认证实战

本文深入探讨了Django框架中如何使用自定义用户模型以及如何集成社交认证系统。通过替换默认的User模型,开发者能够获得更多的灵活性,但同时也面临集成第三方应用时的挑战。文章详细说明了Django消息框架的使用,用于向用户显示操作结果通知,并通过实例展示了如何创建自定义认证后端,包括使用电子邮件地址替代用户名进行认证。此外,还介绍了如何通过Python-social-auth模块添加社交认证,如Facebook、Twitter和Google等。

weixin_42126677的博客 492

[Django高级之Auth模块]

[Django高级之Auth模块] auth模块 ←详情点击查看 1、Auth模块是什么 Auth模块是Django自带的用户认证模块: 我们在开发一个网站的时候,无可避免的需要设计实现网站的用户系统。此时我们需要实现包括用户注册、用户登录、用户认证、注销、修改密码等功能,这还真是个麻烦的事情呢。 Django作为一个完美主义者的终极框架,当然也会想到用户的这些痛点。它内置了强大的用户认证系统–auth,它默认使用 auth_user 表来存储用户数据。 1 django提供的用户认证,创建,修改密码。。。

weixin_45032957的博客 168

湿式离合器KP点自学习:从怠速到高速,手把手教你两种主流方法的工程实现与避坑

本文深入解析湿式离合器KP点自学习的工程实现与避坑技巧,涵盖扭矩增量式和转速变化式两种主流方法。通过详细的操作步骤、参数设定和典型故障排除指南,帮助工程师精准捕捉摩擦片与钢片的接触瞬间,提升变速箱控制精度与稳定性,特别适用于DCT、AT及混动DHT系统的开发。

weixin_33686714的博客 412

Django用户认证

目录 一、Cookie保存登陆状态 二、使用DJango的auth模块 三、自定义auth用户认证 一、Cookie保存登陆状态 Cookie说明: Cookie是一段小信息(数据格式一般是类似key-value的键值对),由服务器生成,并发送给浏览器让浏览器保存(保存时间...

weixin_30808253的博客 216

jlink驱动安装

jlink驱动下载安装及keil识别

qq_43868701的博客 3万+

概率论与数理统计基础概念与重要定义汇总

文章目录一、随机事件和概率1:互斥,对立,独立事件的定义和性质。2:概率,条件概率和五大概率公式3:古典型,几何型概率和伯努利试验 一、随机事件和概率 1:互斥,对立,独立事件的定义和性质。 互斥事件\color{red}\textbf{互斥事件}互斥事件 事件A和B的交集为空,A与B就是互斥事件,也叫互不相容事件。也可叙述为:不可能同时发生的事件。如A∩B为不可能事件(A∩B=Φ),那么称事件A与事件B互斥,其含义是:事件A与事件B在任何一次试验中不会同时发生。 则P(A+B)=P(A)+P(B)(这个公

csyifanZhang的博客 1万+

Django集成OpenLDAP认证

本文详细介绍了django-auth-ldap的使用方法,参数含义,并提供了示例代码 版本说明 Django==2.2 django-auth-ldap==1.7.0 集成过程 Django集成LDAP认证有现成的django-auth-ldap模块可以使用,本文也主要以这个模块的使用为主,先安装模块 pip install django-auth-ldap 复制代码然后在setting....

weixin_34360651的博客 217

保姆级教程:在Ubuntu 20.04上从源码编译Apollo自动驾驶平台(含GPU环境配置)

本文提供了一份详细的Ubuntu 20.04上从源码编译Apollo自动驾驶平台的保姆级教程,包括GPU环境配置、Docker部署和编译构建等关键步骤。通过实战经验和避坑指南,帮助开发者高效完成Apollo平台的编译和验证,适用于自动驾驶技术研究和应用开发。

weixin_30876945的博客 409

django汇总

思维导图 一.基础 web框架 django基础 cookies session与cookie,django中间件 二.业务逻辑 django中CBV django中app分组 三.html渲染 html母版 django渲染高阶 django-分页 四.表单模型操作 django-orm框架表单的增删改查 django创建表单以及表单数据类型和属性 django根据已有数据库表生成mo...

aiyulove201314的博客 190

博途PLC信号处理系列之卡尔曼滤波程序(Kalman Filter)

三菱系列PLC的卡尔曼滤波程序,可以参看下面这篇博文PLC滤波算法之卡尔曼滤波(kalmanFilter)代码+测试_RXXW_Dor的博客-优快云博客_plc滤波kalman滤波是采用递归的方法解决线性滤波问题,只需要当前的测量值input(西门子PLC里比如我们的模拟量通道AIW0值)和前一个采样周期的估计值(上一个时刻的滤波输出结果last_out)就能进行状态估计,需要的存储空间小,每一步的计算量小。下面我们通过程序代码一一给大家展示下。注意。......

RXXW_Dor的博客 3477

Vivado ILA抓DDR信号(各种IO信号:差分、ISERDES、IOBUFDS等)

Vivado ILA抓DDR信号(各种IO信号:差分、ISERDES、IOBUFDS等)

千歌叹尽执夏的博客 1120

django进阶

Python之django进阶 文章目录Python之django进阶一、批量插入数据二、分页类的使用三、cookie介绍1、什么是cookie2、cookie的原理3、cookie版验证登录4、关于cookie的更多操作四、session介绍1、session相关方法2、session相关解析流程图3、session版验证登录五、CBV版添加装饰器六、中间件1、什么是中间件2、自定义中间件3、process_request4、process_response5、process_view6、process_

prigilm的博客 345

专为AI打造的浏览器:内存占用仅为Chrome的1/9、比Chrome快11倍(Docker部署教程,支持飞牛nas等服务器部署)

🚀 专为AI打造的无头浏览器来了! 用Zig从零构建,内存仅Chrome的1/9,速度快11倍,原生CDP协议支持Docker部署,适合爬虫、自动化测试和AI代理应用。✨

XiaoqiangClub的博客 738

Django——认证

登录就是认证,上一篇简单说了登录。认证是对身份的识别,出现的场景更加多样。 django自带auth模块使用 在登录中的实现方法基本都是采用django auth模块里的。 1.引入auth模块url from django.contrib.auth import urls as auth_urls url(r'^accounts/', include(auth_urls, namespace...

何惜戈 1786

Cadence OrCAD Capture 原理图中创建差分对约束的两种常用方法

本文介绍在原理图设计阶段,添加差分对的方法。

fydar的博客 3932

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Django知识回顾-05

cookie和session的使用、中间件、csrf认证相关、Auth的使用、orm的链接方式、中间件+logru案例、auth模块案例、IP访问频率限制案例

zhoujiajia的博客 1447

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Django 教程

第一篇:web应用HTTP协议web框架 第二篇:Djangon简介 第三篇:路由控制 第四篇:视图层 第五篇:模版层 第六篇:模型层:单表操作,多表操作,常用(非常用)字段和参数,Django-model进阶 第七篇:组件:Django与Ajax,分页器组件,forms组件,cookie与session组件,中间件组件,Auth模块,ContentType组件 ...

ball4022的博客 132

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

Django 框架

第一篇: Django简介 第二篇: 路由控制 第三篇: 视图层 第四篇: 模版层 第五篇: 1.ORM常用字段及参数2.F与Q查询,事务及其他 第六篇: 1.Django与Ajax 2.分页器组件 3.form组件 4.Cookie与Session组件 5.中间件 6.Auth认证模块 第七篇(Rest Framework):1.R...

weixin_30438813的博客 152

【Django基础】auth认证模块

https://www.cnblogs.com/DuoDuosg/p/17005583.html 一、django的auth认证模块 1.什么是auth模块 Auth模块是Django自带的用户认证模块: 我们在开发一个网站的时候,无可避免的需要设计实现网站的用户系统。此时我们需要实现包括用户注册、用户登录、用户认证、注销、修改密码等功能,这还真是个麻烦的事情呢。 Django作为一个完美主义者...

TT小子的博客 1289

Django Auth模块

文章目录1. Auth 模块简介2. Auth 模块方法(2.1) createsuperuser(2.2) auth.authenticate()(2.3) auth.login(HttpRequest, user)(2.4) request.user.is_authenticated()(2.5) 登录装饰器logout(request)request.user.check_password()request.set_password(password)、request.user.save() 1. A

XWenXiang的博客 1167

Django auth模块

还可以为组分配权限。这些权限决定了组的成员可以访问和修改哪些资源。可以查看一个组的成员,或者将用户添加到组中,或者从组中移除用户。在组管理界面,可以查看、创建、修改和删除组。组是一种方便的方式来管理一组有相同权限的用户。视图函数只能被已经登录的用户访问。需要修改配置文件settings。所以需要提前执行迁移数据库命令。新表内不要创建已有的字段。如果用户没有登录,它将。默认数据保存在数据库。

weixin_48183870的博客 2184

Django之Auth认证模块

在平常我们使用Django开发的过程中都需要设计Web用户系统其中包含:用户注册、登录、修改密码、登录认证、注销等功能。而这些都是由我们手动将数据拿到数据库表中一一匹对,太过于麻烦。那么我们今天使用到的Auth模块可以完美解决这个问题,提升使用Django的开发效率。

Mchen的博客 1600
上一篇: Python 学习路线:介绍、基础语法、数据结构、算法、高级主题、框架及异步编程详解
下一篇: Python | 变量类型详解
Python_P叔
博客等级 码龄3年 5455粉丝 827原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值