Self-motivated forward ,19 I began to study in django, But as the saying goes , Entry to give up . This time the journey is restarted , Never give up , come on.
The following are all personal understandings , If there is any mistake, please correct it , thank you
First , We have to understand , Why do we have to use virtual environments . In fact, it is for project isolation , First, the packages used by each project are different , So these items need to be isolated , You can use a pure environment ; Second and most important , Each project may use different versions of packages ,python There is a crucial feature , Not downward compatible ( Of course, some packages are compatible ), In especial python Its own version , So separate , Not prone to interference .
however , I have to say, but . Generally, create a virtual environment , The library we use is virtualenv, but pycharm The library has been integrated , When we create a project , You can directly visualize the configuration to create a virtual environment , There is no need to create a virtual environment through instructions
This concept must be understood , When we write , You have to find out what you are writing , Otherwise, it is very difficult to write a page completely independently
The whole logic chain is as follows :
User input url-->urls Controller is responsible for distribution -->views Call the corresponding interface -->models get data -->views Get models Data in -->templates Get the data and render it to the page --> Users appreciate
This link must be able to say , This is the whole thing django Thought