January 7, 2021 ← Last time: Day1 Django development environment
This article is not a single article. I wrote it as a diary, so I think it will be useful for those who are new to it. If you want to learn Django, we recommend reading it from [Day 1] Django Development Environment.
This time we will create a project with the name "mysite".
$ source venv/bin/activate #The one to make venv
(venv)$ django-admin startproject myproject
The contents of the generated project.
.
|--manage.py
|--mysite
|--__inin__.py
|--settings.py
|--urls.py
|--wsgl.py
It's English as it is now, so let's change it to Japanese. Edit the settings.py file in the mysite directory.
$ emacs settings.py
From
- LANG='en_us' #Where it is
+ LANG='ja' #'ja'Let's
From settings.py as well as language settings
- TIME_ZONE = 'UTC'
+ TIME_ZONE = 'Asia/Tokyo'
Edit to.
The mysite directory is now created. Let's check the created project with a web browser.
(venv)$ cd mysite
(venv)$ python manage.py runserver 8080
Please visit localhost: 8080 and check. If you see a picture of a rocket, you are successful.
See you again
← Last time: Day1 Django development environment → Next time: Preparing to connect to the Day3 database
Recommended Posts