-
Notifications
You must be signed in to change notification settings - Fork 3
Environment variables
In this section will be described what are the environment variables that need to be set to make your life easy
Fist create a new directory to hold all your custom Django-Structure files. Ex:
mkdir ~/.myStructs
Than add to set DJSTRUCT_HOME to point to that folder. Ex(On Ubuntu):
echo "export DJSTRUCT_HOME=~/.myStructs" >> ~/.bashrc
With this you just need to put your custom project file(the YAML one) inside this folder and when you call the command to create a project you won't need to pass the hole path, just the file name that is inside the DJSTRUCT_HOME. Ex:
If you have a file named my_own_struct.yaml inside DJSTRUCT_HOME your command will be:
djstruct.py proj "project_name" my_own_struct.yaml
You can also set another env var, the DJSTRUCT_DEFAULT. With it you'll be able to use your custom structure without passing it in the command(it will be used by default instead of the Default Django-Structure file). Ex:
echo "export DJSTRUCT_DEFAULT=~/.myStructs/my_own_struct.yaml" >> ~/.bashrc
With this set you'll be able to use the "my_own_struct.yaml" to create your project just doing:
djstruct.py proj "project_name"