Use Docker to help Django Development

if you have pyenv Dockerfile, you can use docker built -t django:latest . to build a docker image.

command: docker run –rm -p 8000:8000 -p 3000:3000 -v c:\Users\Fluber\Project\Docker\django\book_django_beginners\:/home/fluber/code -it django:latest

enter a docker console environment to develop.

virtualenv .venv to build a python project environment.

pip install django==4.0.10

ajango-admin startproject new_project

python manage.py startapp new_app

modify new_project/settings.py and new_project/urls.py

modify new_app/models.py new_app/views.py new_app/urls.py

use python manage.py makemigrations

use python manage.py migrate

using python manage runserver 0.0.0.0:8000

I suggest to study the following books to help you know how to use django.

分類: Docker,標籤: , 。這篇內容的永久連結

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *