Hii, I am new to docker i am just trying to connect my local database with the django docker file i don't have docker compose and i just want to do it without compose file for experiment purpose. can you please just guide me how i can i do this and even this is possible or not. please guide me i will thankfull for reply. Thanks.
@Randomcode_0 Жыл бұрын
Assuming you are running your database locally, it would most likely be exposing an open endpoint to a specific port on localhost. In your Django project, you need to specify the settings for the given database to create a connection. If you can run the Django setup locally, it would work the same in a container. In this video, I just show that a connection was made and that we can migrate the expected database setup from Django to our database. In a real use case where you want to connect to the database while running your Django app, it takes a bit more setup. We would create some models which would match some tables. These models in Python can then be used to get and save data.
@swethareddy3804 Жыл бұрын
I am facing issue like all admin related tables able to load MySQL but inside application tables unable to load
@Randomcode_0 Жыл бұрын
This issue could be due to various reasons: 1. Incorrect database settings in Django's settings.py 2. Issues with database connection 3. Permission issues with the MySQL user specified in settings.py 4. Incorrect mapping of the tables in Django's models.py Try checking your Django settings.py to ensure the database connection is setup correctly. Also, check the user specified has the necessary permissions to access the database. Finally, check the models.py file to make sure the tables are correctly mapped to the database.
@MilahnMartin4 ай бұрын
Thanks for not showing the Dockerfile
@Randomcode_04 ай бұрын
The Dockerfile can be seen at 1:01, and the docker-compose file can be seen at 1:36.