Skip to main content

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 makemigrations and migrate from 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=True before 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_devsync-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_devsync-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for django_devsync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6daf72fb2e115576ee80ca77a0b4c58eba93723fbfe95e6ac659f902ab8b017
MD5 7df04e53d9bc166796ce99f689a9e3c5
BLAKE2b-256 eae83ebdc3306d9d29e0bc2b7e5adc1ba17fa72f02be50ff0cb419884941f707

See more details on using hashes here.

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

Hashes for django_devsync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42aa5b276135528b4bc98f34ccf7a1ec5c9593ee0459c97511799d4245b64369
MD5 a98e201f9e90f83d0c7dc6eb9e04ebff
BLAKE2b-256 57ec7aaeb9ed91611016bdebe257100c00aa3cbb107b723100317b6107b70a72

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page