feat: 初始化项目

This commit is contained in:
Czw 2021-11-04 17:35:34 +08:00
commit add2ca4c3f
108 changed files with 1290 additions and 0 deletions

122
.gitignore vendored Normal file
View file

@ -0,0 +1,122 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# Project
.vscode/
apps/*/migrations/*
!apps/*/migrations/__init__.py
trash/
media/

22
Pipfile Normal file
View file

@ -0,0 +1,22 @@
[[source]]
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
verify_ssl = true
name = "pypi"
[packages]
django = "*"
djangorestframework = "*"
djangorestframework-simplejwt = "*"
drf-spectacular = "*"
django-filter = "*"
django-extensions = "*"
django-debug-toolbar = "*"
pillow = "*"
pendulum = "*"
number-precision = "*"
[dev-packages]
autopep8 = "*"
[requires]
python_version = "3.9"

337
Pipfile.lock generated Normal file
View file

@ -0,0 +1,337 @@
{
"_meta": {
"hash": {
"sha256": "b804990d25bd72aa8500af6265bb585c58e476da563e0933f03d4cbacd435e0f"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.9"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.tuna.tsinghua.edu.cn/simple/",
"verify_ssl": true
}
]
},
"default": {
"asgiref": {
"hashes": [
"sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9",
"sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214"
],
"markers": "python_version >= '3.6'",
"version": "==3.4.1"
},
"attrs": {
"hashes": [
"sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1",
"sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
"version": "==21.2.0"
},
"django": {
"hashes": [
"sha256:51284300f1522ffcdb07ccbdf676a307c6678659e1284f0618e5a774127a6a08",
"sha256:e22c9266da3eec7827737cde57694d7db801fedac938d252bf27377cec06ed1b"
],
"index": "pypi",
"version": "==3.2.9"
},
"django-debug-toolbar": {
"hashes": [
"sha256:8c5b13795d4040008ee69ba82dcdd259c49db346cf7d0de6e561a49d191f0860",
"sha256:d7bab7573fab35b0fd029163371b7182f5826c13da69734beb675c761d06a4d3"
],
"index": "pypi",
"version": "==3.2.2"
},
"django-extensions": {
"hashes": [
"sha256:50de8977794a66a91575dd40f87d5053608f679561731845edbd325ceeb387e3",
"sha256:5f0fea7bf131ca303090352577a9e7f8bfbf5489bd9d9c8aea9401db28db34a0"
],
"index": "pypi",
"version": "==3.1.3"
},
"django-filter": {
"hashes": [
"sha256:632a251fa8f1aadb4b8cceff932bb52fe2f826dd7dfe7f3eac40e5c463d6836e",
"sha256:f4a6737a30104c98d2e2a5fb93043f36dd7978e0c7ddc92f5998e85433ea5063"
],
"index": "pypi",
"version": "==21.1"
},
"djangorestframework": {
"hashes": [
"sha256:6d1d59f623a5ad0509fe0d6bfe93cbdfe17b8116ebc8eda86d45f6e16e819aaf",
"sha256:f747949a8ddac876e879190df194b925c177cdeb725a099db1460872f7c0a7f2"
],
"index": "pypi",
"version": "==3.12.4"
},
"djangorestframework-simplejwt": {
"hashes": [
"sha256:30b10e7732395c44d21980f773214d2b9bdeadf2a6c6809cd1a7c9abe272873c",
"sha256:ddcbeef51155d1e71410dde44b581c7e04cfb74776f5337661ac3ef4c0c367e6"
],
"index": "pypi",
"version": "==5.0.0"
},
"drf-spectacular": {
"hashes": [
"sha256:af8a0c7c46e82c68aa70c474e3b23fa23bb16e4600270184af8230f5bd76aabb",
"sha256:cbc43c8b67bd52a4ff31c4c950419be5257b8a4718cb966e7d2876371692edc1"
],
"index": "pypi",
"version": "==0.20.2"
},
"inflection": {
"hashes": [
"sha256:1a29730d366e996aaacffb2f1f1cb9593dc38e2ddd30c91250c6dde09ea9b417",
"sha256:f38b2b640938a4f35ade69ac3d053042959b62a0f1076a5bbaa1b9526605a8a2"
],
"markers": "python_version >= '3.5'",
"version": "==0.5.1"
},
"jsonschema": {
"hashes": [
"sha256:2b563117f3659a7f433dffe1371c88f52115b79133493f376f15724b9caa7efa",
"sha256:e2d3601321ac74d38214e2853300ae740cd07e53d919a15862b8c71f9d840574"
],
"markers": "python_version >= '3.7'",
"version": "==4.2.0"
},
"number-precision": {
"hashes": [
"sha256:2a286e085656f0462d5fdaca56f0e745f7e6473b450ea86b807cbd5fd551487d",
"sha256:5de51a77e00fc450c211102b170f4cbcf42e48f5a17efd6fb53b5cdfe91afd37"
],
"index": "pypi",
"version": "==2021.1.30"
},
"pendulum": {
"hashes": [
"sha256:0731f0c661a3cb779d398803655494893c9f581f6488048b3fb629c2342b5394",
"sha256:1245cd0075a3c6d889f581f6325dd8404aca5884dea7223a5566c38aab94642b",
"sha256:29c40a6f2942376185728c9a0347d7c0f07905638c83007e1d262781f1e6953a",
"sha256:2d1619a721df661e506eff8db8614016f0720ac171fe80dda1333ee44e684087",
"sha256:318f72f62e8e23cd6660dbafe1e346950281a9aed144b5c596b2ddabc1d19739",
"sha256:33fb61601083f3eb1d15edeb45274f73c63b3c44a8524703dc143f4212bf3269",
"sha256:3481fad1dc3f6f6738bd575a951d3c15d4b4ce7c82dce37cf8ac1483fde6e8b0",
"sha256:4c9c689747f39d0d02a9f94fcee737b34a5773803a64a5fdb046ee9cac7442c5",
"sha256:7c5ec650cb4bec4c63a89a0242cc8c3cebcec92fcfe937c417ba18277d8560be",
"sha256:94b1fc947bfe38579b28e1cccb36f7e28a15e841f30384b5ad6c5e31055c85d7",
"sha256:9702069c694306297ed362ce7e3c1ef8404ac8ede39f9b28b7c1a7ad8c3959e3",
"sha256:b06a0ca1bfe41c990bbf0c029f0b6501a7f2ec4e38bfec730712015e8860f207",
"sha256:b6c352f4bd32dff1ea7066bd31ad0f71f8d8100b9ff709fb343f3b86cee43efe",
"sha256:c501749fdd3d6f9e726086bf0cd4437281ed47e7bca132ddb522f86a1645d360",
"sha256:c807a578a532eeb226150d5006f156632df2cc8c5693d778324b43ff8c515dd0",
"sha256:db0a40d8bcd27b4fb46676e8eb3c732c67a5a5e6bfab8927028224fbced0b40b",
"sha256:de42ea3e2943171a9e95141f2eecf972480636e8e484ccffaf1e833929e9e052",
"sha256:e95d329384717c7bf627bf27e204bc3b15c8238fa8d9d9781d93712776c14002",
"sha256:f5e236e7730cab1644e1b87aca3d2ff3e375a608542e90fe25685dae46310116",
"sha256:f888f2d2909a414680a29ae74d0592758f2b9fcdee3549887779cd4055e975db",
"sha256:fb53ffa0085002ddd43b6ca61a7b34f2d4d7c3ed66f931fe599e1a531b42af9b"
],
"index": "pypi",
"version": "==2.1.2"
},
"pillow": {
"hashes": [
"sha256:066f3999cb3b070a95c3652712cffa1a748cd02d60ad7b4e485c3748a04d9d76",
"sha256:0a0956fdc5defc34462bb1c765ee88d933239f9a94bc37d132004775241a7585",
"sha256:0b052a619a8bfcf26bd8b3f48f45283f9e977890263e4571f2393ed8898d331b",
"sha256:1394a6ad5abc838c5cd8a92c5a07535648cdf6d09e8e2d6df916dfa9ea86ead8",
"sha256:1bc723b434fbc4ab50bb68e11e93ce5fb69866ad621e3c2c9bdb0cd70e345f55",
"sha256:244cf3b97802c34c41905d22810846802a3329ddcb93ccc432870243211c79fc",
"sha256:25a49dc2e2f74e65efaa32b153527fc5ac98508d502fa46e74fa4fd678ed6645",
"sha256:2e4440b8f00f504ee4b53fe30f4e381aae30b0568193be305256b1462216feff",
"sha256:3862b7256046fcd950618ed22d1d60b842e3a40a48236a5498746f21189afbbc",
"sha256:3eb1ce5f65908556c2d8685a8f0a6e989d887ec4057326f6c22b24e8a172c66b",
"sha256:3f97cfb1e5a392d75dd8b9fd274d205404729923840ca94ca45a0af57e13dbe6",
"sha256:493cb4e415f44cd601fcec11c99836f707bb714ab03f5ed46ac25713baf0ff20",
"sha256:4acc0985ddf39d1bc969a9220b51d94ed51695d455c228d8ac29fcdb25810e6e",
"sha256:5503c86916d27c2e101b7f71c2ae2cddba01a2cf55b8395b0255fd33fa4d1f1a",
"sha256:5b7bb9de00197fb4261825c15551adf7605cf14a80badf1761d61e59da347779",
"sha256:5e9ac5f66616b87d4da618a20ab0a38324dbe88d8a39b55be8964eb520021e02",
"sha256:620582db2a85b2df5f8a82ddeb52116560d7e5e6b055095f04ad828d1b0baa39",
"sha256:62cc1afda735a8d109007164714e73771b499768b9bb5afcbbee9d0ff374b43f",
"sha256:70ad9e5c6cb9b8487280a02c0ad8a51581dcbbe8484ce058477692a27c151c0a",
"sha256:72b9e656e340447f827885b8d7a15fc8c4e68d410dc2297ef6787eec0f0ea409",
"sha256:72cbcfd54df6caf85cc35264c77ede902452d6df41166010262374155947460c",
"sha256:792e5c12376594bfcb986ebf3855aa4b7c225754e9a9521298e460e92fb4a488",
"sha256:7b7017b61bbcdd7f6363aeceb881e23c46583739cb69a3ab39cb384f6ec82e5b",
"sha256:81f8d5c81e483a9442d72d182e1fb6dcb9723f289a57e8030811bac9ea3fef8d",
"sha256:82aafa8d5eb68c8463b6e9baeb4f19043bb31fefc03eb7b216b51e6a9981ae09",
"sha256:84c471a734240653a0ec91dec0996696eea227eafe72a33bd06c92697728046b",
"sha256:8c803ac3c28bbc53763e6825746f05cc407b20e4a69d0122e526a582e3b5e153",
"sha256:93ce9e955cc95959df98505e4608ad98281fff037350d8c2671c9aa86bcf10a9",
"sha256:9a3e5ddc44c14042f0844b8cf7d2cd455f6cc80fd7f5eefbe657292cf601d9ad",
"sha256:a4901622493f88b1a29bd30ec1a2f683782e57c3c16a2dbc7f2595ba01f639df",
"sha256:a5a4532a12314149d8b4e4ad8ff09dde7427731fcfa5917ff16d0291f13609df",
"sha256:b8831cb7332eda5dc89b21a7bce7ef6ad305548820595033a4b03cf3091235ed",
"sha256:b8e2f83c56e141920c39464b852de3719dfbfb6e3c99a2d8da0edf4fb33176ed",
"sha256:c70e94281588ef053ae8998039610dbd71bc509e4acbc77ab59d7d2937b10698",
"sha256:c8a17b5d948f4ceeceb66384727dde11b240736fddeda54ca740b9b8b1556b29",
"sha256:d82cdb63100ef5eedb8391732375e6d05993b765f72cb34311fab92103314649",
"sha256:d89363f02658e253dbd171f7c3716a5d340a24ee82d38aab9183f7fdf0cdca49",
"sha256:d99ec152570e4196772e7a8e4ba5320d2d27bf22fdf11743dd882936ed64305b",
"sha256:ddc4d832a0f0b4c52fff973a0d44b6c99839a9d016fe4e6a1cb8f3eea96479c2",
"sha256:e3dacecfbeec9a33e932f00c6cd7996e62f53ad46fbe677577394aaa90ee419a",
"sha256:eb9fc393f3c61f9054e1ed26e6fe912c7321af2f41ff49d3f83d05bacf22cc78"
],
"index": "pypi",
"version": "==8.4.0"
},
"pyjwt": {
"hashes": [
"sha256:b888b4d56f06f6dcd777210c334e69c737be74755d3e5e9ee3fe67dc18a0ee41",
"sha256:e0c4bb8d9f0af0c7f5b1ec4c5036309617d03d56932877f2f7a0beeb5318322f"
],
"markers": "python_version >= '3.6'",
"version": "==2.3.0"
},
"pyrsistent": {
"hashes": [
"sha256:097b96f129dd36a8c9e33594e7ebb151b1515eb52cceb08474c10a5479e799f2",
"sha256:2aaf19dc8ce517a8653746d98e962ef480ff34b6bc563fc067be6401ffb457c7",
"sha256:404e1f1d254d314d55adb8d87f4f465c8693d6f902f67eb6ef5b4526dc58e6ea",
"sha256:48578680353f41dca1ca3dc48629fb77dfc745128b56fc01096b2530c13fd426",
"sha256:4916c10896721e472ee12c95cdc2891ce5890898d2f9907b1b4ae0f53588b710",
"sha256:527be2bfa8dc80f6f8ddd65242ba476a6c4fb4e3aedbf281dfbac1b1ed4165b1",
"sha256:58a70d93fb79dc585b21f9d72487b929a6fe58da0754fa4cb9f279bb92369396",
"sha256:5e4395bbf841693eaebaa5bb5c8f5cdbb1d139e07c975c682ec4e4f8126e03d2",
"sha256:6b5eed00e597b5b5773b4ca30bd48a5774ef1e96f2a45d105db5b4ebb4bca680",
"sha256:73ff61b1411e3fb0ba144b8f08d6749749775fe89688093e1efef9839d2dcc35",
"sha256:772e94c2c6864f2cd2ffbe58bb3bdefbe2a32afa0acb1a77e472aac831f83427",
"sha256:773c781216f8c2900b42a7b638d5b517bb134ae1acbebe4d1e8f1f41ea60eb4b",
"sha256:a0c772d791c38bbc77be659af29bb14c38ced151433592e326361610250c605b",
"sha256:b29b869cf58412ca5738d23691e96d8aff535e17390128a1a52717c9a109da4f",
"sha256:c1a9ff320fa699337e05edcaae79ef8c2880b52720bc031b219e5b5008ebbdef",
"sha256:cd3caef37a415fd0dae6148a1b6957a8c5f275a62cca02e18474608cb263640c",
"sha256:d5ec194c9c573aafaceebf05fc400656722793dac57f254cd4741f3c27ae57b4",
"sha256:da6e5e818d18459fa46fac0a4a4e543507fe1110e808101277c5a2b5bab0cd2d",
"sha256:e79d94ca58fcafef6395f6352383fa1a76922268fa02caa2272fff501c2fdc78",
"sha256:f3ef98d7b76da5eb19c37fda834d50262ff9167c65658d1d8f974d2e4d90676b",
"sha256:f4c8cabb46ff8e5d61f56a037974228e978f26bfefce4f61a4b1ac0ba7a2ab72"
],
"markers": "python_version >= '3.6'",
"version": "==0.18.0"
},
"python-dateutil": {
"hashes": [
"sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
"sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'",
"version": "==2.8.2"
},
"pytz": {
"hashes": [
"sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c",
"sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"
],
"version": "==2021.3"
},
"pytzdata": {
"hashes": [
"sha256:3efa13b335a00a8de1d345ae41ec78dd11c9f8807f522d39850f2dd828681540",
"sha256:e1e14750bcf95016381e4d472bad004eef710f2d6417240904070b3d6654485f"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==2020.1"
},
"pyyaml": {
"hashes": [
"sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293",
"sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b",
"sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57",
"sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b",
"sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4",
"sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07",
"sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba",
"sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9",
"sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287",
"sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513",
"sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0",
"sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0",
"sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92",
"sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f",
"sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2",
"sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc",
"sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c",
"sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86",
"sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4",
"sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c",
"sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34",
"sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b",
"sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c",
"sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb",
"sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737",
"sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3",
"sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d",
"sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53",
"sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78",
"sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803",
"sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a",
"sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174",
"sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"
],
"markers": "python_version >= '3.6'",
"version": "==6.0"
},
"six": {
"hashes": [
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
"sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'",
"version": "==1.16.0"
},
"sqlparse": {
"hashes": [
"sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae",
"sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d"
],
"markers": "python_version >= '3.5'",
"version": "==0.4.2"
},
"uritemplate": {
"hashes": [
"sha256:4346edfc5c3b79f694bccd6d6099a322bbeb628dbf2cd86eea55a456ce5124f0",
"sha256:830c08b8d99bdd312ea4ead05994a38e8936266f84b9a7878232db50b044e02e"
],
"markers": "python_version >= '3.6'",
"version": "==4.1.1"
}
},
"develop": {
"autopep8": {
"hashes": [
"sha256:44f0932855039d2c15c4510d6df665e4730f2b8582704fa48f9c55bd3e17d979",
"sha256:ed77137193bbac52d029a52c59bec1b0629b5a186c495f1eb21b126ac466083f"
],
"index": "pypi",
"version": "==1.6.0"
},
"pycodestyle": {
"hashes": [
"sha256:720f8b39dde8b293825e7ff02c475f3077124006db4f440dcbc9a20b76548a20",
"sha256:eddd5847ef438ea1c7870ca7eb78a9d47ce0cdb4851a5523949f2601d0cbbe7f"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
"version": "==2.8.0"
},
"toml": {
"hashes": [
"sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b",
"sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"
],
"markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'",
"version": "==0.10.2"
}
}
}

0
apps/data/__init__.py Normal file
View file

3
apps/data/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/data/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class DataConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'data'

View file

3
apps/data/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/data/tests.py Normal file
View file

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

3
apps/data/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/finance/__init__.py Normal file
View file

3
apps/finance/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/finance/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class FinanceConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'finance'

View file

3
apps/finance/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/finance/tests.py Normal file
View file

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

3
apps/finance/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/flow/__init__.py Normal file
View file

3
apps/flow/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/flow/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class FlowConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'flow'

View file

3
apps/flow/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/flow/tests.py Normal file
View file

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

3
apps/flow/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/goods/__init__.py Normal file
View file

3
apps/goods/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/goods/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class GoodsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'goods'

View file

3
apps/goods/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/goods/tests.py Normal file
View file

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

3
apps/goods/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/option/__init__.py Normal file
View file

3
apps/option/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/option/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class OptionConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'option'

View file

3
apps/option/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/option/tests.py Normal file
View file

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

3
apps/option/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

3
apps/purchase/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/purchase/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class PurchaseConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'purchase'

View file

3
apps/purchase/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/purchase/tests.py Normal file
View file

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

3
apps/purchase/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/sales/__init__.py Normal file
View file

3
apps/sales/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/sales/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class SalesConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'sales'

View file

3
apps/sales/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/sales/tests.py Normal file
View file

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

3
apps/sales/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

3
apps/statistic/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/statistic/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StatisticConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'statistic'

View file

3
apps/statistic/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/statistic/tests.py Normal file
View file

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

3
apps/statistic/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/stock_check/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StockCheckConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'stock_check'

View file

View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

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

View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

3
apps/stock_in/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/stock_in/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StockInConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'stock_in'

View file

3
apps/stock_in/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/stock_in/tests.py Normal file
View file

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

3
apps/stock_in/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

3
apps/stock_out/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/stock_out/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StockOutConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'stock_out'

View file

3
apps/stock_out/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
apps/stock_out/tests.py Normal file
View file

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

3
apps/stock_out/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

View file

View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class StockTransferConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'stock_transfer'

View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

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

View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

0
apps/system/__init__.py Normal file
View file

3
apps/system/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
apps/system/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class SystemConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'system'

View file

62
apps/system/models.py Normal file
View file

@ -0,0 +1,62 @@
from extensions.exceptions import ValidationError
from extensions.models import *
class Team(Model):
number = CharField(max_length=32, unique=True, verbose_name='编号')
expiry_time = DateTimeField(verbose_name='到期时间')
create_time = DateTimeField(auto_now_add=True, verbose_name='创建时间')
class PermissionType(Model):
"""权限类型"""
name = CharField(max_length=64, verbose_name='类型名称')
class Permission(Model):
"""权限"""
type = ForeignKey('system.PermissionType', on_delete=CASCADE, related_name='permissions', verbose_name='权限类型')
name = CharField(max_length=64, verbose_name='权限名称')
code = CharField(max_length=64, verbose_name='权限代码')
class Role(BaseModel):
"""角色"""
name = CharField(max_length=64, verbose_name='名称')
remark = CharField(max_length=256, blank=True, null=True, verbose_name='备注')
permissions = ManyToManyField('system.Permission', blank=True, related_name='roles', verbose_name='权限')
team = ForeignKey('system.Team', on_delete=CASCADE, related_name='roles')
class Meta:
unique_together = [('name', 'team')]
class User(BaseModel):
"""用户"""
username = CharField(max_length=64, verbose_name='用户名')
password = CharField(max_length=256, verbose_name='密码')
name = CharField(max_length=64, verbose_name='名称')
phone = CharField(max_length=32, blank=True, null=True, verbose_name='手机号')
email = CharField(max_length=256, blank=True, null=True, verbose_name='邮箱')
roles = ManyToManyField('system.Role', blank=True, related_name='users', verbose_name='角色')
is_manager = BooleanField(default=False, verbose_name='管理员状态')
is_active = BooleanField(default=True, verbose_name='激活状态')
create_time = DateTimeField(auto_now_add=True, verbose_name='创建时间')
team = ForeignKey('system.Team', on_delete=CASCADE, related_name='users')
class Meta:
unique_together = [('username', 'team')]
def validate(self):
if not self.is_active:
raise ValidationError(f'用户[{self.username}]未激活')
__all__ = [
'Team', 'PermissionType', 'Permission', 'Role', 'User',
]

3
apps/system/tests.py Normal file
View file

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

3
apps/system/views.py Normal file
View file

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.

53
extensions/exceptions.py Normal file
View file

@ -0,0 +1,53 @@
from django.db.models.deletion import ProtectedError
from rest_framework.exceptions import APIException
from django.db.utils import IntegrityError
from rest_framework import status
class AuthenticationFailed(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = '身份验证失败'
default_code = 'authentication_failed'
class NotAuthenticated(APIException):
status_code = status.HTTP_401_UNAUTHORIZED
default_detail = '未通过身份验证'
default_code = 'not_authenticated'
class ValidationError(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = '无效请求'
default_code = 'invalid'
class ParseError(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = '格式错误'
default_code = 'parse_error'
class PermissionDenied(APIException):
status_code = status.HTTP_403_FORBIDDEN
default_detail = '无权限执行操作.'
default_code = 'permission_denied'
class NotFound(APIException):
status_code = status.HTTP_404_NOT_FOUND
default_detail = '数据不存在'
default_code = 'not_found'
class ServerError(APIException):
status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
default_detail = '服务器错误'
default_code = 'server_error'
__all__ = [
'ProtectedError', 'IntegrityError',
'AuthenticationFailed', 'NotAuthenticated', 'ValidationError', 'ParseError',
'PermissionDenied', 'NotFound', 'ServerError',
]

32
extensions/models.py Normal file
View file

@ -0,0 +1,32 @@
from django.db.models import CharField, DateField, DateTimeField, JSONField, FileField, ImageField
from django.db.models import BooleanField, IntegerField, FloatField, DecimalField
from django.db.models.deletion import CASCADE, SET_NULL, SET_DEFAULT, PROTECT
from django.db.models import OneToOneField, ForeignKey, ManyToManyField
from django.db.models import Model, IntegerChoices, TextChoices
from django.db.models import Sum, Count, Value, F, Q, Prefetch
from django.db.models.functions import Coalesce
from django.db import transaction, connection
class BaseModel(Model):
def validate(self):
"""验证"""
class AmountField(DecimalField):
"""金额字段"""
def __init__(self, verbose_name=None, name=None, **kwargs):
kwargs['max_digits'], kwargs['decimal_places'] = 16, 2
super().__init__(verbose_name, name, **kwargs)
__all__ = [
'Model', 'BaseModel', 'IntegerChoices', 'TextChoices',
'CASCADE', 'SET_NULL', 'SET_DEFAULT', 'PROTECT',
'OneToOneField', 'ForeignKey', 'ManyToManyField',
'BooleanField', 'IntegerField', 'FloatField', 'DecimalField', 'AmountField',
'CharField', 'DateField', 'DateTimeField', 'JSONField', 'FileField', 'ImageField',
'Sum', 'Count', 'Value', 'F', 'Q', 'Prefetch', 'Coalesce', 'transaction', 'connection',
]

18
extensions/paginations.py Normal file
View file

@ -0,0 +1,18 @@
from rest_framework.pagination import PageNumberPagination
class BasePagination(PageNumberPagination):
invalid_page_message = '无效页面'
page_size_query_param = 'page_size'
max_page_size = 64
page_size = 16
class OptionPagination(BasePagination):
max_page_size = 999999
page_size = 16
__all__ = [
'BasePagination', 'OptionPagination',
]

52
extensions/routers.py Normal file
View file

@ -0,0 +1,52 @@
from rest_framework.routers import SimpleRouter, Route, DynamicRoute
class BaseRouter(SimpleRouter):
routes = [
# List route.
Route(
url=r'^{prefix}{trailing_slash}$',
mapping={
'get': 'list',
'post': 'create'
},
name='{basename}-list',
detail=False,
initkwargs={'suffix': 'List'}
),
# Dynamically generated list routes. Generated using
# @action(detail=False) decorator on methods of the viewset.
DynamicRoute(
url=r'^{prefix}/{url_path}{trailing_slash}$',
name='{basename}-{url_name}',
detail=False,
initkwargs={}
),
# Detail route.
Route(
url=r'^{prefix}/(?P<pk>\d+){trailing_slash}$',
mapping={
'get': 'retrieve',
'put': 'update',
'patch': 'partial_update',
'delete': 'destroy'
},
name='{basename}-detail',
detail=True,
initkwargs={'suffix': 'Instance'}
),
# Dynamically generated detail routes. Generated using
# @action(detail=True) decorator on methods of the viewset.
DynamicRoute(
url=r'^{prefix}/(?P<pk>\d+)/{url_path}{trailing_slash}$',
name='{basename}-{url_name}',
detail=True,
initkwargs={}
),
]
__all__ = [
'SimpleRouter', 'BaseRouter',
]

0
logs/master.pid Normal file
View file

22
manage.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()

Some files were not shown because too many files have changed in this diff Show more