O framework de verificação do sistema é um conjunto de verificações estáticas para validação de projetos Django. Ele detecta problemas comuns e fornece dicas de como arrumá-los. O framework é extensível e você pode facilmente adicionar suas próprias validações.
Para detalhes de como adicionar suas próprias verificações e integrar isso com os sistema de verificação do Django, veja o Tópico sistema de verificação do giua..
CheckMessage
¶CheckMessage
(level, msg, hint=None, obj=None, id=None)[código fonte]¶Os alertas e erros emitidos pelo sistema de verificação devem ser uma instância de CheckMessage
. Uma instância encapsula um único erro ou aviso. Ele também fornece contexto e dicas aplicáveia a mensagem, e um identificador único que é usado para propósitos de filtragem.
Os argumentos do Construtor são:
level
DEBUG
, INFO
, WARNING
, ERROR
, CRITICAL
. Se o nível é maior ou igual a ERROR`, então o Django irá impedir que comandos de gerenciamento sejam exeutados. Mensagens com nível menor que ``ERROR
(ex. alertas) são reportados no console, mas pode ser silenciados.msg
hint
None
pode ser usado.obj
__str__()
method.
The method is used while reporting all messages and its result precedes the
message.id
applabel.X001
, onde X
é uma das letras de CEWID
, indicando a gravidade da mensagem (C
para crítico, E
para erro e assim por diante). O número pode ser alocado pela aplicação, mas deve ser único dentro daquela aplicação.Existem subclasses para tornar a criação de mensagens de níveis comuns mais fácil. Quando usá-los você pode omitir o argumento level
porque ele está implícito no nome da classe.
Debug
(msg, hint=None, obj=None, id=None)[código fonte]¶Info
(msg, hint=None, obj=None, id=None)[código fonte]¶Warning
(msg, hint=None obj=None, id=None)[código fonte]¶Error
(msg, hint=None, obj=None, id=None)[código fonte]¶Critical
(msg, hint=None, obj=None, id=None)[código fonte]¶As verificações do sistema do Django estão organizadas usando as seguintes tags:
admin
: verifica qualquer declarações do “admin site”.async_support
: Checks asynchronous-related configuration.caches
: Verifica configuração relacionada a cache.compatibility
: Indica potenciais problemas com atualizações da versão.database
: Checks database-related configuration issues. Database checks
are not run by default because they do more than static code analysis as
regular checks do. They are only run by the migrate
command or if
you specify configured database aliases using the --database
option when
calling the check
command.files
: Checks files related configuration.models
: Checks of model, field, and manager definitions.security
: verifica configurações relacionadas com segurança.signals
: verifica sobre declarações de “signals” e com o registro dos manipuladores.sites
: Checks django.contrib.sites
configuration.staticfiles
: Checks django.contrib.staticfiles
configuration.templates
: verifica configuração relacionadas a templates.translation
: Checks translation related configuration.urls
: verifica a configuração da URL.Algumas verificações talvez sejam registradas com múltiplas tags.
The sites
tag was added.
The files
tag was added.
The following checks verify your setup for Suporte assíncrono:
DJANGO_ALLOW_ASYNC_UNSAFE
environment variable in deployment. This disables async safety
protection.Testes de compatibilidade notificam sobre problemas que podem ocorrer após atualizar o Django.
<pattern>
has a route
that contains
(?P<
, begins with a ^
, or ends with a $
. This was likely an
oversight when migrating from url()
to path()
.CSRF_TRUSTED_ORIGINS
setting must start with a scheme (usually
http://
or https://
) but found <hostname>
.As verificações seguintes averiguam se seu CACHES
está configurado corretamente:
'default'
para a definição de CACHES
.<cache>
configuration might expose your cache or
lead to corruption of your data because its
LOCATION
matches/is inside/contains
MEDIA_ROOT
/STATIC_ROOT
/STATICFILES_DIRS
.<cache>
cache LOCATION
is relative. Use an absolute path instead.If you’re using MySQL or MariaDB, the following checks will be performed:
CharField
s to have a
max_length
> 255. This check was changed to mysql.W003
in Django
3.1 as the real maximum size depends on many factors.<alias>
. See also Setting sql_mode.CharField
s to have a
max_length
> 255.The following checks verify your setup for Managing files:
FILE_UPLOAD_TEMP_DIR
setting refers to the
nonexistent directory <path>
."__"
.pk
é uma palavra reservada que não pode ser usada como nome de campo.choices
deve ser um iterável (ex.:uma lista de tuplas).choices
must be an iterable containing (actual value,
human readable name)
tuples.db_index
deve ser None
, True
ou False
.null=True
.validators
must be callable.max_length
is too small to fit the longest value in
choices
(<count>
characters).<field>
default should be a callable instead of an
instance so that it’s not shared between all field instances.AutoField
s devem setar primary_key=True.BooleanField
s do not accept null values. This check
appeared before support for null values was added in Django 2.1.CharField
s deve definir um atributo max_length
.max_length
deve ser um inteiro positivo.max_length
is ignored when used with
<integer field type>
.DecimalField
s deve definir um atributo decimal_places
.decimal_places
deve ser um inteiro não negativo.DecimalField
s deve ter um atributo max_digits
.max_digits
must be a positive integer.max_digits
deve ser igual ou maior que decimal_places
.FilePathField
s deve ter allow_files
ou allow_folders
definidos como True.GenericIPAddressField
s cannot have blank=True
if
null=False
, as blank values are stored as nulls.auto_now
, auto_now_add
, e default
são mutualmente exclusivas. Somente uma destas opções deve estar presente.<database>
does not support a database index on
<field data type>
columns.BinaryField
’s default
cannot be a string. Use bytes
content instead.<database>
does not support JSONField
s.<database>
does not support a database collation on
<field_type>
s.IPAddressField
foi removido exceto para suportar migrações históricas.IPAddressField
está obsoleto. O suporte para este (exceto para histórico de migrações) será removido no Django 1.9. Esta verificação apareceu em Django 1.7 and 1.8.CommaSeparatedIntegerField
has been deprecated. Support
for it (except in historical migrations) will be removed in Django 2.0. This
check appeared in Django 1.10 and 1.11.CommaSeparatedIntegerField
is removed except for support
in historical migrations.FloatRangeField
is deprecated and will be removed in
Django 3.1. This check appeared in Django 2.2 and 3.0.NullBooleanField
is deprecated. Support for it (except
in historical migrations) will be removed in Django 4.0. This check appeared
in Django 3.1 and 3.2.NullBooleanField
is removed except for support in
historical migrations.django.contrib.postgres.fields.JSONField
is deprecated.
Support for it (except in historical migrations) will be removed in Django
4.0. This check appeared in Django 3.1 and 3.2.django.contrib.postgres.fields.JSONField
is removed
except for support in historical migrations.unique
não é um argumento válido para FileField
. Esta verificação foi removida no Django 1.11.primary_key
não é um argumento válido para um FileField
.FileField
’s upload_to
argument must be a relative
path, not an absolute path.ImageField
porque o Pillow não está instalado.<swappable>
não está no formato app_label.app_name
.<SETTING>
referencia <model>
, o qual nao foi instalado, ou é abstrato.<app_label>.<model>
.id
somente pode ser usado como nome de um campo se o campo também definir primary_key=True
.<field name>
do modelo pai <model>
colide com o campo <field name>
do modelo pai <model>
.<field name>
clashes with the field
<field name>
from model <model>
.<field name>
tem o nome de coluna <column name>
que é usado por outro campo.index_together
deve ser uma lista de tuplas.index_together
devem ser uma lista de tuplas.unique_together
deve ser uma lista de tuplas.unique_together
devem ser uma lista de tuplas.constraints/indexes/index_together/unique_together
refers to the nonexistent field <field name>
.constraints/indexes/index_together/unique_together
refers to a ManyToManyField
<field name>
, but ManyToManyField
s
are not supported for that option.ordering
deve ser uma tupla ou listat (mesmo que você queira ordernar por um único campo).ordering
refers to the nonexistent field, related field,
or lookup <field name>
.constraints/indexes/index_together/unique_together
refers to field <field_name>
which is not local to model <model>
.<model>
cotém campos de modelo.<field>
. O comprimento máximo é <maximum length>
para o banco de dados <alias>
.<M2M field>
é muito longo. O comprimento máximo é <maximum length>
para o banco de dados <alias>
.<model>.check()
método da classe está neste momento sobrescrito.ordering
e order_with_respect_to
não podem ser usados juntos.<function>
contains a lazy reference to
<app label>.<model>
, but app <app label>
isn’t installed or
doesn’t provide model <model>
.<model>
cannot start or end with an
underscore as it collides with the query lookup syntax.<model>
cannot contain double underscores
as it collides with the query lookup syntax.<property name>
clashes with a related
field accessor.primary_key=True
.<database>
does not support check constraints.db_table
<db_table>
is used by multiple models:
<model list>
.<index>
is not unique for model <model>
.<index>
is not unique among models:
<model list>
.<constraint>
is not unique for model
<model>
.<constraint>
is not unique among
models: <model list>
.<index>
cannot start with an underscore
or a number.<index>
cannot be longer than
<max_length>
characters.db_table
<db_table>
is used by multiple models:
<model list>
.<database>
does not support unique constraints with
conditions.<database>
does not support indexes with conditions.<database>
does not support deferrable unique
constraints.<database>
does not support unique constraints with
non-key columns.<database>
does not support indexes with non-key
columns.constraints
refers to the joined field <field name>
.django.db.models.AutoField
.<database>
does not support indexes on expressions.<database>
does not support unique constraints on
expressions.The security checks do not make your site secure. They do not audit code, do intrusion detection, or do anything particularly complex. Rather, they help perform an automated, low-hanging-fruit checklist, that can help you to improve your site’s security.
Algumas dessas verificações talvez não sejam apropriadas para uma configuração de implantação particular. Por exemlo, se você faz redirecionamento do HTTP para HTTPS em um balanceador de carga, isso pode ser irritante de ser constantemente alertado sobre não ter habilitado o SECURE_SSL_REDIRECT
. Use o SILENCED_SYSTEM_CHECKS
para silenciar verificações desnecessárias.
As seguintes verificações são executadas se você usa a opção check --deploy
:
django.middleware.security.SecurityMiddleware
in your
MIDDLEWARE
so the SECURE_HSTS_SECONDS
,
SECURE_CONTENT_TYPE_NOSNIFF
, SECURE_REFERRER_POLICY
,
SECURE_CROSS_ORIGIN_OPENER_POLICY
, and
SECURE_SSL_REDIRECT
settings will have no effect.django.middleware.clickjacking.XFrameOptionsMiddleware
in your
MIDDLEWARE
, so your pages will not be served with an
'x-frame-options'
header. Unless there is a good reason for your
site to be served in a frame, you should consider enabling this
header to help prevent clickjacking attacks.django.middleware.csrf.CsrfViewMiddleware
is not in your
MIDDLEWARE
). Enabling the middleware is the safest
approach to ensure you don’t leave any holes.SECURE_HSTS_SECONDS
. Se todo o seu site é servido via SSL, talvez queira considerar definir o valor e habilitar HTTP Strict Transport Security. Tenha certeza de ler a documentação primeiro; habilitando HSTS sem cuidados você pode causar problema sérios e irreversíveis.SECURE_HSTS_INCLUDE_SUBDOMAINS
para True
. Sem isso, seu site está pontencialmente vulnerável a ataques através de uma conexão insegura para um subdomínio. Somente definica como True
se você está certo de que todos os subdomínios do seu domínio devem ser servidos exclusivamente via SSL.SECURE_CONTENT_TYPE_NOSNIFF
setting is not
set to True
, so your pages will not be served with an
'X-Content-Type-Options: nosniff'
header. You should consider enabling
this header to prevent the browser from identifying content types incorrectly.SECURE_BROWSER_XSS_FILTER
setting is not
set to True
, so your pages will not be served with an
'X-XSS-Protection: 1; mode=block'
header. You should consider enabling
this header to activate the browser’s XSS filtering and help prevent XSS
attacks. This check is removed in Django 3.0 as the X-XSS-Protection
header is no longer honored by modern browsers.SECURE_SSL_REDIRECT
não é True
. A menos que seu site deva estar disponível tanto para conexões SSL quanto para não SSL, você talvez queira definir este como True
ou configurar o balanceador de carga ou o servidor de proxy reverso para redirecionar todas as conexões para HTTPS.SECRET_KEY
has less than 50 characters,
less than 5 unique characters, or it’s prefixed with 'django-insecure-'
indicating that it was generated automatically by Django. Please generate a
long and random SECRET_KEY
, otherwise many of Django’s security-critical
features will be vulnerable to attack.django.contrib.sessions
no seu INSTALLED_APPS
mas não definiu SESSION_COOKIE_SECURE
como True
. Usando uma “cookie” de sessão “somente-segura” é mais difícil para um “sniffer” de tráfego de rede capturar sessões do usuário.django.contrib.sessions.middleware.SessionMiddleware
in your
MIDDLEWARE
, but you have not set SESSION_COOKIE_SECURE
to True
. Using a secure-only session cookie makes it more difficult for
network traffic sniffers to hijack user sessions.SESSION_COOKIE_SECURE
não é True
. Usando uma “cookie” de sessão como “somente-segura” é mais difícil para um “sniffer” de tráfego de rede capturar sessões do usuário.django.contrib.sessions
no seu INSTALLED_APPS
, mas não definiu SESSION_COOKIE_HTTPONLY
como True
. Usando uma “cookie” de sessão HttpOnly
faz com que seja mais difícil um ataque de script extra-site capturar sessões de usuários.django.contrib.sessions.middleware.SessionMiddleware
in your
MIDDLEWARE
, but you have not set SESSION_COOKIE_HTTPONLY
to True
. Using an HttpOnly
session cookie makes it more difficult for
cross-site scripting attacks to hijack user sessions.SESSION_COOKIE_HTTPONLY
não está definido como True
. Usando uma cookie de sessão como HttpOnly
torna mais difícil um ataque de script extra-site capturar sessões de usuários.CSRF_COOKIE_SECURE
não está como True
. Usando a “secure-only” para a “cookie” CSRF torna mais difícil para um “sniffer” de tráfego de rede roubar o token CSRF.CSRF_COOKIE_HTTPONLY
is not set to True
.
Using an HttpOnly
CSRF cookie makes it more difficult for cross-site
scripting attacks to steal the CSRF token. This check is removed in Django
1.11 as the CSRF_COOKIE_HTTPONLY
setting offers no practical
benefit.DEBUG
como True
em produção.django.middleware.clickjacking.XFrameOptionsMiddleware
in your
MIDDLEWARE
, but X_FRAME_OPTIONS
is not set to
'DENY'
. Unless there is a good reason for your site to serve other parts
of itself in a frame, you should change it to 'DENY'
.ALLOWED_HOSTS
não deve estar vazio durante a implantação.SECURE_HSTS_PRELOAD
setting to True
. Without this, your site
cannot be submitted to the browser preload list.SECURE_REFERRER_POLICY
setting. Without this, your site will not send a Referrer-Policy header. You
should consider enabling this header to protect user privacy.SECURE_REFERRER_POLICY
setting
to an invalid value.SECURE_CROSS_ORIGIN_OPENER_POLICY
setting to an invalid value.The following checks verify that your security-related settings are correctly configured:
DEFAULT_HASHING_ALGORITHM
must be 'sha1'
or
'sha256'
. This check appeared in Django 3.1 and 3.2.'path.to.view'
does not take the
correct number of arguments.'path.to.view'
could not be
imported.<handler>
was connected to the <signal>
signal with
a lazy reference to the sender <app label>.<model>
, but app <app label>
isn’t installed or doesn’t provide model <model>
.As verificações seguintes averiguam se sua definição de TEMPLATES
está corretamente configurada.
The following checks are performed on your translation configuration:
LANGUAGE_CODE
setting: <value>
.LANGUAGES
setting: <value>
.LANGUAGES_BIDI
setting: <value>
.LANGUAGE_CODE
setting that is not in the LANGUAGES
setting.As verificações seguintes são realizadas na sua configuração de URL:
<pattern>
uses
include()
with a route
ending with a $
. Remove the
dollar from the route
to avoid problems including URLs.<pattern>
has a route
beginning with
a /
. Remove this slash as it is unnecessary. If this pattern is targeted
in an include()
, ensure the include()
pattern has a trailing /
.<pattern>
tem um name
incluindo um :
. Remova os dois-pontos para evitar referências anbíguas de domínios baseados em nomes.<pattern>
is invalid. Ensure that
urlpatterns
is a list of path()
and/or
re_path()
instances.<namespace>
isn’t unique. You may not be
able to reverse all URLs in this namespace.MEDIA_URL
/ STATIC_URL
setting must
end with a slash.handlerXXX
view 'path.to.view'
does not
take the correct number of arguments (…).handlerXXX
view 'path.to.view'
could not be
imported.<pattern>
has an invalid view, pass
<view>.as_view()
instead of <view>
.contrib
app checks¶admin
¶Verificações do Admin são todas realizadas como parte da etiqueta admin
.
As seguintes verificações sào realizadas em qualquer ModelAdmin
(ou subclasse) que está registrada com o site Admin:
raw_id_fields
deve ser uma lista de tuplas.raw_id_fields[n]
refers to <field name>
,
which is not a field of <model>
.raw_id_fields[n]
deve ser uma chave estrangeira ou m campo muitos-para-muitos.fields
deve ser uma lista de tuplas.fieldsets
e fields
são especificados.fields
contém campo(s) duplicados.fieldsets
deve ser uma lista de tuplas.fieldsets[n]
deve ser uma lista de tuplas.fieldsets[n]
deve ter o comprimento igual a 2.fieldsets[n][1]
deve ser um dicionário.fieldsets[n][1]
deve conter a chave fields
.fieldsets[n][1]
.fields[n]/fieldsets[n][m]
cannot include the
ManyToManyField
<field name>
, because that field manually specifies a
relationship model.exclude
deve ser uma lista de tuplas.exclude
contém campos duplicado(s).form
deve herdar de BaseModelForm
.filter_vertical
deve ser uma lista de tuplas.filter_horizontal
deve ser uma lista de tuplas.filter_vertical[n]/filter_horizontal[n]
refers to <field name>
, which is not a field of <model>
.filter_vertical[n]/filter_horizontal[n]
must be a many-to-many field.radio_fields
deve ser um dicionário.radio_fields
refers to <field name>
,
which is not a field of <model>
.radio_fields
refers to <field name>
,
which is not an instance of ForeignKey
, and does not have a choices
definition.radio_fields[<field name>]
deve ser admin.HORIZONTAL
ou admin.VERTICAL
.view_on_site
deve ser um “callable” ou um booleano.prepopulated_fields
deve ser um dicionário.prepopulated_fields
refers to
<field name>
, which is not a field of <model>
.prepopulated_fields
refers to
<field name>
, which must not be a DateTimeField
, a ForeignKey
,
a OneToOneField
, or a ManyToManyField
field.prepopulated_fields[<field name>]
deve ser uma lista de tuplas.prepopulated_fields
refers to
<field name>
, which is not a field of <model>
.ordering
deve ser uma lista de tuplas.ordering
tem o operador para ordem randômica ?
, mas contém outros campos também.ordering
refers to <field name>
, which
is not a field of <model>
.readonly_fields
deve ser uma lista de tuplas.readonly_fields[n]
não é um “callable”, um atributo da <ModelAdmin class>
, ou um atributo do <model>
.autocomplete_fields
must be a list or tuple.autocomplete_fields[n]
refers to
<field name>
, which is not a field of <model>
.autocomplete_fields[n]
must be a foreign
key or a many-to-many field.<model>
has to be registered to be
referenced by <modeladmin>.autocomplete_fields
.<modeladmin>
must define search_fields
, because
it’s referenced by <other_modeladmin>.autocomplete_fields
.ModelAdmin
¶A verificações seguintes são realizadas para qualquer ModelAdmin
que é registrada com site Admin:
save_as
deve ser um booleano.save_on_top
deve ser um booleano.inlines
deve ser uma lista de tuplas.<InlineModelAdmin class>
must inherit from
InlineModelAdmin
.<InlineModelAdmin class>
deve ter um atributo model
.<InlineModelAdmin class>.model
deve ser um Model
.list_display
deve ser uma lista de tuplas.list_display[n]
referencia a <label>
, o qual não é um “callable”, um atributo de <ModelAdmin class>
, ou um atributo ou método do <model>
.list_display[n]
precisa ser um campo ManyToManyField
.list_display_links
deve ser uma lista, uma tupla, ou None
.list_display_links[n]
referencia a <label>
, o qual não é definido na list_display
.list_filter
deve ser uma lista de tuplas.list_filter[n]
deve herdar de ListFilter
.list_filter[n]
não deve herdar de FieldListFilter
.list_filter[n][1]
deve herdar de FieldListFilter
.list_filter[n]
refere a <label>
, o qual não refere a um campo.list_select_related
deve ser um booleano, tuplas ou lista.list_per_page
deve ser um inteiro.list_max_show_all
deve ser um inteiro.list_editable
deve ser uma lista de tuplas.list_editable[n]
refers to <label>
,
which is not a field of <model>
.list_editable[n]
refere a <label>
, o qual não está contido em list_display
.list_editable[n]
não pode estar em ambos list_editable
e list_display_links
.list_editable[n]
refere ao primeiro campo em list_display
(<label>
), o qual não pode ser usado a menos que list_display_links
seja definido.list_editable[n]
refere a <field name>
, o qual não é editável através do admin.search_fields
deve ser uma lista de tuplas.date_hierarchy
refers to <field name>
,
which does not refer to a Field.date_hierarchy
deve ser um DateField
ou DateTimeField
.<modeladmin>
must define a has_<foo>_permission()
method for the <action>
action.__name__
attributes of actions defined in
<modeladmin>
must be unique. Name <name>
is not unique.InlineModelAdmin
¶As verificações seguintes são realizadas em qualquer InlineModelAdmin
que esteja registrado como uma “inline” na ModelAdmin
.
<field name>
, porque ele é a chave-estrangeira para o modelo <app_label>.<model>
.<model>
has no ForeignKey
to <parent model>
./
<model>
has more than one ForeignKey
to <parent model>
. You must
specify a fk_name
attribute.extra
deve ser um inteiro.max_num
deve ser um inteiro.min_num
deve ser um inteiro.formset
deve herdar de BaseModelFormSet
.GenericInlineModelAdmin
¶As seguintes verificações são realizadas sobre qualquer GenericInlineModelAdmin
que esteja registrado como “inline” no ModelAdmin
.
'ct_field'
referencia a <label>
, o qual não é um campo no <model>
.'ct_fk_field'
referencia <label>
, o qual não é um campo no <model>
.<model>
não tem GenericForeignKey
.<model>
não tem GenericForeignKey
usando o campo de tipo de conteúdo <field name>
e um campo de ID do objeto <field name>
.AdminSite
¶As seguintes verificações são realizadas na AdminSite
: padrão
django.contrib.contenttypes
must be in
INSTALLED_APPS
in order to use the admin application.django.contrib.auth.context_processors.auth
must be enabled in DjangoTemplates
(TEMPLATES
) if using the default auth backend in order to use the
admin application.django.template.backends.django.DjangoTemplates
instance must be configured in TEMPLATES
in order to use the
admin application.django.contrib.messages.context_processors.messages
must be enabled in DjangoTemplates
(TEMPLATES
) in order to use the admin application.django.contrib.auth
must be in
INSTALLED_APPS
in order to use the admin application.django.contrib.messages
must be in
INSTALLED_APPS
in order to use the admin application.django.contrib.auth.middleware.AuthenticationMiddleware
must be in
MIDDLEWARE
in order to use the admin application.django.contrib.messages.middleware.MessageMiddleware
must be in MIDDLEWARE
in order to use the admin application.django.contrib.sessions.middleware.SessionMiddleware
must be in MIDDLEWARE
in order to use the admin application.django.template.context_processors.request
must be
enabled in DjangoTemplates
(TEMPLATES
) in order to use the admin navigation sidebar.auth
¶REQUIRED_FIELDS
deve ser uma lista de tuplas.USERNAME_FIELD
para um modelo de usuário personalizado não deve ser incluído no REQUIRED_FIELDS
.<field>
deve ser único porque ele está definido como USERNAME_FIELD
.<field>
é definido como o USERNAME_FIELD
, mas não é único.<codename>
clashes with a builtin
permission for model <model>
.<codename>
is duplicated for model
<model>
.verbose_name
of model <model>
must be at most
244 characters for its builtin permission names
to be at most 255 characters.<name>
of model <model>
is longer
than 255 characters.<User model>.is_anonymous
must be an attribute or property
rather than a method. Ignoring this is a security issue as anonymous users
will be treated as authenticated!<User model>.is_authenticated
must be an attribute or
property rather than a method. Ignoring this is a security issue as anonymous
users will be treated as authenticated!<model>
must be at most 93 characters
for its builtin permission names to be at most 100 characters.<codename>
of model <model>
is longer than 100 characters.contenttypes
¶As verificação seguintes são realizadas quando um modelo contém um GenericForeignKey
ou GenericRelation
:
GenericForeignKey
object ID references the
nonexistent field <field>
.GenericForeignKey
content type references the
nonexistent field <field>
.<field>
não é uma ForeignKey
.<field>
não é uma ForeignKey
para contenttypes.ContentType
.postgres
¶The following checks are performed on django.contrib.postgres
model
fields:
<field>
default should be a callable instead of an
instance so that it’s not shared between all field instances. This check was
changed to fields.E010
in Django 3.1.sites
¶As verificações seguintes são realizadas em qualquer modelo usando uma CurrentSiteManager
:
CurrentSiteManager
não pode achar um campo chamado <field name>
.CurrentSiteManager
cannot use <field>
as it is not a
foreign key or a many-to-many field.The following checks verify that django.contrib.sites
is correctly
configured:
SITE_ID
setting must be an integer.staticfiles
¶The following checks verify that django.contrib.staticfiles
is correctly
configured:
STATICFILES_DIRS
setting is not a tuple
or list.STATICFILES_DIRS
setting should not
contain the STATIC_ROOT
setting.<prefix>
in the
STATICFILES_DIRS
setting must not end with a slash.<directory>
in the
STATICFILES_DIRS
does not exist.ago. 03, 2022