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框架
- PHP框架中使用者認證和授權的實現方法與示例PHP框架
- 06.Django-使用者認證Django
- Django 中介軟體實現使用者認證與IP頻率限制Django
- Django實戰1-許可權管理功能實現-03:使用者認證Django
- Node.js的Koa實現JWT使用者認證Node.jsJWT
- 基於使用者認證的前後端實現後端
- 訪問使用者中心實現認證
- 基於JWT標準的使用者認證介面實現JWT
- 深入Django:使用者認證與許可權控制實戰指南Django
- Django使用者認證系統(一)User物件Django物件
- Django之使用者認證模組詳解Django
- Solon Auth 認證框架使用演示(更簡單的認證框架)框架
- laravel5.1 — 實現多使用者認證Laravel
- express實現JWT使用者認證系統ExpressJWT
- Django學習筆記(13)——Django的使用者認證元件,檢視層和QuerySet APIDjango筆記元件API
- Django整合OpenLDAP認證DjangoLDA
- Django實現驗證碼Django
- Laravel核心解讀–使用者認證系統的實現細節Laravel
- Django框架rest_framework中APIView的as_view()原始碼解析、認證、許可權、頻率控制Django框架RESTFrameworkAPIView原始碼
- .Net Core中自定義認證實現
- Django REST framework中認證和許可權的使用方法DjangoRESTFramework
- django 驗證碼框架Django框架
- Hyperf 框架使用 JWT 進行使用者認證框架JWT
- Django(65)jwt認證原理DjangoJWT
- 【Mongo】mongodb的使用者認證MongoDB
- 酒店如何實現上網認證的呢
- 認證授權的設計與實現
- Vue結合Django-Rest-Frameword結合實現登入認證(二)VueDjangoREST
- Vue結合Django-Rest-Frameword結合實現登入認證(一)VueDjangoREST
- python django中restful框架的使用PythonDjangoREST框架
- Laravel核心程式碼學習–使用者認證系統的實現細節Laravel
- Laravel核心程式碼學習--使用者認證系統的實現細節Laravel
- Laravel 使用者認證最簡單的實現 比 Jetstream 要簡單很多Laravel
- 自定義Django認證系統的技術方案Django
- 基於 JWT + Refresh Token 的使用者認證實踐JWT
- [譯]React中的使用者認證(登入態管理)React
- koa 實現 jwt 認證JWT