Fixes #57: Add --no-db flag to make migrations optional#80
Open
Samarthegde wants to merge 1 commit into
Open
Conversation
- Updated the `run` method in the Django class to accept a `no_db` flag. - Modified the `run` command in the CLI to include the `--no-db` option. - Added a test case to verify the functionality of running the server without a database.
Contributor
|
See also: #88 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request resolves issue #57 by introducing a
--no-dbflag to theruncommand.For prototypes and projects that don't require a database, the automatic creation of a
db.sqlite3file and the interactivecreatesuperuserprompt can be cumbersome. This change allows developers to quickly run ananodjangoapp without any database setup or migration file creations, leading to a faster and cleaner development experience.When the
--no-dbflag (or its--nodbalias) is used, the application is configured to use an in-memory SQLite database. This prevents the creation of a database file and skips the migration and superuser creation steps.Changes Included
--no-db/--nodbflags: Theruncommand innanodjango/commands.pynow accepts these flags.Django.run()method innanodjango/app.pywas updated to dynamically configure an in-memory SQLite database when the flag is present.makemigrations,migrate, andcreatesuperusersteps accordingly.tests/test_run_runserver.pyto verify that the--no-dbflag prevents the creation of a database file and that the server runs correctly.