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

Database engine variables in a more general way #747

Closed
folt opened this issue Apr 19, 2019 · 8 comments
Closed

Database engine variables in a more general way #747

folt opened this issue Apr 19, 2019 · 8 comments

Comments

@folt
Copy link
Contributor

folt commented Apr 19, 2019

Hi.
I faced a very hard work when changing the database engine.
Maybe we should call these variables in a more general way?

example:
DB_NAME=mydb
DB_USER=myuser
DB_PASSWORD=mypass

@sobolevn
Copy link
Member

Hi, @folt ! Thanks for bringing this up. The reason behind this naming is that postgres requires these env vars: see https://hub.docker.com/_/postgres

So, changing it is not possible.

But! If anything is not clear, so the docs should be improved. I guess, in this particular case we can add a comment section to .env.template somewhere near the POSTGRES_DB variable with the link to the postgres-docker page.

Is this solution fine with you? I would appreciate a PR from you.

Also, changing / adding databases is quite popular. We can also cover this in a separate PR.
I will write a tutorial about it. Thanks for raising this issue!

@sobolevn
Copy link
Member

sobolevn commented Jun 8, 2019

Please, comment if my solution is not clear enough.

@folt
Copy link
Contributor Author

folt commented Jun 9, 2019

I believe that this will not be enough.
I suggest adding a database selection and cache system to the project generation template.

Please, comment if my solution is not clear enough.

@sobolevn sobolevn reopened this Jun 9, 2019
@sobolevn
Copy link
Member

sobolevn commented Jun 9, 2019

What kind of database and cache section are you talking about?
Like here:
Снимок экрана 2019-06-09 в 23 15 53

And add new menu items:

  • Database
  • Cache

?

I am not sure what to write there, since: database setup is pretty simple and we don't use cache by default. What's your vision on this?

@folt
Copy link
Contributor Author

folt commented Jun 10, 2019

Database settings should be attributed to the django environment settings.
In the django section is to add the item Database and Cache.

I am not sure what to write there, since: database setup is pretty simple and we don't use cache by default. What's your vision on this?

I suggest putting the database and cache settings in the project creation script using a template. Selection of the database driver to provide the developer. A similar example can be seen here.

@sobolevn
Copy link
Member

Database settings should be attributed to the django environment settings.
In the django section is to add the item Database and Cache.

Can you please explain this part deeply? I don't get it at the moment.

I suggest putting the database and cache settings in the project creation script using a template. Selection of the database driver to provide the developer. A similar example can be seen here.

Nope, this is out of scope of this project. Because we try to provide the best experience with the tooling and structure. Not the plugins and infrastructure.

Moreover, it will overly complicate our test setup and codebase with things we don't use. And it will become outdated pretty soon. We stick to postgres + redis almost for every project.

@folt
Copy link
Contributor Author

folt commented Jun 10, 2019

Can you please explain this part deeply? I don't get it at the moment.

I am not sure what to write there, since: database setup is pretty simple and we don't use cache by default. What's your vision on this?

I support this decision

Nope, this is out of scope of this project. Because we try to provide the best experience with the tooling and structure. Not the plugins and infrastructure.

Moreover, it will overly complicate our test setup and codebase with things we don't use. And it will become outdated pretty soon. We stick to postgres + redis almost for every project.

Can you give more details?
I easily changed the database driver in the template. For this, I needed to change the database settings, the settings of the docker and some dependencies in poetry. The whole CI works fine.

@sobolevn
Copy link
Member

Thanks for the suggestion! 👍

But, I am closing it as out-of-scope.
The point of this template is to provide minimal valuable example.
And we do not want to cover other databases and caches.
That is something user should do.

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

No branches or pull requests

2 participants