# 54-django-extensions-mais-comandos

## Dica 54 - django-extensions - mais comandos

[![](/files/-MfuAOwUjEsk4qZiRsOx)](https://youtu.be/pguupq-s70M)

Github: <https://github.com/rg3915/dicas-de-django>

Doc: <https://django-extensions.readthedocs.io/en/latest/>

## [Command Extensions](https://django-extensions.readthedocs.io/en/latest/command_extensions.html)

Veremos mais comandos do django-extensions.

```
pip install -U django-extensions
```

```python
# settings.py
INSTALLED_APPS = (
    ...
    'django_extensions',
)
```

### shell\_plus

Roda o shell do Django importando todos os pacotes essenciais.

```
python manage.py shell_plus
```

### admin\_generator

Gera uma classe no Admin para a app selecionada.

```
python manage.py admin_generator product
python manage.py admin_generator product >> myproject/product/admin.py
```

### clean\_pyc

Remove todos os arquivos `*.pyc`

```
python manage.py clean_pyc
```

### create\_command

Cria um novo comando do Django.

```
python manage.py create_command core -n novocomando
```

### create\_template\_tags

Cria um novo `template_tags`.

```
python manage.py create_template_tags core
python manage.py create_template_tags core -n lorem_tags
```

### show\_template\_tags

Lista todos os `template_tags`.

```
python manage.py show_template_tags
```

### generate\_password

Gera uma senha randômica.

```
python manage.py generate_password
python manage.py generate_password --length 32
```

### generate\_secret\_key

Gera uma chave secreta.

```
python manage.py generate_secret_key
```

### graph\_models

Link na descrição do video

<https://youtu.be/99dOVsDBUxg>

### list\_model\_info

Lista as informações de um modelo.

```
python manage.py list_model_info --model product.Product
python manage.py list_model_info --model product.Product --field-class
```

### list\_signals

Lista os sinais do projeto.

```
python manage.py list_signals
```

### print\_settings

Retorna as informações do `settings`.

```
python manage.py print_settings
```

### show\_urls

Lista todas as urls do projeto.

```
python manage.py show_urls
```


---

# Agent Instructions: 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:

```
GET https://www.dicas-de-django.com.br/054-django-extensions-mais-comandos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
