-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
How can we specify the name of the test database? #102
Comments
I'm also currently dealing with this issue. Any solutions? |
Currently, the database string allows for specifying the current fields.
All of these are set through the basic usage of the database string (for example: One proposal could be to use querystring arguments for additional database options. For top level database options not already included in the database string (time_zone, conn_max_age, autocommit, atomic_requests). They could look something like:
For database options or test which are a dictionary within the databases settings we could use a key prefix to represent the dictionary it is part of. This could be something like An example could be:
This proposal should also be able to help support other DB options such as SSL which i set under the OPTIONS. An example of such usage could be:
Let me know your thoughts. |
@mattseymour my gut reaction is that this looks pretty inelegant; I don't love cramming stuff into the URL like this, and I find turning the flat URL into a dictionary... just too much. I think there's a certain point where, if you're doing complex stuff, you should just dive into the settings file. My feeling is: the point of this library is to take a DATABASE_URL that's been handed to you by a provider (Heroku, Azure, etc) and use it with a minimum of fuss. That URL isn't going to have Django-specific stuff, so why support it? I like the direction that #116 is taking, moving some of this stuff into the DATABASES = dj_database_url.config()
DATABASE["default"]["TEST"]["name"] = "whatever" But still doesn't require being all this URL stuff. Does that approach seem ok to you? |
Makes sense, I guess it depends on the use case of what people are willing to put into the database urls. In either case, I think it would be good to put in the read me the limitations and the thought process behind the scope of the library. Almost like what you put in your comment:
|
Django supports a custom name for the test database, how can we specify this somehow?
See https://docs.djangoproject.com/en/1.8/ref/settings/#test
The text was updated successfully, but these errors were encountered: