=============================GeoDjango Management Commands=============================``inspectdb``=============.. describe:: django-admin inspectdbWhen :mod:`django.contrib.gis` is in your :setting:`INSTALLED_APPS`, the:djadmin:`inspectdb` management command is overridden with one from GeoDjango.The overridden command is spatially-aware, and places geometry fields in theauto-generated model definition, where appropriate.``ogrinspect``==============.. django-admin:: ogrinspect data_source model_nameThe ``ogrinspect`` management command will inspect the given OGR-compatible:class:`~django.contrib.gis.gdal.DataSource` (e.g., a shapefile) and willoutput a GeoDjango model with the given model name. There's a detailed exampleof using ``ogrinspect`` :ref:`in the tutorial <ogrinspect-intro>`... django-admin-option:: --blank BLANKUse a comma separated list of OGR field names to add the ``blank=True``keyword option to the field definition. Set with ``true`` to applyto all applicable fields... django-admin-option:: --decimal DECIMALUse a comma separated list of OGR float fields to generate:class:`~django.db.models.DecimalField` instead of the default:class:`~django.db.models.FloatField`. Set to ``true`` to apply to allOGR float fields... django-admin-option:: --geom-name GEOM_NAMESpecifies the model attribute name to use for the geometry field.Defaults to ``'geom'``... django-admin-option:: --layer LAYER_KEYThe key for specifying which layer in the OGR:class:`~django.contrib.gis.gdal.DataSource` source to use.Defaults to 0 (the first layer). May be an integer or a string identifierfor the :class:`~django.contrib.gis.gdal.Layer`. When inspecting databases,``layer`` is generally the table name you want to inspect... django-admin-option:: --mappingAutomatically generate a mapping dictionary for use with:class:`~django.contrib.gis.utils.LayerMapping`... django-admin-option:: --multi-geomWhen generating the geometry field, treat it as a geometry collection.For example, if this setting is enabled then a:class:`~django.contrib.gis.db.models.MultiPolygonField` will be placedin the generated model rather than:class:`~django.contrib.gis.db.models.PolygonField`... django-admin-option:: --name-field NAME_FIELDGenerates a ``__str__()`` method on the model that returns the given fieldname... django-admin-option:: --no-importsSuppresses the ``from django.contrib.gis.db import models`` import statement... django-admin-option:: --null NULLUse a comma separated list of OGR field names to add the ``null=True``keyword option to the field definition. Set with ``true`` to apply toall applicable fields... django-admin-option:: --srid SRIDThe SRID to use for the geometry field. If not set, ``ogrinspect`` attemptsto automatically determine of the SRID of the data source.