It refers to the Create (register), Read (reference), Update (update), and Delete (delete) functions. We will implement these functions in Dango.
I would like to create a blog site. I'm thinking about blueprints, but the main functions are listed below.
*** Blog function ***
--Post Article (Create) --See article (Read) --Article Update (Update) --Delete article
*** User management function ***
--User login --User logout
In this development, we will use a virtual environment. In a virtual environment, if you refer to PipFile, the version of each package is organized, so I think that it is easy to share the development environment in multi-person development.
Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
flake8 = "*"
autopep8 = "*"
[packages]
django = "==3.1.1"
[requires]
python_version = "3.8"
By the way, you can build the same environment as me with the following command.
pip install pipenv
pipenv shell
pipenv install django==3.1.1
pipenv install --dev flake8 autopep8
The project name can be anything, but the folder created by this command is config because it is the folder where the configuration files of the entire project are stored.
django-admin startproject config .
In Django, we will create apps (functions) in the project. First, we will create a blog function, so let's call it blog.
python manage.py startapp blog
After creating the app, you have to set the project as "App created!". Add the following to /crud/config/settings.py. In addition, let's set the language and time zone.
/crud/config/settings.py
INSTALLED_APPS = [
'blog.apps.BlogConfig',
***
]
LANGUAGE_CODE = 'ja'
TIME_ZONE = 'Asia/Tokyo'
That's all for today. Do you have the following directory files?
Thank you very much.