소스 검색

Fix favicon static files and logging

Colin Powell 2 년 전
부모
커밋
0ab7c563cf
4개의 변경된 파일17개의 추가작업 그리고 16개의 파일을 삭제
  1. 15 14
      vrobbler/settings.py
  2. BIN
      vrobbler/static/images/apple-touch-icon.png
  3. BIN
      vrobbler/static/images/favicon.ico
  4. 2 2
      vrobbler/templates/base.html

+ 15 - 14
vrobbler/settings.py

@@ -288,17 +288,17 @@ LOGGING = {
             "class": "logging.NullHandler",
             "level": LOG_LEVEL,
         },
-        "file": {
-            "class": "logging.handlers.RotatingFileHandler",
-            "filename": "".join([LOG_FILE_PATH, "vrobbler.log"]),
-            "formatter": LOG_TYPE,
-            "level": LOG_LEVEL,
+        'sql': {
+            'class': 'logging.handlers.RotatingFileHandler',
+            'filename': ''.join([LOG_FILE_PATH, 'vrobbler_sql.', LOG_TYPE]),
+            'formatter': LOG_TYPE,
+            'level': LOG_LEVEL,
         },
-        "requests_file": {
-            "class": "logging.handlers.RotatingFileHandler",
-            "filename": "".join([LOG_FILE_PATH, "vrobbler_requests.log"]),
-            "formatter": LOG_TYPE,
-            "level": LOG_LEVEL,
+        'file': {
+            'class': 'logging.handlers.RotatingFileHandler',
+            'filename': ''.join([LOG_FILE_PATH, 'vrobbler.', LOG_TYPE]),
+            'formatter': LOG_TYPE,
+            'level': LOG_LEVEL,
         },
     },
     "loggers": {
@@ -310,12 +310,13 @@ LOGGING = {
         "django.db.backends": {"handlers": ["null"]},
         "django.server": {"handlers": ["null"]},
         "vrobbler": {
-            "handlers": ["console", "file"],
+            "handlers": ["file"],
             "propagate": True,
         },
     },
 }
 
-if DEBUG:
-    # We clear out a db with lots of games all the time in dev
-    DATA_UPLOAD_MAX_NUMBER_FIELDS = 3000
+LOG_TO_CONSOLE = os.getenv("VROBBLER_LOG_TO_CONSOLE", False)
+if LOG_TO_CONSOLE:
+    LOGGING['loggers']['django']['handlers'] = ["console"]
+    LOGGING['loggers']['vrobbler']['handlers'] = ["console"]

BIN
vrobbler/static/images/apple-touch-icon.png


BIN
vrobbler/static/images/favicon.ico


+ 2 - 2
vrobbler/templates/base.html

@@ -8,6 +8,7 @@
         <meta http-equiv="x-ua-compatible" content="ie=edge">
         <meta name="description" content="">
         <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="shortcut icon" type="image/png" href="{% static 'images/favicon.ico' %}"/>
         <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
         <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
         <script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
@@ -165,8 +166,7 @@
         </style>
         {% block head_extra %}{% endblock %}
 
-        <link rel="apple-touch-icon" href="/apple-touch-icon.png">
-        <!-- Place favicon.ico in the root directory -->
+        <link rel="apple-touch-icon" href="{% static 'images/apple-touch-icon.png' %}">
     </head>
     <body>
         <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">