This script automates the task of making a DjangoProject. A Django project involves a variety of tasks such as, Doing Template Inheritance in all templates, Applying migrations, Creating static files folder, Updating settings.py (with static root, StaticFiles_Dir, templates, media root and many more), Adding templates, Creating different directories, Updating urls and Importing important modules, so I made this script to automate these tasks.
- Clone this repository by using
git clone https://github.com/Hatim315/DjangoProjectStarter
- Run
pip install -r requirements.txt
- Enjoy!!
This script can be executed in two ways:
You can use arguments to specify different variables in this script.For example:
If you run ``` python DjangoProjectStarter.py -h ``` .It will give a list of all arguments to use with this script. These are:
-p For specifying name of the project
-a For specifying name of the app
-t For adding templates (You can skip this if you do not want to add any template yet.)
Execution: ``` python DjangoProjectStarter.py -p <Name of the Project> -a <Name of the app> -t <For adding templates> ```
You can just directly run the script like ```python DjangoProjectStarter.py ``` , and it will ask the above variables(name of the project , app and templates) in the form of user input.
For Instance;
```
Specify a unique name for the project:<project name>
Name of the app built in this project:<app name>
Base.html and About.html will be made automatically. You can give additional templates by inputting them with space in between or You can just simply press enter to skip this part.
Templates:<templates names>
```
After that the script will be run normally.
If you face any kind of error, you can raise an issue and specify it, so that I can fix it.
This script is created for automating basic django tasks which are performed while starting a project. If you have any more ideas to add in this script then feel free to contribute.