This is a continuation of Last time.
Looking at the project I made last time, the directory structure looks like this.
.gitignore did the following
db.sqlite3
manage.py
*.pyc
Initial commit.
$ git status
.gitignore
project/
$ git add .
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .gitignore
new file: project/__init__.py
new file: project/settings.py
new file: project/urls.py
new file: project/wsgi.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
project/__init__.pyc
project/settings.pyc
project/urls.pyc
project/wsgi.pyc
$ git commit -m "initial commit"
I don't know how much to commit, such as __init__.py
, but I committed everything for the time being. If it turns out to be inappropriate, fix it. (Honestly settings.pyc may not have been committed)
The last command executed was
$ python manage.py migrate
$ python manage.py runserver
was. It seems that a pyc file is created for each py file depending on the timing of migrate or the timing of runsever.
In addition, a sqlite file is created during migrate. Looking at setting.py
,
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
There is a place called, and it seems that database migration will be done based on this. I will skip it for now.
The time zone setting is the default
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
Since it is, I changed it as follows.
LANGUAGE_CODE = 'ja'
TIME_ZONE = 'Asia/Tokyo'
If you run server in this state and look at localhost: 8000, it will change to a Japanese page saying "It worked!".
You can access the administration page by accessing localhost: 8000 / admin
with the server running, but I will omit it for now because I do not use it in particular.
Recommended Posts