Boilerplate Script for Django Project Setup

Recently I started to learn to React and the best part about React is when I want to set up a new project I have ‘create-react-app’ which make a smoother experience in creating a project.

It installs all the required dependencies, initialized git and …


This content originally appeared on DEV Community and was authored by Kritebh Lagan Bibhakar

Recently I started to learn to React and the best part about React is when I want to set up a new project I have 'create-react-app' which make a smoother experience in creating a project.

It installs all the required dependencies, initialized git and added some extra file also.

But there is no such tool for Django or I don't know

Whenever I have to set up a new Project in Django, I have to do some repetitive task like :

  • python -m venv env
  • pip install django
  • git init
  • touch .gitignore
  • code .

Yack...

Waste of time

So I have created a PowerShell script that will create a Virtual Environment and install Django in a folder provided by you in the current directory.

After this It will also create a .gitignore file with "/env" and finally your project will open in VS Code

Prerequisite

  • Python Installed
  • Git Installed
  • Visual Studio Code Installed

Python Download

Git Download

Visual studio Code Download

How to use this script

First of all get the script.

GitHub logo kritebh / django-boilerplate-shell-script

A simple Shell Script to create Django Project in Virtual Environment

Note : Currently, I have created only three variant of this and download the most suitable script for you.

You can modify it according to your preferences.

Like if you don't want to open Visual Studio Code after creating the project then just remove the "code ."

Similarly, if you want to run the server after creating the project then you can use third script

Let's say you want to install more module like django-rest-framework or Pillow then just add the code like this after pip install django.

...
...
pip install django
pip install djangorestframework
pip install pillow
...
...

Put your script in the directory where you want to create a new folder and set up your Django Project.

Finally, Run the script by right-clicking on it and click on "Run with PowerShell"

Run with Powershell

Here is the screenshot of script in action :

Django Script

If you not creating a lot of project like me then it will fine for you to set up Project on your own.

But I think for those who are learning Django and creating a lot of projects then this script will help them ?

If you have any doubt regarding this or have any suggestions you can comment below.

Thanks for reading!


This content originally appeared on DEV Community and was authored by Kritebh Lagan Bibhakar


Print Share Comment Cite Upload Translate Updates
APA

Kritebh Lagan Bibhakar | Sciencx (2021-06-20T07:27:50+00:00) Boilerplate Script for Django Project Setup. Retrieved from https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/

MLA
" » Boilerplate Script for Django Project Setup." Kritebh Lagan Bibhakar | Sciencx - Sunday June 20, 2021, https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/
HARVARD
Kritebh Lagan Bibhakar | Sciencx Sunday June 20, 2021 » Boilerplate Script for Django Project Setup., viewed ,<https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/>
VANCOUVER
Kritebh Lagan Bibhakar | Sciencx - » Boilerplate Script for Django Project Setup. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/
CHICAGO
" » Boilerplate Script for Django Project Setup." Kritebh Lagan Bibhakar | Sciencx - Accessed . https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/
IEEE
" » Boilerplate Script for Django Project Setup." Kritebh Lagan Bibhakar | Sciencx [Online]. Available: https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/. [Accessed: ]
rf:citation
» Boilerplate Script for Django Project Setup | Kritebh Lagan Bibhakar | Sciencx | https://www.scien.cx/2021/06/20/boilerplate-script-for-django-project-setup/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.