arpakitlib 1.8.114__py3-none-any.whl → 1.8.115__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ async def async_startup_api_event():
42
42
  ):
43
43
  get_cached_json_db().init()
44
44
 
45
- if get_cached_sqlalchemy_db() is not None:
45
+ if get_cached_sqlalchemy_db() is not None and get_cached_settings().api_create_first_data:
46
46
  create_first_data_for_api()
47
47
 
48
48
  if get_cached_settings().api_start_operation_executor_worker:
@@ -104,6 +104,8 @@ class Settings(SimpleSettings):
104
104
 
105
105
  api_start_scheduled_operation_creator_worker: bool = False
106
106
 
107
+ api_create_first_data: bool = True
108
+
107
109
  sqladmin_secret_key: str | None = "85a9583cb91c4de7a78d7eb1e5306a04418c9c43014c447ea8ec8dd5deb4cf71"
108
110
 
109
111
  sqladmin_authorize_keys: list[str] | None = ["1"]
@@ -0,0 +1,41 @@
1
+ import asyncio
2
+
3
+ from project.core.jinja2_templates import get_cached_jinja2_templates
4
+ from project.core.util import setup_logging
5
+ from project.emailer.send_email import async_send_email
6
+
7
+
8
+ async def async_send_simple_email(
9
+ *,
10
+ to_email: str,
11
+ project_name: str,
12
+ title: str,
13
+ text: str
14
+ ):
15
+ render_data = {
16
+ "title": title,
17
+ "project_name": project_name,
18
+ "text": text
19
+ }
20
+
21
+ html_content = get_cached_jinja2_templates().get_template("simple_email.html").render(render_data)
22
+
23
+ await async_send_email(
24
+ to_email=to_email,
25
+ subject=title,
26
+ html_content=html_content
27
+ )
28
+
29
+
30
+ async def __async_example():
31
+ setup_logging()
32
+ await async_send_simple_email(
33
+ to_email="arpakit@gmail.com",
34
+ title="Notification",
35
+ project_name="Test",
36
+ text="asfasf"
37
+ )
38
+
39
+
40
+ if __name__ == '__main__':
41
+ asyncio.run(__async_example())
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>{{ title }}</title>
6
+ <style>
7
+ body {
8
+ font-family: Arial, sans-serif;
9
+ background-color: #f4f4f4;
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+ .container {
14
+ background-color: #ffffff;
15
+ width: 90%;
16
+ max-width: 600px;
17
+ margin: 30px auto;
18
+ padding: 20px;
19
+ border-radius: 8px;
20
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
21
+ }
22
+ .header {
23
+ border-bottom: 1px solid #dddddd;
24
+ padding-bottom: 10px;
25
+ margin-bottom: 20px;
26
+ }
27
+ .footer {
28
+ margin-top: 30px;
29
+ font-size: 12px;
30
+ color: #777777;
31
+ text-align: center;
32
+ }
33
+ </style>
34
+ </head>
35
+ <body>
36
+ <div class="container">
37
+ <div class="header">
38
+ <h2>{{ project_name }}</h2>
39
+ </div>
40
+ <h3>{{ title }}</h3>
41
+ <p>{{ text }}</p>
42
+ <div class="footer">
43
+ &copy; {{ project_name }} — Все права защищены.
44
+ </div>
45
+ </div>
46
+ </body>
47
+ </html>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: arpakitlib
3
- Version: 1.8.114
3
+ Version: 1.8.115
4
4
  Summary: arpakitlib
5
5
  License: Apache-2.0
6
6
  Keywords: arpakitlib,arpakit,arpakit-company,arpakitcompany,arpakit_company
@@ -90,7 +90,7 @@ arpakitlib/_arpakit_project_template_v_5/project/api/blank/common.py,sha256=ug1F
90
90
  arpakitlib/_arpakit_project_template_v_5/project/api/const.py,sha256=J9bqaRRiIc3RLn6SJTvdfDvFrSsM_Ixii9t2M8dA5Jc,433
91
91
  arpakitlib/_arpakit_project_template_v_5/project/api/create_api_app.py,sha256=fRYjpKEB5pMpFtWEhUe84mVvaFBKQ2WU5BTwCpb0J2Y,2861
92
92
  arpakitlib/_arpakit_project_template_v_5/project/api/create_first_data.py,sha256=sc98-xW74QbhFCT6AW5-fUJVd8RLRxClAOEW5-ec9T0,1815
93
- arpakitlib/_arpakit_project_template_v_5/project/api/event.py,sha256=2DqXb8-iiSMoyh5OJI7nf53N5Bij5HfnFVrbLlI8G3w,2566
93
+ arpakitlib/_arpakit_project_template_v_5/project/api/event.py,sha256=sJ9-GgBdIruJW2Kj7cU-BcqRyD8IItWFQrmGKndZ4nw,2614
94
94
  arpakitlib/_arpakit_project_template_v_5/project/api/exception.py,sha256=cNZaI2DacGLl8Hyn1qIfFpVjvQzOQjwXWsVW4auBrCo,1280
95
95
  arpakitlib/_arpakit_project_template_v_5/project/api/exception_handler.py,sha256=TEzkCNOg_TAELRTZgLtblVagSaHf-vego_oH5FNCbcs,11179
96
96
  arpakitlib/_arpakit_project_template_v_5/project/api/openapi_ui.py,sha256=PLhH-W6zDViO-75AGCs8Vq3IoyHChdqwBYAqLvdQN0U,904
@@ -172,8 +172,11 @@ arpakitlib/_arpakit_project_template_v_5/project/core/dump_file_storage_in_dir.p
172
172
  arpakitlib/_arpakit_project_template_v_5/project/core/easy_openai_api_client.py,sha256=G4J9s0gerNlnvl1LvaWSYy1gdvaMbxyz0ZP35U9nx_Q,1219
173
173
  arpakitlib/_arpakit_project_template_v_5/project/core/jinja2_templates.py,sha256=jCNLaBauGC7YNvZdTLNHuPp7hmRGt94O23Skg6ewo7o,352
174
174
  arpakitlib/_arpakit_project_template_v_5/project/core/media_file_storage_in_dir.py,sha256=fMofTsfJtA8pp5lEUhucEUu3PBsmj-elaRZzExDsdLI,623
175
- arpakitlib/_arpakit_project_template_v_5/project/core/settings.py,sha256=BO6AgjZcK2pwClQFjabtuBObY0bvQ6NWbrrqvT2Kc_c,6270
175
+ arpakitlib/_arpakit_project_template_v_5/project/core/settings.py,sha256=mUZQMBz76xh2KXSjzTn6yCkA8PUSnqSeVSSk9fs7lys,6310
176
176
  arpakitlib/_arpakit_project_template_v_5/project/core/util.py,sha256=1ha9UrguVPsTSjoMHhVZVCD0_mNBfhIDGEvcG1nA4Zw,667
177
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/send_email.py,sha256=lw-nUFtEYiGEChSZrfuXCtTkoY6fNT45M_Y6QfzOk90,2175
179
+ arpakitlib/_arpakit_project_template_v_5/project/emailer/send_simple_email.py,sha256=yv4fAtUuneK6nmIVn2vAoXqjBVFSoEliBcGssTeHoVs,932
177
180
  arpakitlib/_arpakit_project_template_v_5/project/json_db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
178
181
  arpakitlib/_arpakit_project_template_v_5/project/json_db/json_db.py,sha256=tBML-z4Y7uY8f_0ggcxvlDNt15Sf93Jr_OUeHwWxqOA,724
179
182
  arpakitlib/_arpakit_project_template_v_5/project/more/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -210,6 +213,7 @@ arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swag
210
213
  arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swagger-ui.js,sha256=yHKu9z0C2kOO5j9n9D8oQzuBLeEoMGrFcMWQN27V554,339285
211
214
  arpakitlib/_arpakit_project_template_v_5/project/resource/static/swagger-ui/swagger-ui.js.map,sha256=jeX-b8zAm2jsTGGCznrc49McbLKSfXspwECPhEAp0Xc,1159444
212
215
  arpakitlib/_arpakit_project_template_v_5/project/resource/templates/healthcheck.txt,sha256=sxSHRe2D3mnWbLKY320QdFehtXS-zAgMQmmu7tAQIG0,11
216
+ arpakitlib/_arpakit_project_template_v_5/project/resource/templates/simple_email.html,sha256=NNfrRzQFrymBSjWZdO-nkNSKk68hyPP9XgvQXpNQI4I,1112
213
217
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
218
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_1.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
215
219
  arpakitlib/_arpakit_project_template_v_5/project/sandbox/sandbox_2.py,sha256=xKSp7tIBu3Ffp_kgJkwVtdam3BcoFZ44JPVHoRRaP0E,163
@@ -348,7 +352,6 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot_notifier/tg_bot_notifier
348
352
  arpakitlib/_arpakit_project_template_v_5/project/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
349
353
  arpakitlib/_arpakit_project_template_v_5/project/util/arpakitlib_project_template_util.py,sha256=syA_IuszHVub0zm0sVdB4_7rPJXwXRW4JmQ4qHbjXPk,396
350
354
  arpakitlib/_arpakit_project_template_v_5/project/util/etc.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
351
- arpakitlib/_arpakit_project_template_v_5/project/util/send_email.py,sha256=lw-nUFtEYiGEChSZrfuXCtTkoY6fNT45M_Y6QfzOk90,2175
352
355
  arpakitlib/_arpakit_project_template_v_5/todo.txt,sha256=q132Jbx229ThY77S3YiN-Cj5AVm7k1VlJcMYIbZUHUY,3
353
356
  arpakitlib/ar_additional_model_util.py,sha256=GFg-glLCxH9X95R2bhTJsscVwv37FgE1qbaAAyXrnIE,917
354
357
  arpakitlib/ar_aiogram_util.py,sha256=4bizX5Xg-E2-r2TXXGQGanJozsIWPVf5luO3vKUN8p8,8471
@@ -398,8 +401,8 @@ arpakitlib/ar_ssh_runner_util.py,sha256=yvAwza480MkHKvLkDEsR7JNh2bYNs6P9rCVo4NA8
398
401
  arpakitlib/ar_str_util.py,sha256=CAv0wH8nP5Ja59S-hEdmNhNrM_Fwy935d0zntLpJkx8,4309
399
402
  arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
400
403
  arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
401
- arpakitlib-1.8.114.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
402
- arpakitlib-1.8.114.dist-info/METADATA,sha256=RF87YlXnrStQ2Qld70zHu6k7AgKoS-cgZP8W5TY-3t8,3566
403
- arpakitlib-1.8.114.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
404
- arpakitlib-1.8.114.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
405
- arpakitlib-1.8.114.dist-info/RECORD,,
404
+ arpakitlib-1.8.115.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
405
+ arpakitlib-1.8.115.dist-info/METADATA,sha256=nEC6Ttco9zy_oyVEcaEgbijoA3Y26w3mHOSlgoAS_Ko,3566
406
+ arpakitlib-1.8.115.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
407
+ arpakitlib-1.8.115.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
408
+ arpakitlib-1.8.115.dist-info/RECORD,,