How to connect Django to MySQL in a Docker Container

  Рет қаралды 16,013

Random code

Random code

Күн бұрын

Пікірлер: 12
@llamalogiclab
@llamalogiclab 21 күн бұрын
Thanks bro, this video helps me a lot.
@true_indian987
@true_indian987 5 ай бұрын
Nice and simple bro ..thank you!
@matitronix1000
@matitronix1000 7 ай бұрын
qlo, me hiciste toda la pega, te amo
@pythonweb-yx2vu
@pythonweb-yx2vu 7 ай бұрын
very good work!
@alanwang3651
@alanwang3651 2 жыл бұрын
thank you, this was very helpful
@Randomcode_0
@Randomcode_0 2 жыл бұрын
Glad it was helpful!
@navalkishorsavita9722
@navalkishorsavita9722 Жыл бұрын
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
@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
@swethareddy3804 Жыл бұрын
I am facing issue like all admin related tables able to load MySQL but inside application tables unable to load
@Randomcode_0
@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.
@MilahnMartin
@MilahnMartin 4 ай бұрын
Thanks for not showing the Dockerfile
@Randomcode_0
@Randomcode_0 4 ай бұрын
The Dockerfile can be seen at 1:01, and the docker-compose file can be seen at 1:36.
How to Deploy a Django App and Postgres Database to Render
20:14
Pretty Printed
Рет қаралды 40 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 79 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 906 М.
Building a Django Docker Container
34:11
Very Academy
Рет қаралды 28 М.
How to run MySQL in a Docker container with dockerfile
9:39
Random code
Рет қаралды 50 М.
How to Dockerize Django in 5 minutes
36:00
Matt Freire
Рет қаралды 31 М.
How to Connect Django Project to Dockerized MySQL Database
20:30
Dynamic Technologies
Рет қаралды 131
Getting started with Docker Compose
6:22
Amichai Mantinband
Рет қаралды 8 М.
Prepare a Django app for Deployment using Docker
39:10
London App Developer
Рет қаралды 91 М.
Gizli Apple Watch Kamerası😱
0:14
Safak Novruz
Рет қаралды 1,2 МЛН