Category : django

Hi i want to connect django – mysql in each container 🙂 i tried a lot of way but failed.. here is my mysql docker-compose.yaml version: "3" services: db: platform: linux/x86_64 image: mysql:5.7 container_name: good-mysql ports: – "3307:3306" environment: – MYSQL_ROOT_PASSWORD=test – MYSQL_DATABASE=testdb command: – –character-set-server=utf8mb4 – –collation-server=utf8mb4_unicode_ci volumes: – /Users/Shared/data/mysql-test:/var/lib/mysql network_mode: bridge i used ..

Read more

When I build the container and I check the files that should have been ignored, most of them haven’t been ignored. This is my folder structure. Root/ data/ project/ __pycache__/ media/ static/ app/ __pycache__/ migrations/ templates/ .dockerignore .gitignore .env docker-compose.yml Dockerfile requirements.txt manage.py Let’s say i want to ignore the __pycache__ & data(data will be ..

Read more

I have a small project in django rest framework and I want to dockerize it. In my requirements.txt file there is a package called ruamel.yaml.clib==0.2.6. While downloading all other requirements is successfull, there is a problem when it tries to download this package. #11 208.5 Collecting ruamel.yaml.clib==0.2.6 #11 208.7 Downloading ruamel.yaml.clib-0.2.6.tar.gz (180 kB) #11 217.8 ..

Read more

I have Django application that works just fine when I build my docker image using python:3.10.0rc2-buster or python:3.10.0rc2-slim-buster without any problem. In order to decrease the image size, I switched to python:3.10-rc-alpine, however, I am facing dozens of missing dependencies. I found this post very helpful Docker Alpine Linux python (missing) It allowed me to ..

Read more

My docker file is as below : FROM python:3 ENV PYTHONUNBUFFERED 1 RUN mkdir /app COPY requirements.txt /app/ WORKDIR /app RUN pip3 install -r requirements.txt COPY . /app EXPOSE 8082 CMD ["python", "manage.py", "runserver", "0.0.0.0:8082"] And here is my db definitions in settings.py : DATABASES = { ‘default’: { ‘ENGINE’: ‘django.db.backends.mysql’, ‘NAME’: ‘knowledge_base_py’, ‘USER’: ‘root’, ..

Read more