-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_project.bat
39 lines (30 loc) · 945 Bytes
/
start_project.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
echo Setting up the Django Project Environment...
:: Step 1: Create a Virtual Environment
echo Creating a virtual environment...
python -m venv env
if %errorlevel% neq 0 goto Error
:: Step 2: Activate the Virtual Environment
echo Activating the virtual environment...
call env\Scripts\activate
if %errorlevel% neq 0 goto Error
:: Step 3: Install Requirements
echo Installing requirements from requirements.txt...
pip install -r requirements.txt
if %errorlevel% neq 0 goto Error
:: Step 4: Run Migrations
echo Running makemigrations and migrate...
python manage.py makemigrations
python manage.py migrate
if %errorlevel% neq 0 goto Error
:: Step 5: Start the Django Development Server
echo Starting the Django server...
echo Go to the address: http://127.0.0.1:8000/registration/login
python manage.py runserver
goto End
:Error
echo There was an error setting up the Django environment.
pause
:End
echo Script completed.
pause