The zsh
/bash
shell function to create a django project from scratch. This function creates and starts a new django project in the ~/sites/test.python
folder. To be able to correctly use this function please follow the installation guide.
To install this function you need to add the function to your bash/zsh/shell profile file and source the file.
- Have a proper version of Python installed on your machine.
- Have Python aliase or symlined to work with the command
python
, or change line58
of the function to use the correct python command, in most cases it can bepython3
.
- Copy and paste the contents of the file
shell-func.txt
into your~/.zshrc
or~/.bash_profile
file - Create the folder named
~/sites/test.python
or change line48
of the function to point to the folder you want your project to be created. - Run
source ~/.zshrc
orsource ~/.bash_profile
accordingly.
create [instance] [name] [-d --dev | -r --with-react]
Instance:
django : currently the only project instance allower. Soon Yii2 instance to be implemented
Name:
The name of the project to be created. Have in mind the diferente django and react restriction to naming projects.
Options (and corresponding environment variables):
-d --dev : starts the django development server with the --insecure flag to allow
static files from being pulled from any STATICFILES_DIRS directories
-r --with-react : creates the project with a React.js front-end module to separate between
the django back-end logic