Django框架中的使用者認證的實現
Django comes with a user authentication system. It handles user accounts, groups, permissions and cookie-based user sessions. This document explains how things work.
Overview
The auth system consists of:
1. Users
2. Permissions: Binary (yes/no) flags designating whether a user may perform. a certain task.
3. Groups: A generic way of applying labels and permissions to more than one user.
Installation
Authentication support is bundled as a Django application in django.contrib.auth. To install it, do the following:
1. Put 'django.contrib.auth' and 'django.contrib.contenttypes' in your INSTALLED_APPS setting. (The Permission model indjango.contrib.auth depends on django.contrib.contenttypes.)
2. Run the command manage.py syncdb.
Note that the default settings.py file created by django-admin.py startproject includes 'django.contrib.auth' and'django.contrib.contenttypes' in INSTALLED_APPS for convenience. If your INSTALLED_APPS already contains these apps, feel free to run manage.py syncdb again; you can run that command as many times as you’d like, and each time it’ll only install what’s needed.
The syncdb command creates the necessary database tables, creates permission objects for all installed apps that need ‘em, and prompts you to create a superuser account the first time you run it.
Once you’ve taken those steps, that’s it.
Overview
The auth system consists of:
1. Users
2. Permissions: Binary (yes/no) flags designating whether a user may perform. a certain task.
3. Groups: A generic way of applying labels and permissions to more than one user.
Installation
Authentication support is bundled as a Django application in django.contrib.auth. To install it, do the following:
1. Put 'django.contrib.auth' and 'django.contrib.contenttypes' in your INSTALLED_APPS setting. (The Permission model indjango.contrib.auth depends on django.contrib.contenttypes.)
2. Run the command manage.py syncdb.
Note that the default settings.py file created by django-admin.py startproject includes 'django.contrib.auth' and'django.contrib.contenttypes' in INSTALLED_APPS for convenience. If your INSTALLED_APPS already contains these apps, feel free to run manage.py syncdb again; you can run that command as many times as you’d like, and each time it’ll only install what’s needed.
The syncdb command creates the necessary database tables, creates permission objects for all installed apps that need ‘em, and prompts you to create a superuser account the first time you run it.
Once you’ve taken those steps, that’s it.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-750802/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Django的使用者認證元件Django元件
- Spark 框架安全認證實現Spark框架
- 在JBOSS中實現使用者安全認證
- 06.Django-使用者認證Django
- PHP框架中使用者認證和授權的實現方法與示例PHP框架
- Django 中介軟體實現使用者認證與IP頻率限制Django
- Django實戰1-許可權管理功能實現-03:使用者認證Django
- Django之使用者認證模組詳解Django
- Django 使用者認證系統:註冊Django
- Node.js的Koa實現JWT使用者認證Node.jsJWT
- 基於使用者認證的前後端實現後端
- Python Django進階教程(五)(session,Django使用者認證)PythonDjangoSession
- 訪問使用者中心實現認證
- Django使用者認證系統(一)User物件Django物件
- Django 使用者認證系統:基本設定Django
- 深入Django:使用者認證與許可權控制實戰指南Django
- 基於JWT標準的使用者認證介面實現JWT
- Solon Auth 認證框架使用演示(更簡單的認證框架)框架
- laravel5.1 — 實現多使用者認證Laravel
- express實現JWT使用者認證系統ExpressJWT
- 純 JavaScript 實現的 OAuth 認證JavaScriptOAuth
- Django整合OpenLDAP認證DjangoLDA
- .Net Core中自定義認證實現
- Django學習筆記(13)——Django的使用者認證元件,檢視層和QuerySet APIDjango筆記元件API
- Django實現驗證碼Django
- Django框架rest_framework中APIView的as_view()原始碼解析、認證、許可權、頻率控制Django框架RESTFrameworkAPIView原始碼
- Django REST framework中認證和許可權的使用方法DjangoRESTFramework
- Php中使用者身份認證實現二法PHP
- mongodb的使用者認證MongoDB
- Laravel核心解讀–使用者認證系統的實現細節Laravel
- Django(65)jwt認證原理DjangoJWT
- django 驗證碼框架Django框架
- Hyperf 框架使用 JWT 進行使用者認證框架JWT
- koa 實現 jwt 認證JWT
- Vue結合Django-Rest-Frameword結合實現登入認證(一)VueDjangoREST
- Vue結合Django-Rest-Frameword結合實現登入認證(二)VueDjangoREST
- 【Mongo】mongodb的使用者認證MongoDB
- LNMP—Nginx的使用者認證LNMPNginx