print local and remote app urls when app host is set to "0.0.0.0"

+ update app version in settings.py
This commit is contained in:
geoffrey45
2023-01-20 22:21:40 +03:00
parent 5dad45f188
commit 3dc9bc1f15
8 changed files with 790 additions and 650 deletions
+19 -4
View File
@@ -1,14 +1,17 @@
"""
This module contains mini functions for the server.
"""
import os
import hashlib
from pathlib import Path
import threading
from datetime import datetime
from unidecode import unidecode
import os
import socket as Socket
import hashlib
import threading
import requests
from unidecode import unidecode
from app import models
from app.settings import SUPPORTED_FILES
@@ -224,3 +227,15 @@ def get_home_res_path(filename: str):
Returns a path to resources in the home directory of this project. Used to resolve resources in builds.
"""
return (CWD / ".." / filename).resolve()
def get_ip():
"""
Returns the IP address of this device.
"""
soc = Socket.socket(Socket.AF_INET, Socket.SOCK_DGRAM)
soc.connect(("8.8.8.8", 80))
ip_address = str(soc.getsockname()[0])
soc.close()
return ip_address