farridav / django-jazzmin

Jazzy theme for Django
https://django-jazzmin.readthedocs.io
MIT License
1.65k stars 287 forks source link

Trouble with extension templates on Heroku #457

Open Geg3mon opened 2 years ago

Geg3mon commented 2 years ago

Hello guys, i have a trouble with submit_line.html on Heroku, when i deployed, my additional button does not display, some code from my project.

When i run local with heroku (without debug) settings - all go good

In app/module folder: templates/admin/module_name/model_name/

submit_line.html

{% extends "admin/submit_line.html" %}
{% load jazzmin %}
{% get_jazzmin_ui_tweaks as jazzmin_ui %}

{% block extra-actions %}

<div class="form-group">
    <a href="https://www.djangoproject.com/" class="btn {{ jazzmin_ui.button_classes.warning }} form-control" target="_blank">Go Django</a>
</div>

{# Process with form submission #}
<div class="form-group">
    <input type="submit" class="btn {{ jazzmin_ui.button_classes.primary }} form-control" value="Send message to chats" name="send">
</div>
{% endblock %}

In settings.py


INSTALLED_APPS = [
    'jazzmin',
    ...
]

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    ....
]

STATICFILES_STORAGE = 'whitenoise.storage.CompressedStaticFilesStorage'
WHITENOISE_USE_FINDERS = True # Must be True, without this setting - don't work
STATIC_URL = "static/"
STATIC_ROOT = os.path.join(BASE_DIR, "static")

JAZZMIN_SETTINGS = {
    "site_title": "Club",
    "site_header": "Club",
    "site_brand": "Club",
    "welcome_sign": "Welcome to Club",
    "copyright": "Hihi",
    "hide_models": ["auth.group"],
    # "show_ui_builder": True,
    # "site_logo": "/images/logo.png"
    "order_with_respect_to": ["channel"],
    "icons": {
        ".channel": "fas fa-comments",
        ".groups": "fas fa-users",
        ".message": "fas fa-comment-dots",
        ".botcommand": "fas fa-terminal",
        ".quiz": "fas fa-poll-h",
        "auth.user": "fas fa-user-circle",
},
}

JAZZMIN_UI_TWEAKS = {
    "navbar_small_text": True,
    "footer_small_text": True,
    "body_small_text": True,
    "brand_small_text": True,
    "brand_colour": "navbar-dark",
    "accent": "accent-primary",
    "navbar": "navbar-gray-dark navbar-dark",
    "no_navbar_border": True,
    "navbar_fixed": False,
    "layout_boxed": False,
    "footer_fixed": False,
    "sidebar_fixed": True,
    "sidebar": "sidebar-dark-info",
    "sidebar_nav_small_text": True,
    "sidebar_disable_expand": False,
    "sidebar_nav_child_indent": False,
    "sidebar_nav_compact_style": False,
    "sidebar_nav_legacy_style": True,
    "sidebar_nav_flat_style": True,
    "theme": "minty",
    "dark_mode_theme": None,
    "button_classes": {
        "primary": "btn-primary",
        "secondary": "btn-secondary",
        "info": "btn-info",
        "warning": "btn-warning",
        "danger": "btn-danger",
        "success": "btn-success"
    },
    "actions_sticky_top": True,
    "custom_links": {
        "ChannelsAdmin": [{
            "name": "Channel",
            "icon": "fas fa-phone",

    }]
},
}

Procfile.py

release: python manage.py migrate
web: gunicorn app_name.wsgi
worker: python manage.py bot
Geg3mon commented 2 years ago

Still need help