Skip to content

juandisay/ytDLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Server Manager

A standalone wxPython GUI application for managing Django development servers. Start your Django server with one click and automatically open it in your browser.

Python wxPython Django License

Features

  • 🚀 One-click server start/stop - Launch Django development server instantly
  • 🌐 Auto browser opening - Opens your app in the browser automatically
  • 📡 Local network access - Runs on your local IP for device testing
  • 📋 Live server logs - View Django output in real-time
  • 🔧 Configurable port - Change the port as needed
  • 📦 Standalone builds - Package as .app (macOS), .exe (Windows), or AppImage (Linux)

Project Structure

web_apps/
├── main.py                 # wxPython GUI application
├── setup.py                # py2app build configuration
├── pyinstaller.spec        # PyInstaller build configuration
├── dmg_settings.py         # DMG packaging settings (macOS)
├── build.sh                # Build script (macOS/Linux)
├── requirements.txt        # Python dependencies
├── README.md               # This file
└── project_django/         # Your Django project
    ├── manage.py
    └── config/
        ├── __init__.py
        ├── settings.py
        ├── urls.py
        ├── wsgi.py
        └── asgi.py

Quick Start

Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)

Installation

  1. Clone or download this project

  2. Create virtual environment and install dependencies:

cd web_apps
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Run the application:
python main.py

Or use the build script (macOS/Linux):

chmod +x build.sh
./build.sh run

Building Standalone Applications

macOS

Option 1: Using py2app (Recommended for DMG)

# Activate virtual environment
source venv/bin/activate

# Install build tools
pip install py2app dmgbuild

# Build the .app bundle
python setup.py py2app

# Create DMG installer
dmgbuild -s dmg_settings.py "Django Server Manager" dist/DjangoServerManager.dmg

Output: dist/DjangoServerManager.dmg

Option 2: Using PyInstaller

# Activate virtual environment
source venv/bin/activate

# Install PyInstaller
pip install pyinstaller

# Build the application
pyinstaller pyinstaller.spec --clean

Output: dist/DjangoServerManager.app

Using build.sh

# Build with PyInstaller
./build.sh build

# Build with py2app
./build.sh build-py2app

Windows

Prerequisites

# Install Python from https://python.org
# Ensure "Add Python to PATH" is checked during installation

# Create and activate virtual environment
python -m venv venv
venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
pip install pyinstaller

Build with PyInstaller

# Build executable
pyinstaller pyinstaller.spec --clean

Output: dist\DjangoServerManager\DjangoServerManager.exe

Create Windows Installer (Optional)

Using Inno Setup:

  1. Download and install Inno Setup
  2. Create installer.iss:
[Setup]
AppName=Django Server Manager
AppVersion=1.0.0
DefaultDirName={pf}\DjangoServerManager
DefaultGroupName=Django Server Manager
OutputDir=dist
OutputBaseFilename=DjangoServerManager-Setup

[Files]
Source: "dist\DjangoServerManager\*"; DestDir: "{app}"; Flags: recursesubdirs

[Icons]
Name: "{group}\Django Server Manager"; Filename: "{app}\DjangoServerManager.exe"
Name: "{commondesktop}\Django Server Manager"; Filename: "{app}\DjangoServerManager.exe"
  1. Compile with Inno Setup Compiler

Linux

Prerequisites

# Ubuntu/Debian
sudo apt update
sudo apt install python3 python3-pip python3-venv
sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev  # For wxPython

# Fedora/RHEL
sudo dnf install python3 python3-pip
sudo dnf install gtk3-devel webkit2gtk3-devel

# Arch Linux
sudo pacman -S python python-pip gtk3 webkit2gtk

Setup Environment

# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies (wxPython may take a while to build)
pip install -r requirements.txt
pip install pyinstaller

Build with PyInstaller

# Build executable
pyinstaller pyinstaller.spec --clean

Output: dist/DjangoServerManager/DjangoServerManager

Create AppImage (Optional)

  1. Install appimagetool

  2. Create AppDir structure:

mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps

# Copy built application
cp -r dist/DjangoServerManager/* AppDir/usr/bin/

# Create .desktop file
cat > AppDir/DjangoServerManager.desktop << EOF
[Desktop Entry]
Type=Application
Name=Django Server Manager
Exec=DjangoServerManager
Icon=django-server-manager
Categories=Development;
EOF

cp AppDir/DjangoServerManager.desktop AppDir/usr/share/applications/

# Create AppRun
cat > AppDir/AppRun << 'EOF'
#!/bin/bash
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
exec "${HERE}/usr/bin/DjangoServerManager" "$@"
EOF
chmod +x AppDir/AppRun
  1. Build AppImage:
ARCH=x86_64 appimagetool AppDir DjangoServerManager-x86_64.AppImage

Output: DjangoServerManager-x86_64.AppImage


Configuration

Django Project Location

The application automatically detects the Django project in project_django/ folder relative to main.py. To use a different project:

  1. Replace the contents of project_django/ with your Django project
  2. Ensure manage.py is in the project_django/ root

ALLOWED_HOSTS

For local network access, ensure your Django settings.py includes:

ALLOWED_HOSTS = ["*"]  # For development only

Port Configuration

Default port is 8000. Change it in the GUI using the port selector.


Development

Running in Development Mode

source venv/bin/activate  # Linux/macOS
# or
venv\Scripts\activate     # Windows

python main.py

Project Dependencies

Package Purpose
wxPython GUI framework
Django Web framework
py2app macOS app bundling
PyInstaller Cross-platform bundling
dmgbuild macOS DMG creation

Adding Your Django Apps

  1. Create your apps in project_django/:

    cd project_django
    python manage.py startapp myapp
  2. Add to INSTALLED_APPS in config/settings.py

  3. Rebuild the standalone application


Troubleshooting

macOS: "App is damaged and can't be opened"

xattr -cr dist/DjangoServerManager.app

macOS: Code signing for distribution

codesign --deep --force --verify --verbose --sign "Developer ID Application: Your Name" dist/DjangoServerManager.app

Linux: wxPython installation fails

Try installing pre-built wheel:

pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython

Windows: Missing DLL errors

Ensure Visual C++ Redistributable is installed:

Django: ModuleNotFoundError

Ensure you're running from the correct virtual environment:

source venv/bin/activate
which python  # Should point to venv/bin/python

License

MIT License - feel free to use and modify as needed.


Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

yt-dlp GUI run in local

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published