Browse Source

Fixed routes to static files

1Mike21 1 year ago
parent
commit
5568a158be
3 changed files with 3 additions and 3 deletions
  1. 1 1
      forms.py
  2. 1 1
      templates/admin/base_site.html
  3. 1 1
      urls.py

+ 1 - 1
forms.py

@@ -3,7 +3,7 @@ from design_template.apps import colors
 
 class LogoForm(forms.Form):
     namesystem = forms.CharField(max_length=30, label="Название системы", required=False)
-    logo = forms.FileField(label="Логотип")
+    logo = forms.FileField(label="Логотип", required=False)
     logo.widget.attrs.update({'accept':'.png, .svg, .ico'})
 
 class ColorsForm(forms.Form):

+ 1 - 1
templates/admin/base_site.html

@@ -5,7 +5,7 @@
 {% block title %}{% if subtitle %}{{ subtitle }} | {% endif %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
 
 {% block extrahead %}
-		<link rel="shortcut icon" href="{% static 'SharixAdmin/static/SharixAdmin/img/logo.ico' %}" />
+		<link rel="shortcut icon" href="{% static 'SharixAdmin/img/logo.svg' %}" />
 {% endblock %}
 {% block site-settings %}
 <a class="btn btn-outline-info" href="{% url 'design:settings' %}">Загрузить логотип</a>

+ 1 - 1
urls.py

@@ -7,6 +7,6 @@ app_name = "design"
 
 urlpatterns = [
     path("", views.upload, name="settings"),
-    path("logo.ico", lambda _ : redirect('SharixAdmin/img/logo.ico', permanent=True)),
+    path("logo.svg", lambda _ : redirect('SharixAdmin/img/logo.svg', permanent=True)),
     path("colors", views.change_colors, name="colors"),
 ]