Start Django dev server faster
Project description
Django shortcuts
You spend too much time typing python3 manage.py
The tool is already used by Uptrader team for more then a year
It's a fork of django-shortcuts by Johannes Gorset
Key improvements:
- Python 3 support (but no support for Python 2)
- config file for user-defined shortcuts
- support for python flags
Installation
$ pip3 install django-shts3
What problem does the helper script address
The tool allows much shorter commands when using Django's manage.py
script
Raw command
python3 manage.py shell
Command with django-shts3
helper
d s
Unlike raw command, the helper script can be called from any project subdirectory, not only from project root.
Usage
PyPi package installs django
and d
binaries
All arguments with -
at the begining before command are threated as Python flags.
$ django <command or shortcut>
$ cd any/project/subdirectory
$ d <command or shortcut>
Default shortcuts
Alias | Command |
---|---|
c | collectstatic |
r | runserver |
s / sh | shell |
t | test |
m | migrate |
mkm | makemigrations |
csu | createsuperuser |
cpw | changepassword |
sa | startapp |
sp | startproject |
Configuration file
The program looks for .django_shts3
file in home directory and loads extra commands from it.
They overwrite default commands. File format is:
alias @@@ command
m @@@ migrate
Example:
I have docker container with Django and I should bind to 0.0.0.0:8000 on runserver command, so I have:
$ cat ~/.django_shts3
r @@@ runserver 0.0.0.0:8000
That allows me to start Django server like:
$ d r
Or same thing, but with deprication warnings:
$ d -Wd r
Contributing
Pull requests are welcome!
Report all problems to GitLab issues
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_shts3-4.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f527eba14965f180de02aa7aaaba4b2b21a8e40652cdcd9aa2d202cfd5405e82 |
|
MD5 | f76529cd6fc6c24e42801a7e71af6eb7 |
|
BLAKE2b-256 | 532a2b6cdb1a90adb5b453a020c001134e5fd9c5cd86301bd954c5592c4a8494 |