django + SQLite to build lightweight personal blog - one

First, the environment

django 2.1 (2.2.6 version there are some unsolved problems), python3.7, SQLite3

Second, the process

1, python and django installed

2, pycharm create django project / project

Pit: pycharm create django project If you have problems, try to use the command to create django-admin startproject test_project (the name of the project), there is likely to be successful, unsuccessful to find the cause.

3, configuration settings.py

If necessary details to add.

4, configuration url.py --- view.py --- index.html

5, create tables and data structures sqlite

1) Modify models.py file that defines the attributes table and the fields (typically in a field sq statement l django treated as a variable)

2) python manage.py makemigrations

3)python manage.py migrate

6, add data

models. table .objects.create (field name = "...", ......)

7, start the service

8, using a browser to access the web



Guess you like

Origin www.cnblogs.com/xuexizongjie/p/11696171.html