更快地启动django dev服务器
django-shts3的Python项目详细描述
django快捷键
您花太多时间键入python3 manage.py
该工具已经被Uptrader团队使用一年多了
它是由Johannes Gorset构成的django-shortcuts叉
关键改进:
- Python3支持(但不支持Python2)
- 用户定义快捷方式的配置文件
- 支持python标志
安装
$ pip3 install django-shts3
帮助程序脚本解决了什么问题
当使用django的manage.py
脚本时,该工具允许更短的命令
原始命令
python3 manage.py shell
带有django-shts3
助手的命令
d s
与raw命令不同,helper脚本可以从任何项目子目录调用,而不仅仅是从项目根目录调用。
用法
pypi包安装django
和d
二进制文件
在before命令开始处使用-
的所有参数都将被威胁为python标志。
$ django <command or shortcut>
$ cd any/project/subdirectory
$ d <command or shortcut>
默认快捷键
Alias | Command |
---|---|
c | collectstatic |
r | runserver |
s / sh | shell |
t | test |
m | migrate |
mkm | makemigrations |
csu | createsuperuser |
cpw | changepassword |
sa | startapp |
sp | startproject |
配置文件
程序在主目录中查找.django_shts3
文件并从中加载额外的命令。
它们覆盖默认命令。文件格式为:
alias @@@ command
m @@@ migrate
示例:
我有带django的docker容器,我应该在runserver命令上绑定到0.0.0:8000,所以我有:
$ cat ~/.django_shts3
r @@@ runserver 0.0.0.0:8000
这使我可以像这样启动django服务器:
$ d r
或同样的事情,但有退润滑警告:
$ d -Wd r
贡献
欢迎拉取请求!
向GitLab issues报告所有问题