MyTetra Share
Делитесь знаниями!
3. Создание приложения
Время создания: 07.09.2017 20:19
Раздел: Python - Django - __Порядок работы с проектом
Запись: xintrea/mytetra_db_mcold/master/base/15048047613sge0so77y/text.html на

A project is a sum of many applications. Every application has an objective and can be reused into another project, like the contact form on a website can be an application, and can be reused for others. See it as a module of your project.

Create an Application

We assume you are in your project folder. In our main “myproject” folder, the same folder than −

$ python startapp myapp

You just created myapp application and like project, Django create a “myapp” folder with the application structure −

  • − Just to make sure python handles this folder as a package.
  • − This file helps you make the app modifiable in the admin interface.
  • − This is where all the application models are stored.
  • − This is where your unit tests are.
  • − This is where your application views are.

Get the Project to Know About Your Application

At this stage we have our "myapp" application, now we need to register it with our Django project "myproject". To do so, update INSTALLED_APPS tuple in the file of your project (add your app name) −

MyTetra Share v.0.59
Яндекс индекс цитирования