.
├── public # Public files for react
├── server # PyQt Web Server
│ ├── api
│ └── utils
├── src # React application source code
│ └── ...
└── main.py # Application entry point
All environment variables are stored in .env.
This is where we store sensitive information that we do not want to include in the source code, such as database login information.
-
Create a copy of
.env.exampleand rename it as.env. -
Fill in the missing information, such as database login username and password.
To access variables defined in .env, package python-dotenv is used.
from dotenv import load_dotenv
load_dotenv()Access ENVIRONMENT variable for example
ENVIRONMENT = os.environ['ENVIRONMENT']-
Install yarn https://classic.yarnpkg.com/en/docs/install/#windows-stable
-
Install node dependencies
yarn
-
Run react app
yarn start
-
Install virtualenv
pip install virtualenv
-
Create virtualenv
python -m venv ./venv
-
Activate virtualenv
# win venv/Scripts/activate.bat # mac source venv/bin/activate
-
Install python dependencies
pip install -r requirements.txt
-
Run Application
python main.py
Static files will be built in the ./build directory
yarn build(I am still figuring this out)