port_fixes

This commit is contained in:
makram89 2022-01-28 00:41:18 +01:00
parent 2a3c514e4c
commit 5bb0a56053
2 changed files with 6 additions and 1 deletions

View File

@ -135,3 +135,6 @@ CRISPY_TEMPLATE_PACK = 'bootstrap4'
AUTH_USER_MODEL = "MUOR.Profile" AUTH_USER_MODEL = "MUOR.Profile"
AVAILABLE_PORTS_RANGE = (6000, 7000)

View File

@ -4,6 +4,7 @@ from .DockerManager import DockerManager
from .NGINXConfigurator import NGINXConfigurator from .NGINXConfigurator import NGINXConfigurator
from .models import Profile, Session from .models import Profile, Session
from django.contrib.auth.signals import user_logged_in, user_logged_out from django.contrib.auth.signals import user_logged_in, user_logged_out
from django.conf import settings
def get_sessions_data(): def get_sessions_data():
@ -36,7 +37,8 @@ def profile_start_up(sender, user, request, **kwargs):
# Create container # Create container
docker_manager = DockerManager() docker_manager = DockerManager()
port = 6969 # Port range
port = settings.AVAILABLE_PORTS_RANGE[0]
container_id = -1 container_id = -1
while True: while True:
try: try: