Don't see Django in Docker container

前端 未结 3 1349
攒了一身酷
攒了一身酷 2021-01-27 17:22

I want to run Django in a simple Docker container.

First I built my container with Docker-file. There wasn\'t anything special in it (only FROM, RUN and COPY commands)

3条回答
  •  甜味超标
    2021-01-27 17:54

    I agree with Niklaus9 comments. If I could suggest an enhancement try

    python manage.py runserver [::]:8000 
    

    The difference is that [::] supports ipv6 addresses.

    I also noticed some packages for mongodb. If you want to test and dev locally you can create docker containers and use docker compose to test your app on your machine before deploying to dev/stage/prod environment.

    You can find out more about how to set up a Django app linked to a database backend in docker on this tutorial http://programmathics.com/programming/docker/docker-compose-for-django/ (Disclaimer: I am the creator of that website)

提交回复
热议问题