Used to be Django1.2.7, the latest version is already 1.8, learned that the news, feel really should upgrade, the next 1.7.7 version has been upgraded, the first upgrade to the 1,7,7 version, the previous project files have not been changed, resulting in a non-normal use. So found a Chinese version of the Django1.7 document learning, before the release of the two version before there are many differences, a simple summary of the next, just self-modification can be used normally, as for 1.7.7:1.2.7 even compared to all previous versions of 1.7.7 improvements and differences, Let's still refer to the official documentation, haha.
The project directory differs:
1, Django1.7.7 will create a project directory automatically after creating a Python package with the same name as the project directory, the 1.2.7 in the project directory under the "__init__.py", "admin.py", "urls.py" three files contained in the same name of the file, and add a "wsgi.py" file.
2. After the app is created in the project directory, 1.7.7 will have more than 1.2.7 "admin.py" and "migrations" two files in the app directory.
For the two versions of the Django project directory layout, where the black file is automatically generated when the parent directory is created, the red file needs to be created by itself, and the blue Mark 1.7.7:1.2.7 more files.
Settings The different configuration files:
1. Database configuration:
Take MySQL for example:
The Database engine field (engine) shouldbe "MySQL " in 1.2.7
In 1.7.7, the Database engine field is "django.db.backends.mysql"
and 1.7.7 database configuration by default only the "ENGINE" and "NAME" field, "USER", "PASSWORD", "HOST", "PORT" fields need to add themselves.
2. Template path Configuration
The "Template_dirs" setting is present in the settings.py file in 1.2.7, and the default is an empty tuple
There is no "template_dirs" setting in the settings.py file in 1.7.7, you need to add it yourself, and you need to set it to
' Templates ')]
Comparison of Django1.2.7 and 1.7.7 versions