I used to refer to a certain book before, but I was able to do something else on the way, so I left a lot of time. I don't remember what I did at that time, so I decided to start over.
http://www.djangoproject.jp/ This time, I will proceed according to the tutorial on this page (because I am a little worried that the book I used to refer to will cause an error if I do it as described).
It's already in, but for the time being https://www.djangoproject.com/download/
http://www.djangoproject.jp/doc/ja/1.0/intro/tutorial01.html#intro-tutorial01
django-admin.py startproject [mysite]
[mysite](\ __ init__.py manage.py settings.py urls.py and directory containing wsgi.py) is created
python manage.py runserver
This is OK. Connect to the displayed URL (http://127.0.0.1:8000/) to open the test page.
Edit settings.py (this time with SQLite which seems to be the easiest)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
#mainly'postgresql_psycopg2' 'mysql' 'sqlite3'Any of
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#DB name (full path to DB file only for sqlite)
# 'DATABASE_USER':"DB user name", #Not needed in SQLite
# 'DATABASE_PASSWORD':"DB password", #Same as above
# 'DATABASE_HOST':"Host with DB (empty is OK if the DB server is on the same machine)" #Same as above
}
}
After that, create a database with the following command
python manage.py syncdb
A database is created for each app in INSTALLED_APPS in settings.py
For the time being, this is all for today
Recommended Posts