Skip to content

Commit

Permalink
updates run dev server to be win32 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
dxenes1 committed Jan 9, 2023
1 parent b5c5333 commit b97f45e
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions neuvue_project/run-dev-server.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/python3

import subprocess
from sys import platform

# Turn debug mode on in settings.py
with open("neuvue/settings.py", "r") as f:
Expand All @@ -8,11 +11,21 @@
with open("neuvue/settings.py", "w") as f:
f.write(settings)

# Get recent migrations to database
subprocess.run(["python3", "manage.py", "migrate"], shell=True)
if platform == "win32":
# Get recent migrations to database
subprocess.run(["python", "manage.py", "migrate"], shell=True)

# Collect static files
subprocess.run(["python", "manage.py", "collectstatic", "--no-input"], shell=True)

# Run Dev server on localhost
subprocess.run(["python", "manage.py", "runserver", "localhost:8000"], shell=True)
else:
# Get recent migrations to database
subprocess.run(["python3", "manage.py", "migrate"])

# Collect static files
subprocess.run(["python3", "manage.py", "collectstatic", "--no-input"], shell=True)
# Collect static files
subprocess.run(["python3", "manage.py", "collectstatic", "--no-input"])

# Run Dev server on localhost
subprocess.run(["python3", "manage.py", "runserver", "localhost:8000"], shell=True)
# Run Dev server on localhost
subprocess.run(["python3", "manage.py", "runserver", "localhost:8000"])

0 comments on commit b97f45e

Please sign in to comment.