feat(projects): 新增Django综合案例示例代码及素材

This commit is contained in:
100gle
2022-08-10 16:15:39 +08:00
parent b4c2257308
commit 3bf65b2755
65 changed files with 1496 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
class Proxy:
def __init__(self, delegate):
self.delegate = delegate
def fetch(self):
print(f"fetching {self.delegate.url} by proxy...")
class Request:
def __init__(self, url, proxy=False):
self.url = url
self.proxy = Proxy(self) if proxy else None
if __name__ == "__main__":
req = Request("https://sspai.com", proxy=True)
req.proxy.fetch()