File tree 6 files changed +18
-10
lines changed
6 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 21
21
- name : Update pyproject.toml version
22
22
run : |
23
23
sed -i "s/^version = .*/version = \"${{ env.RELEASE_VERSION }}\"/" pyproject.toml
24
- cat pyproject.toml # Для проверки
24
+ cat pyproject.toml
25
+
26
+ - name : Update __init__.py version
27
+ run : |
28
+ sed -i "s/^__version__ = .*/__version__ = \"${{ env.RELEASE_VERSION }}\"/" src/cotlette/__init__.py
29
+ cat src/cotlette/__init__.py
25
30
26
31
- name : Set up Python
27
32
uses : actions/setup-python@v4
Original file line number Diff line number Diff line change 1
- __version__ = "0.1.0"
2
- VERSION = "0.1.0"
1
+ __version__ = "0.0.0"
Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ def __init__(self, settings_module):
159
159
160
160
mod = importlib .import_module (self .SETTINGS_MODULE )
161
161
162
+ # Передача версии в settings
163
+ setattr (mod , "VERSION" , cotlette .__version__ )
164
+
162
165
tuple_settings = (
163
166
"ALLOWED_HOSTS" ,
164
167
"INSTALLED_APPS" ,
Original file line number Diff line number Diff line change @@ -160,8 +160,8 @@ <h6 class="text-white up mb-0">Need help?</h6>
160
160
</div>
161
161
</div> -->
162
162
163
- <!-- < a target="_blank"
163
+ < a target ="_blank "
164
164
class ="btn bg-gradient-primary mt-9 w-100 "
165
- href="https://github.com/ForceFledgling/cotlette">© 2025 Cotlette</a> -- >
165
+ href ="https://github.com/ForceFledgling/cotlette "> © 2025 Cotlette {{config.VERSION}} </ a >
166
166
</ div >
167
167
</ aside >
Original file line number Diff line number Diff line change
1
+ import os
2
+
1
3
from fastapi import APIRouter , Request
2
4
from cotlette .shortcuts import render
3
5
4
- router = APIRouter ()
5
-
6
- import os
6
+ from cotlette .conf import settings
7
7
8
+ router = APIRouter ()
8
9
9
10
10
11
def url_for (endpoint , ** kwargs ):
@@ -27,7 +28,8 @@ async def test(request: Request):
27
28
return render (request = request , template_name = "pages/index.html" , context = {
28
29
"url_for" : url_for ,
29
30
"parent" : "home" ,
30
- "segment" : "test"
31
+ "segment" : "test" ,
32
+ "config" : settings ,
31
33
})
32
34
33
35
@router .get ("/accounts_login" , response_model = None )
Original file line number Diff line number Diff line change 1
1
import pathlib
2
2
3
-
4
3
# Базовая директория проекта
5
4
BASE_DIR = pathlib .Path (__file__ ).resolve ().parent .parent
6
5
You can’t perform that action at this time.
0 commit comments