FossilRepo

fossilrepo / startup.py
Blame History Raw 20 lines
1
"""Docker container startup script. Runs migrations and starts the dev server."""
2
3
import os
4
import subprocess
5
import sys
6
7
8
def main():
9
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
10
11
print("Running migrations...")
12
subprocess.run([sys.executable, "manage.py", "migrate", "--noinput"], check=True)
13
14
print("Starting development server...")
15
subprocess.run([sys.executable, "manage.py", "runserver", "0.0.0.0:8000"], check=False)
16
17
18
if __name__ == "__main__":
19
main()
20

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button