A lightweight Django app for managing SQLite databases through a web interface. Execute queries, manage multiple databases, create backups, and save query presets.
- 🗄️ Manage multiple SQLite databases
- 📝 Execute SQL queries with a clean interface
- 💾 Create timestamped database backups
- 🔖 Save and load query presets
- 📤 Export results to CSV
- 🆕 Create new databases from the interface
pip install django-sqlite-manager-plugin-
Add to
INSTALLED_APPSinsettings.py:INSTALLED_APPS = [ # ... other apps 'sqlite_manager', ]
-
Add URL pattern in your main
urls.py:from django.urls import path, include urlpatterns = [ # ... other urls path('sqlite-manager/', include('sqlite_manager.urls')), ]
-
Run migrations and start server:
python manage.py migrate python manage.py runserver
-
Access at:
http://localhost:8000/sqlite-manager/
Note: Directories databases/ and sqlite_presets/ are created automatically.
Important: Disable SQLite Manager in production environments for security.
# settings.py
# Disable in production (returns 404)
SQLITE_MANAGER_ENABLED = False
# Or use environment variable (recommended)
import os
SQLITE_MANAGER_ENABLED = os.getenv('SQLITE_MANAGER_ENABLED', 'False').lower() == 'true'Best Practice: Set to False by default, enable only in development:
# settings.py
DEBUG = os.getenv('DEBUG', 'False').lower() == 'true'
SQLITE_MANAGER_ENABLED = DEBUG # Only enable when DEBUG is True# settings.py
SQLITE_MANAGER_DB_DIR = BASE_DIR / 'databases' # default# settings.py
SQLITE_MANAGER_DB_DIR = Path('/path/to/your/database/directory')- Execute Queries: Select a database, click a table name to load schema, write SQL, click "Run Query"
- Create Database: Click "New Database", enter name
- Backup Database: Select database, click "Backup" (creates timestamped copy)
- Query Presets: Click "Save Current Query" to save, click preset name to load
- Export CSV: Run a SELECT query, click "Export CSV"
- DO NOT deploy to production or expose to the public internet
- DO NOT allow untrusted users to access this interface
- No authentication or authorization built-in
- Direct SQL execution capability
Production Safety: Set SQLITE_MANAGER_ENABLED = False in production settings to completely disable the app (returns 404). See Configuration section above.
Use only in local development environments. Always backup databases before running queries.
- Python ≥ 3.8
- Django ≥ 4.2
MIT License - See LICENSE file for details.
Contributions welcome! Open an issue or pull request on GitHub.
Remember: Development tool only. Keep it local, never expose to production! 🔒