![]() When set, the given fields will use a bit of JavaScript to populate from In that case, in order to disable auto-discovery, you should ModelAdmin subclasses into your code and register them to the customĪdminSite. If you are using a custom AdminSite, it is common to import all of the Typically you won’t need to call this function directly as Such modules are expected to register models with the admin. ![]() This function attempts to import an admin module in each installedĪpplication. Overriding the default admin site for usage. default_site ¶Ī dotted import path to the default admin site’s class or to a callable SimpleAdminConfig ¶Įxcept it doesn’t call autodiscover(). It calls autodiscover() when Django starts. This is the default AppConfig class for the admin. Setting, Django automatically looks for an admin module in eachĪpplication and imports it. For each of those models, register them with the admin as By default, logging in to the admin requires that the user has theįinally, determine which of your application’s models should be editable in theĪdmin interface. If you need to create a user to login with, use the createsuperuserĬommand. Visiting the URL you hooked it into ( /admin/, by default). Hook the admin’s URLs into your URLconf.Īfter you’ve taken these steps, you’ll be able to use the admin site by.If you’ve customized the MIDDLEWARE setting,ĭ.AuthenticationMiddleware andĭ.MessageMiddleware must be.The 'context_processors' option of OPTIONS. ![]() Add '' and its dependencies -ĭ, ,ĭ, and - to yourĭ_processors.request,ĭ_th, andĭ_ssages in.If you’re not using the default project template, here are the requirements: The admin is enabled in the default project template used by
0 Comments
Leave a Reply. |