A relatively new framework, using as a basis the Python language. In our work applies the concept of MVC. It allows you to increase the speed of writing code and its effectiveness. Also, to develop applications without mixing their parts. Code of interaction with the database is a separate area . It’s called “model”. The main advantage was the high rate of creation of various projects. Django clear and simple, thanks to the division of the project into three parts. Namely, the appearance, the description of the database and logic. Code written in the programming language Python. This code is easy to understand.
This framework is object – oriented. As a module of the website he uses a special application. Such applications are embedded programmer for specific needs. The simplest one consists of files __init__.py. This is the mandatory minimum for the framework considered directory. Another file views.py contains a set of special functions. Their Django calls in case of the application process to the application.
Loaded this framework from the official website www . djangoproject . com. When the download occurred, the platform can be installed using python setup.py install. Then in the directory site – packages accommodate additional libraries of this platform. Also, the script will appear django-ad-min.py in the scripts directory. After installing the framework creates the project and application. The projects comprise one or more applications. They are the center of the configuration and the application. The applications are small fragments of executable code. They can be used repeatedly in a variety of projects. Largely, this project directory structure. It has an inside cross-application settings.
Applications are created using python manage.py startapp newapp. In the application directory contains the files views.py. and models.ru. The platform follows the agreements MVT. Therefore, the existing file share application components. In views.ru has the implementation of the application logic. models.py stores the database schema and represents a component мodel. Before starting the project records changes to the database python manage.py syncdb.
Error checking is done using python manage.py validate. And finally, the launch of the project is the command python manage.py runserver.