-
Notifications
You must be signed in to change notification settings - Fork 21
/
run.wsgi
36 lines (27 loc) · 1003 Bytes
/
run.wsgi
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
33
34
35
36
#! /usr/bin/python3
"""
WSGI entry point for the Taranis-NG application.
This script sets up the environment and initializes the WSGI application.
Environment Variables:
- DB_URL: URL of the database.
- DB_DATABASE: Name of the database.
- DB_USER: Username for the database.
- DB_PASSWORD: Password for the database.
- JWT_SECRET_KEY: Secret key for JWT authentication.
Modules:
- sys: Provides access to some variables used or maintained by the interpreter.
- os: Provides a way of using operating system dependent functionality.
- dotenv: Loads environment variables from a .env file.
- app: Contains the create_app function to initialize the application.
Functions:
- create_app: Initializes and returns the WSGI application.
Usage:
- This script is intended to be used as the entry point for a WSGI server.
"""
import sys
import os
from dotenv import load_dotenv, find_dotenv
from app import create_app
sys.path.insert(0, os.getcwd())
load_dotenv(find_dotenv())
application = create_app()