Merge branch 'develope' of https://dxpgit.homeunix.com/ilanq7/remoteadmin into develope
This commit is contained in:
commit
79430deab9
18
.vscode/launch.json
vendored
Normal file
18
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Daphne ASGI server",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "daphne",
|
||||
"args": ["-b", "127.0.0.1", "-p", "8001", "project.config.asgi:application"],
|
||||
"justMyCode": true,
|
||||
"env": {
|
||||
"DJANGO_SETTINGS_MODULE": "project.config.settings"
|
||||
},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "integratedTerminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
manage.py
10
manage.py
@ -4,10 +4,12 @@ import sys
|
||||
from pathlib import Path
|
||||
|
||||
def main():
|
||||
project_dir = Path(__file__).resolve().parent / 'project'
|
||||
if str(project_dir) not in sys.path:
|
||||
sys.path.insert(0, str(project_dir))
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.config.settings')
|
||||
# Ensure the repository root (containing the 'project' package) is on sys.path.
|
||||
repo_root = Path(__file__).resolve().parent
|
||||
if str(repo_root) not in sys.path:
|
||||
sys.path.insert(0, str(repo_root))
|
||||
# Force correct settings module even if an old environment var (e.g. 'dali.settings') lingers.
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.config.settings'
|
||||
from django.core.management import execute_from_command_line
|
||||
execute_from_command_line(sys.argv)
|
||||
|
||||
|
||||
@ -5,11 +5,12 @@ from django.core.asgi import get_asgi_application
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from channels.auth import AuthMiddlewareStack
|
||||
|
||||
project_dir = Path(__file__).resolve().parent.parent
|
||||
if str(project_dir) not in sys.path:
|
||||
sys.path.insert(0, str(project_dir))
|
||||
# Add repository root so 'project' package is importable regardless of CWD.
|
||||
repo_root = Path(__file__).resolve().parent.parent.parent
|
||||
if str(repo_root) not in sys.path:
|
||||
sys.path.insert(0, str(repo_root))
|
||||
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.config.settings')
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.config.settings'
|
||||
|
||||
http_app = get_asgi_application()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user