PHPz2017-04-18 09:32:48
You can write a startproject command yourself
I wrote a flask startproject: mana
The general idea is as follows
Write a project prototype locally (you can add manage.py, User model with Auth)
Then consider the dynamic part (the part of the generated project that may change, such as the project name), and mark the dynamic part with an annotation format similar to #{{ xxx }}
Then write the command (click is recommended). The key is to use python os.walk to traverse your prototype (note the use of absolute paths), copy it to your generated project, and dynamically read the partial file replacement#{{ xxx }}
.
So you can
$ yourcommand startproject YourDjangoProject
$ cd YourDjangoProject (你想要的项目原型: 含manage.py, 含基本的User模型)
$ python manage.py makemigrations
$ python manage.py migrate
Cookiecutter is a scaffolding. If you are not satisfied with its function, you can write one yourself.
PHP中文网2017-04-18 09:32:48
If you want to know how to deal with it, just message me. No one is interested in this problem, and I am too lazy to write how to deal with it.