摘要:
# 单例模式 # 模式一基于@classmethod class test: _instance = None def __init__(self, name=None): self.name = name @classmethod def singlenton(cls): if not cls._instance: ... 阅读全文
摘要:
from django.conf.urls import url from django.contrib import admin from django.shortcuts import HttpResponse # 路由分发的本质 def test1(request): return HttpResponse('text1') def test2(request): ... 阅读全文