Skip to content

Commit

Permalink
more path fixes for windows mainly for dev server reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Dec 7, 2024
1 parent 50105d9 commit dbef5ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ def replace_uuids():

def create_dotenv():
if not (this_dir / ".env").exists():
shutil.copy(".env.template", ".env")
shutil.copy(this_dir / ".env.template", this_dir / ".env")
insert_secret_key()
else:
print("Didn't create an '.env' file as one already exists.")


def insert_secret_key():
secret_key = Fernet.generate_key().decode()
with open(".env", "r") as file:
with open(this_dir / ".env", "r") as file:
lines = file.readlines()
with open(".env", "w") as file:
with open(this_dir / ".env", "w") as file:
for line in lines:
if line.startswith("XLWINGS_SECRET_KEY="):
file.write(f'XLWINGS_SECRET_KEY="{secret_key}"\n')
Expand Down Expand Up @@ -361,6 +361,7 @@ def has_pyodide_requirement(requirements_file):
host="127.0.0.1",
port=8000,
reload=True,
reload_dirs=[this_dir],
reload_includes=[".env"],
ssl_keyfile=ssl_keyfile,
ssl_certfile=ssl_certfile,
Expand Down

0 comments on commit dbef5ad

Please sign in to comment.