Wipe migrations, reset the dev database, and sync Django models — for dev mode only.
Project description
🛠️ django-devsync
A tiny command-line tool that mimics synchronize: true from TypeORM — but for Django.
⚠️ Strictly for development use. Never use in production.
🚀 What It Does
In early-stage development, database schemas change fast and migrations get messy. django-devsync helps you:
- 🧹 Delete all migration files
- 💥 Reset your local DB schema
- 🔄 Run
makemigrationsandmigratefrom scratch
All with a single command.
🛑 Don't Use In Production
This tool WILL destroy data and has minimal safeguards.
You’ve been warned 🧨
📦 Installation
pip install django-devsync
💻 Usage
devsync --delete_migrations --reset_db --run_sync
or
python -m django_devsync --delete_migrations --reset_db --run_sync
If no flags are passed, it runs all steps.
Flags
| Flag | Description |
|---|---|
--delete_migrations |
Delete all .py and .pyc files in migrations/ directories |
--reset_db |
Drop all tables/schemas in your local DB (SQLite/PostgreSQL/MySQL) |
--run_sync |
Run makemigrations and migrate |
📂 Example
devsync
or
python -m django_devsync
Output:
🔧 No specific flags passed — running ALL steps:
• Deleting all migrations
• Resetting the database
• Running makemigrations and migrate
✅ All done!
⚙️ Supported Databases
- SQLite
- MySQL
- PostgreSQL
Uses Django's
DATABASES['default']['ENGINE']to detect backend.
🧠 How It Works
- Prompts for your
DJANGO_SETTINGS_MODULE(unless set in env) - Verifies
DEBUG=Truebefore proceeding - Uses Django internals:
call_command("makemigrations"), etc. - Drops and recreates schemas/tables directly with SQL
📬 Contributions
Bug reports, feedback, and PRs are welcome. Stars are appreciated ⭐
📜 License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_devsync-0.1.0.tar.gz.
File metadata
- Download URL: django_devsync-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6daf72fb2e115576ee80ca77a0b4c58eba93723fbfe95e6ac659f902ab8b017
|
|
| MD5 |
7df04e53d9bc166796ce99f689a9e3c5
|
|
| BLAKE2b-256 |
eae83ebdc3306d9d29e0bc2b7e5adc1ba17fa72f02be50ff0cb419884941f707
|
File details
Details for the file django_devsync-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_devsync-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42aa5b276135528b4bc98f34ccf7a1ec5c9593ee0459c97511799d4245b64369
|
|
| MD5 |
a98e201f9e90f83d0c7dc6eb9e04ebff
|
|
| BLAKE2b-256 |
57ec7aaeb9ed91611016bdebe257100c00aa3cbb107b723100317b6107b70a72
|