Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,13 +10,16 @@ from huggingface_hub.utils import RepositoryNotFoundError
|
|
| 10 |
from werkzeug.utils import secure_filename
|
| 11 |
|
| 12 |
app = Flask(__name__)
|
| 13 |
-
DATA_FILE = '
|
| 14 |
|
| 15 |
# Настройки Hugging Face
|
| 16 |
REPO_ID = "flpolprojects/Clients"
|
| 17 |
HF_TOKEN_WRITE = os.getenv("HF_TOKEN")
|
| 18 |
HF_TOKEN_READ = os.getenv("HF_TOKEN_READ")
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Настройка логирования
|
| 21 |
logging.basicConfig(level=logging.DEBUG)
|
| 22 |
|
|
@@ -102,7 +105,7 @@ def catalog():
|
|
| 102 |
<head>
|
| 103 |
<meta charset="UTF-8">
|
| 104 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 105 |
-
<title
|
| 106 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
| 107 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
|
| 108 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/10.2.0/swiper-bundle.min.css">
|
|
@@ -134,10 +137,24 @@ def catalog():
|
|
| 134 |
align-items: center;
|
| 135 |
padding: 15px 0;
|
| 136 |
border-bottom: 1px solid #e2e8f0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
.header h1 {
|
| 139 |
font-size: 1.5rem;
|
| 140 |
font-weight: 600;
|
|
|
|
| 141 |
}
|
| 142 |
.theme-toggle {
|
| 143 |
background: none;
|
|
@@ -411,6 +428,10 @@ def catalog():
|
|
| 411 |
font-size: 0.8rem;
|
| 412 |
padding: 8px;
|
| 413 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
#cart-button {
|
| 415 |
width: 50px;
|
| 416 |
height: 50px;
|
|
@@ -422,6 +443,7 @@ def catalog():
|
|
| 422 |
<body>
|
| 423 |
<div class="container">
|
| 424 |
<div class="header">
|
|
|
|
| 425 |
<h1>Каталог</h1>
|
| 426 |
<button class="theme-toggle" onclick="toggleTheme()">
|
| 427 |
<i class="fas fa-moon"></i>
|
|
@@ -837,6 +859,25 @@ def admin():
|
|
| 837 |
max-width: 1200px;
|
| 838 |
margin: 0 auto;
|
| 839 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 840 |
h1, h2 {
|
| 841 |
font-weight: 600;
|
| 842 |
margin-bottom: 20px;
|
|
@@ -906,10 +947,20 @@ def admin():
|
|
| 906 |
background: #f7fafc;
|
| 907 |
border-radius: 10px;
|
| 908 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 909 |
</style>
|
| 910 |
</head>
|
| 911 |
<body>
|
| 912 |
<div class="container">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 913 |
<h1>Добавление товара</h1>
|
| 914 |
<form method="POST" enctype="multipart/form-data">
|
| 915 |
<input type="hidden" name="action" value="add">
|
|
|
|
| 10 |
from werkzeug.utils import secure_filename
|
| 11 |
|
| 12 |
app = Flask(__name__)
|
| 13 |
+
DATA_FILE = 'dataasdem.json'
|
| 14 |
|
| 15 |
# Настройки Hugging Face
|
| 16 |
REPO_ID = "flpolprojects/Clients"
|
| 17 |
HF_TOKEN_WRITE = os.getenv("HF_TOKEN")
|
| 18 |
HF_TOKEN_READ = os.getenv("HF_TOKEN_READ")
|
| 19 |
|
| 20 |
+
# Ссылка на логотип
|
| 21 |
+
LOGO_URL = "https://cdn-avatars.huggingface.co/v1/production/uploads/67b22aaeae9b6a59f1cfb849/JrKb3It_r7IqEEikB9mZV.jpeg"
|
| 22 |
+
|
| 23 |
# Настройка логирования
|
| 24 |
logging.basicConfig(level=logging.DEBUG)
|
| 25 |
|
|
|
|
| 105 |
<head>
|
| 106 |
<meta charset="UTF-8">
|
| 107 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 108 |
+
<title>Routine wholesale - Женская одежда </title>
|
| 109 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
| 110 |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap" rel="stylesheet">
|
| 111 |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/10.2.0/swiper-bundle.min.css">
|
|
|
|
| 137 |
align-items: center;
|
| 138 |
padding: 15px 0;
|
| 139 |
border-bottom: 1px solid #e2e8f0;
|
| 140 |
+
position: relative;
|
| 141 |
+
}
|
| 142 |
+
.header-logo {
|
| 143 |
+
width: 60px;
|
| 144 |
+
height: 60px;
|
| 145 |
+
border-radius: 50%;
|
| 146 |
+
object-fit: cover;
|
| 147 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
| 148 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 149 |
+
}
|
| 150 |
+
.header-logo:hover {
|
| 151 |
+
transform: scale(1.1);
|
| 152 |
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
| 153 |
}
|
| 154 |
.header h1 {
|
| 155 |
font-size: 1.5rem;
|
| 156 |
font-weight: 600;
|
| 157 |
+
margin-left: 15px;
|
| 158 |
}
|
| 159 |
.theme-toggle {
|
| 160 |
background: none;
|
|
|
|
| 428 |
font-size: 0.8rem;
|
| 429 |
padding: 8px;
|
| 430 |
}
|
| 431 |
+
.header-logo {
|
| 432 |
+
width: 50px;
|
| 433 |
+
height: 50px;
|
| 434 |
+
}
|
| 435 |
#cart-button {
|
| 436 |
width: 50px;
|
| 437 |
height: 50px;
|
|
|
|
| 443 |
<body>
|
| 444 |
<div class="container">
|
| 445 |
<div class="header">
|
| 446 |
+
<img src="''' + LOGO_URL + '''" alt="Logo" class="header-logo">
|
| 447 |
<h1>Каталог</h1>
|
| 448 |
<button class="theme-toggle" onclick="toggleTheme()">
|
| 449 |
<i class="fas fa-moon"></i>
|
|
|
|
| 859 |
max-width: 1200px;
|
| 860 |
margin: 0 auto;
|
| 861 |
}
|
| 862 |
+
.header {
|
| 863 |
+
display: flex;
|
| 864 |
+
align-items: center;
|
| 865 |
+
padding: 15px 0;
|
| 866 |
+
border-bottom: 1px solid #e2e8f0;
|
| 867 |
+
}
|
| 868 |
+
.header-logo {
|
| 869 |
+
width: 60px;
|
| 870 |
+
height: 60px;
|
| 871 |
+
border-radius: 50%;
|
| 872 |
+
object-fit: cover;
|
| 873 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
|
| 874 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 875 |
+
margin-right: 15px;
|
| 876 |
+
}
|
| 877 |
+
.header-logo:hover {
|
| 878 |
+
transform: scale(1.1);
|
| 879 |
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
|
| 880 |
+
}
|
| 881 |
h1, h2 {
|
| 882 |
font-weight: 600;
|
| 883 |
margin-bottom: 20px;
|
|
|
|
| 947 |
background: #f7fafc;
|
| 948 |
border-radius: 10px;
|
| 949 |
}
|
| 950 |
+
@media (max-width: 768px) {
|
| 951 |
+
.header-logo {
|
| 952 |
+
width: 50px;
|
| 953 |
+
height: 50px;
|
| 954 |
+
}
|
| 955 |
+
}
|
| 956 |
</style>
|
| 957 |
</head>
|
| 958 |
<body>
|
| 959 |
<div class="container">
|
| 960 |
+
<div class="header">
|
| 961 |
+
<img src="''' + LOGO_URL + '''" alt="Logo" class="header-logo">
|
| 962 |
+
<h1>Админ-панель</h1>
|
| 963 |
+
</div>
|
| 964 |
<h1>Добавление товара</h1>
|
| 965 |
<form method="POST" enctype="multipart/form-data">
|
| 966 |
<input type="hidden" name="action" value="add">
|