-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart-server.bat
More file actions
65 lines (57 loc) · 1.83 KB
/
Copy pathstart-server.bat
File metadata and controls
65 lines (57 loc) · 1.83 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@echo off
echo ========================================
echo Base64 Image Converter - Starting Server
echo ========================================
echo.
REM Check if UV is installed
where uv >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: UV is not installed or not in PATH
echo Please install UV first: https://github.com/astral-sh/uv
echo.
echo Quick install: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
pause
exit /b 1
)
REM Check if virtual environment exists, if not create it
if not exist ".venv" (
echo Creating virtual environment with UV...
uv venv
if %ERRORLEVEL% NEQ 0 (
echo Failed to create virtual environment
pause
exit /b 1
)
)
REM Sync dependencies with UV (installs from pyproject.toml)
echo Syncing dependencies...
uv sync
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Failed to sync dependencies
pause
exit /b 1
)
REM Run migrations (optional - only needed for admin/auth features)
echo Running database migrations...
uv run python manage.py migrate --noinput
REM Start server in background and save PID
echo Starting Django server with Waitress (production-ready WSGI server)...
echo Server will be available at http://127.0.0.1:8000
:: echo Server can handle multiple concurrent requests (100-200+ requests/day)
echo.
echo Opening browser...
timeout /t 2 /nobreak >nul
start chrome http://127.0.0.1:8000
echo.
echo ========================================
echo Server is running!
echo Press Ctrl+C to stop the server
echo ========================================
echo.
REM Start the server using Waitress (production WSGI server for Windows)
REM Waitress supports multiple threads and can handle concurrent requests
uv run waitress-serve --host=127.0.0.1 --port=8000 --threads=4 base64_project.wsgi:application
REM Cleanup on exit
echo.
echo Server stopped.
pause