# DjangoTemplateParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/backend/django-template.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/backend/django-template.parser.ts#L71)

Django Template Parser

Extracts entities and relationships from Django template files.

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(config: { rootDir: string })` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `any` |
| `version` | `any` |
| `supportedPatterns` | `any` |

## Where it refuses work

- `DjangoTemplateParser` stops the work with an early return when `fs.existsSync(managePy)`.
- `DjangoTemplateParser` stops the work with an early return when `!this.projectHasDjango`.
- `DjangoTemplateParser` stops the work with an early return when `!filePath.endsWith('.html')`.
- `DjangoTemplateParser` stops the work with an early return when `templatesIndex !== -1 && templatesIndex < parts.length - 1`.
- `DjangoTemplateParser` stops the work with an early return when `match`.

## When something fails

- `DjangoTemplateParser` handles failure in 1 place: it turns it into a return value in all 1.
