Django的import模块整理

Django import模块:

AbstractUser:from django.contrib.auth.models import AbstractUser

admin:from django.contrib import admin

AppConfig:from django.apps import AppConfig

from django.contrib.auth import authenticate

forms:from django import forms

get_object_or_404:from django.shortcuts import get_object_or_404

get_filter_or_404:from django.shortcuts import get_filter_or_404

HttpResponse:from django.http import HttpResponse

HttpResponseRedirect:from django.http import HttpResponseRedirect

Http404:from django.http import Http404

include:from django.conf.urls import include

login:from django.contrib.auth import login

login_required:from django.contrib.auth.decorators import login_required

logout:from django.contrib.auth import logout

make_password:from django.contrib.auth.hashers import make_password

method_decorator:from django.utils.decorators import method_decorator

models:from django.db import models

Q:from django.db.models import Q

render:from django.shortcuts import render

render_to_response:from django.shortcuts import render_to_response

reverse:from django.urls import reverse

re_path:from django.urls import re_path

path:from django.urls import path

serve:from django.views.static import serve

url:from django.conf.urls import url

View:from django.views.generic.base import View

你可能感兴趣的:(Django的import模块整理)