Spaces:
Running
Running
File size: 1,027 Bytes
4847e7d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import os
import shutil
def setup_env():
"""
Setup script to initialize the .env file from .env.example.
"""
example_file = '.env.example'
env_file = '.env'
print("--- Solar Prediction API Setup ---")
if not os.path.exists(example_file):
print(f"Error: {example_file} not found. Please ensure it exists.")
return
if os.path.exists(env_file):
print(f"{env_file} already exists. Skipping creation.")
else:
print(f"Creating {env_file} from {example_file}...")
shutil.copy(example_file, env_file)
print(f"Successfully created {env_file}.")
print("\nNext Steps:")
print(f"1. Open {env_file} and fill in your actual credentials.")
print("2. Ensure Python dependencies are installed: pip install -r requirements.txt")
print("3. Run the migrations if necessary: python manage.py migrate")
print("4. Start the server: python manage.py runserver 5000")
if __name__ == "__main__":
setup_env()
|