> For the complete documentation index, see [llms.txt](https://dahye-jeong.gitbook.io/django/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dahye-jeong.gitbook.io/django/basic/2019-03-06-app.md).

# Django App

## App 이란?

![](/files/-M26l8jSWFFO7Pjfw-Ar)

Django App은 Django에서 사용하는 **파이썬 패키지**이다. Django App은 자신의 모델, 뷰, 템플릿, URL 등을 독자적으로 가지고 있다. **App은 특정한 기능을 수행하는 웹 어플리케이션**을 말한다. **프로젝트는 이러한 app들과 각 설정을 모아둔 것**이다. 하나의 Django 프로젝트는 다수의 app을 포함할 수 있고, app은 다수의 project에 포함될 수 있다.

## App 생성하기

`manage.py` 파일이 있는 디렉토리에서 명령을 실행한다.

```bash
$ python ./manage.py startapp <app_name>
$ ./manage.py startapp <app_name>
```

### App 기본 디렉토리, 파일 구조

```
├── db.sqlite3
├── manage.py
├── mysite
│   ├── __init__.py
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── app
    ├── __init__.py
    ├── admin.py
    ├── apps.py
    ├── migrations
    │   └── __init__.py
    ├── models.py
    ├── tests.py
    └── views.py
```

애플리케이션을 생성한 후에 `mysite/settings.py` 파일을 수정해 줘야한다.

### settings.py

```python
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'app',
]
```

생성한 app을 `INSTALLED_APPS`에 추가해준다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dahye-jeong.gitbook.io/django/basic/2019-03-06-app.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
