Skip to main content

Customized Django admin panel with advanced UI and real-time system insights.

Project description

Himosoft Django Admin

Customized Django admin panel with advanced UI and real-time system insights

Preview

Features

  • Custom admin site
  • System information display (OS, Python version, Django version, database engine)
  • SSL status indicator
  • Custom CSS styling
  • Responsive design
  • NEW: Full compatibility with default Django admin.site.register()

Installation

Option 1: Copy the app to your project

  1. Copy the hs_django_admin directory to your Django project
  2. Add 'hs_django_admin' to your INSTALLED_APPS in settings.py
  3. Update your main urls.py to use the custom admin site

Option 2: Use as a reusable app

  1. Add 'hs_django_admin' to your INSTALLED_APPS in settings.py
  2. Import and use the custom admin site in your urls.py

Usage

Basic Integration

In you main settings.py

INSTALLED_APPS = [
    'hs_django_admin', # it must be at top
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # ... your other apps
]

In your main urls.py:

from django.urls import path
from hs_django_admin.admin import hs_admin

urlpatterns = [
    path('admin/', hs_admin.urls),
    # ... your other URL patterns
]

Model Registration (Multiple Options)

Option 1: Use default Django admin.site.register() (Recommended)

# your_app/admin.py
from django.contrib import admin
from .models import Product

# This automatically works with the custom admin site!
admin.site.register(Product)

Option 2: Use the custom admin site directly

from hs_django_admin.admin import get_admin_site
from your_app.models import YourModel

admin_site = get_admin_site()
admin_site.register(YourModel)

Option 3: Import the admin site instance directly

from hs_django_admin.admin import hs_admin
from your_app.models import YourModel

hs_admin.register(YourModel)

Option 4: Create your own admin site instance

from hs_django_admin.admin import HSDjangoAdmin
from your_app.models import YourModel

custom_admin = HSDjangoAdmin(name='my_custom_admin')
custom_admin.site_header = "My Custom Admin"
custom_admin.site_title = "My Custom Admin Portal"
custom_admin.register(YourModel)

Advanced ModelAdmin Usage

Using the Mixin

from django.contrib import admin
from hs_django_admin.admin import HSDjangoAdminMixin
from .models import Product

class ProductAdmin(HSDjangoAdminMixin, admin.ModelAdmin):
    list_display = ['name', 'price']
    search_fields = ['name']

admin.site.register(Product, ProductAdmin)

Custom Admin Classes

from hs_django_admin.admin import get_admin_site
from django.contrib import admin
from .models import Product

class ProductAdmin(admin.ModelAdmin):
    list_display = ['name', 'price']
    search_fields = ['name']

admin_site = get_admin_site()
admin_site.register(Product, ProductAdmin)

Manual Compatibility Control

If you need to control when compatibility is enabled:

from hs_django_admin.admin import enable_default_admin_compatibility, disable_default_admin_compatibility

# Enable compatibility
original_register = enable_default_admin_compatibility()

# Your admin registrations here
from django.contrib import admin
from .models import Product
admin.site.register(Product)

# Disable compatibility (optional)
disable_default_admin_compatibility(original_register)

Configuration

The app automatically provides:

  • System information in the admin context
  • Custom styling via static files
  • Enhanced admin templates
  • Automatic compatibility with default admin.site.register()

No additional configuration is required for basic functionality.

Your own branding

  • In in your django settings.py
        # Django Admin Settings
        ADMIN_SITE_HEADER = "Your Own Admin"
        ADMIN_SITE_TITLE = "Your Own Admin"
        ADMIN_INDEX_TITLE = "Welcome to Your Own Admin"
        ADMIN_LOGO_URL = "https://example.com/logo.png" # this will also work as admin shortcut icon
        ADMIN_FOOTER_ENABLED = False # this is a footer of himosoft info. You can disable it ❤️
    

Dependencies

  • Django 5.2+ (tested with Django 5.2.3)
  • No additional Python packages required

Notes

  • The app includes a TestModel for demonstration purposes
  • Custom admin templates override the default Django admin templates
  • Static files are automatically collected when running python manage.py collectstatic
  • Default admin compatibility is automatically enabled when the app loads
  • All existing admin.site.register() calls will work without modification

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you encounter any issues or have questions, please open an issue on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hs_django_admin-1.0.0.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hs_django_admin-1.0.0-py3-none-any.whl (46.7 kB view details)

Uploaded Python 3

File details

Details for the file hs_django_admin-1.0.0.tar.gz.

File metadata

  • Download URL: hs_django_admin-1.0.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for hs_django_admin-1.0.0.tar.gz
Algorithm Hash digest
SHA256 74147992365bca1c1056bb822d0e672628893cf2209a4e88fb38725130edccd9
MD5 c98c4eb654bc7fb2fbf53e04e3892ae6
BLAKE2b-256 abdee0b31259a7188b6bc7555cb5fae1c39745d271f28507a7e3e3e3d0acf688

See more details on using hashes here.

File details

Details for the file hs_django_admin-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hs_django_admin-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da5ab0537b713ca92ce12b9f1a57b9cf430a968e9744ae0a2d699a7c4749215e
MD5 75c0b8b97cd649dc5fba05c8cf5c9dd0
BLAKE2b-256 d9f147ee88595c36072c84369b18f25bcc6b37d13853f9b49c5efe260b2dbe0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page