Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django config option #12

Open
symroe opened this issue Oct 11, 2022 · 2 comments
Open

Django config option #12

symroe opened this issue Oct 11, 2022 · 2 comments

Comments

@symroe
Copy link

symroe commented Oct 11, 2022

Hello, thanks for the great library!

I've been trying it out with PRs to various Django projects. It's really handy for being able to review a PR that contains a Django migration, then to flip back to a clean database for the next review.

As my Django installs already contain the database connection details, I've been thinking about an option to bootstrap Django and read from the DB settings, to save me exporting a URL or creating a TOML file.

I'd be happy to explore a PR that does this, but I wanted to check in and see if that's something you'd consider?

Thanks again

@mixxorz
Copy link
Owner

mixxorz commented Oct 11, 2022

Hey!

Could you run me through an example of how this would be used? Like, what the commands would be, how would config look like, etc.

@symroe
Copy link
Author

symroe commented Oct 12, 2022

Sure. I don't know if it would be an automatic feature or not, but I see the "django config backend" as being an extra option to the DATABASE_URL or TOML config.

You can get the Django database config by:

from django.conf import settings
settings.DATABASES

And then we could slot this option in to next_not_none alongside the env var and toml URLs.

Or, we could add an option to the TOML file with the python path to the Django settings module. I'd need to have a bit of a play to see what the best option might be.

I don't think there would be any additional commands or features. Of course this could be an optional package, installed via dlsr[django] if you wanted to keep Django support out of the main project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants