新功能(APP模板): 添加一个模板App,方便快速创建app

pull/28/head
李强 2021-05-10 22:48:02 +08:00
parent c72574c1ef
commit d8bf287c85
13 changed files with 13 additions and 33 deletions

View File

@ -1,31 +0,0 @@
from logging import StreamHandler, getLevelName
from logging.handlers import RotatingFileHandler
from typing import Optional, IO
class MyStreamHandler(StreamHandler):
def __init__(self, stream: Optional[IO[str]] = ...) -> None:
print(222)
super().__init__(stream)
def __repr__(self):
level = getLevelName(self.level)
name = getattr(self.stream, 'name', '')
# bpo-36015: name can be an int
name = str(name)
if name:
name += ' '
print(111)
return '<%s %s(%s)>' % (self.__class__.__name__, name, level)
class MyRotatingFileHandler(RotatingFileHandler):
def __init__(self, filename: str, mode: str = ..., maxBytes: int = ..., backupCount: int = ...,
encoding: Optional[str] = ..., delay: bool = ...) -> None:
print(4444)
super().__init__(filename, mode, maxBytes, backupCount, encoding, delay)
def __repr__(self):
level = getLevelName(self.level)
print(22)
return '<%s %s (%s)>' % (self.__class__.__name__, self.baseFilename, level)

View File

@ -1,6 +1,6 @@
from django.apps import AppConfig
class PermissionConfig(AppConfig):
class SystemConfig(AppConfig):
name = 'vadmin.system'
verbose_name = "权限管理"
verbose_name = "系统管理"

View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class TemplateConfig(AppConfig):
name = 'vadmin.template'
verbose_name = "模板App"

View File

@ -0,0 +1,2 @@
# from ..models.xxx import Xxx

View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.