4. Python 没有真正的 Private
Strictly speaking, private methods are accessible outside their class, just not easily accessible. Nothing in Python is truly private; internally, the names of private methods and attributes are mangled and unmangled on the fly to make them seem inaccessible by their given names. You can access the __parse method of the MP3FileInfo class by the name _MP3FileInfo__parse. Acknowledge that this is interesting, then promise to never, ever do it in real code. Private methods are private for a reason, but like many other things in > Python, their privateness is ultimately a matter of convention, not force.
严格来说，Python 没有真正的 private 方法，任何
>>> class MyClass:
django-admin startproject mysite
python manage.py runserver
python manage.py startapp polls
在 django 的项目里，project 可以有多个 apps，每个 apps 实际上就是一个模块，独立完成某个功能。同一个 app 也可以同时被多个 project 使用
python manage.py makemigrations polls
python manage.py sqlmigrate polls 0001
The sqlmigrate command doesn’t actually run the migration on your database - it just prints it to the screen so that you can see what SQL Django thinks is required. It’s useful for checking what Django is going to do or if you have database administrators who require SQL scripts for changes.
python manage.py check
this checks for any problems in your project without making migrations or touching the database.
python manage.py migrate
python manage.py shell
We’re using this instead of simply typing “python”, because manage.py sets the DJANGO_SETTINGS_MODULE environment variable, which gives Django the Python import path to your mysite/settings.py file.