-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_backend.bat
More file actions
44 lines (35 loc) · 1.38 KB
/
setup_backend.bat
File metadata and controls
44 lines (35 loc) · 1.38 KB
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
40
41
42
43
44
@echo off
REM Backend Setup Script for Windows
echo 🚀 Setting up Devmine.io Backend...
REM Navigate to backend directory
cd backend
REM Create virtual environment
echo 📦 Creating Python virtual environment...
python -m venv venv
REM Activate virtual environment
echo 🔄 Activating virtual environment...
call venv\Scripts\activate.bat
REM Install dependencies
echo 📚 Installing Python dependencies...
pip install -r requirements.txt
REM Copy environment file
echo ⚙️ Setting up environment variables...
copy .env.example .env
REM Generate Django secret key
echo 🔑 Generating Django secret key...
python -c "from django.core.management.utils import get_random_secret_key; import re; content = open('.env', 'r').read(); secret_key = get_random_secret_key(); content = re.sub(r'SECRET_KEY=.*', f'SECRET_KEY={secret_key}', content); open('.env', 'w').write(content); print('✅ Secret key generated and saved to .env')"
REM Run database migrations
echo 🗄️ Running database migrations...
python manage.py makemigrations waitlist
python manage.py migrate
echo.
echo ✅ Backend setup complete!
echo.
echo To start the backend server:
echo cd backend
echo call venv\Scripts\activate.bat
echo python manage.py runserver 8000
echo.
echo Django Admin will be available at: http://localhost:8000/admin/
echo API endpoints will be available at: http://localhost:8000/api/waitlist/
pause