FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pgcommitfest/run_dev.py at main · postgres/pgcommitfest · GitHub
postgres
pgcommitfest
Repository navigation
Code
Issues
20
(20)
Pull requests
9
(9)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pgcommitfest
/
run_dev.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
35 lines (27 loc) · 937 Bytes
Breadcrumbs
pgcommitfest
/
run_dev.py
Copy path
File metadata and controls
executable file
·
35 lines (27 loc) · 937 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python3
"""Run uWSGI with Django static files mapping.
The reason we don't hardcode the path to the static admin directory in the
uwsgi_dev.ini file is because the path contains the python version, something
like:
env/lib/python3.12/site-packages/django/...
Requiring everyone to use the same python version is not practical, so instead
we have this tiny script that will find the path to the Django admin static
files and run uWSGI with the correct path.
"""
import
subprocess
import
sys
from
importlib
.
machinery
import
PathFinder
django_path
=
PathFinder
().
find_spec
(
"django"
).
submodule_search_locations
[
0
]
django_admin_path
=
django_path
+
"/contrib/admin/static/admin"
if
len
(
sys
.
argv
)
>
1
:
ini_file
=
sys
.
argv
[
1
]
else
:
ini_file
=
"uwsgi_dev.ini"
subprocess
.
run
(
[
"uwsgi"
,
"--static-map"
,
f"/media/admin=
{
django_path
}
/contrib/admin/static/admin"
,
ini_file
,
]
)
Back
|
FazBrowse Home
|
New Git URL