unfoldadmin / django-unfold

Modern Django admin theme for seamless interface development
https://unfoldadmin.com
MIT License
1.04k stars 96 forks source link

Don't works fields (style) #325

Closed alechries closed 1 month ago

alechries commented 1 month ago
image

I've updated the cache, whatever I've done, but I still get broken fields like this. The same goes for the date selection, there is also a broken field there

INSTALLED_APPS = [ "unfold", # before django.contrib.admin "unfold.contrib.filters", # optional, if special filters are needed "unfold.contrib.forms", # optional, if special form elements are needed "unfold.contrib.import_export", # optional, if django-import-export package is used "unfold.contrib.guardian", # optional, if django-guardian package is used "unfold.contrib.simple_history", # optional, if django-simple-history package is used 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'import_export', ]

rextea commented 1 month ago

You need to declare your admin models in admins.py to make it work, e.g:

from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User

from unfold.admin import ModelAdmin

admin.site.unregister(User)

@admin.register(User)
class UserAdmin(BaseUserAdmin, ModelAdmin):
    pass
lukasvinclav commented 1 month ago

Each model has to inherit from unfold.admin.ModelAdmin

https://github.com/unfoldadmin/django-unfold?tab=readme-ov-file#installation