...
This commit is contained in:
60
pythonsetup/README.md
Normal file
60
pythonsetup/README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Python Example setup
|
||||
|
||||
This repository contains the setup scripts and configuration files for how we use python in threefold/ourworld
|
||||
|
||||
```bash
|
||||
./install.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
|
||||
1. Check if `uv` is installed (a fast Python package installer and resolver)
|
||||
2. Install `uv` if it's not found
|
||||
3. Initialize a uv project if `pyproject.toml` doesn't exist
|
||||
4. Sync all project dependencies using `uv sync`
|
||||
5. Install the herolib package from git repository
|
||||
6. Create necessary directories: (remove if you don't need this for your project)
|
||||
- `static/css`, `static/js`, `static/images` for static assets
|
||||
- `templates` for HTML templates
|
||||
- `md` for markdown files
|
||||
|
||||
check how we install herolib here
|
||||
- `pip install git+https://github.com/ThreeFoldTech/herolib.git` and also have support for the local checked out version
|
||||
|
||||
## Running the Server
|
||||
|
||||
### Production Mode
|
||||
|
||||
To start the server in production mode, run:
|
||||
|
||||
```bash
|
||||
./start_server.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
1. Set environment variables for production
|
||||
2. Check and free port 9922 if it's in use
|
||||
3. Start the web server on port 9922
|
||||
4. Make the server available at http://localhost:9922
|
||||
|
||||
### Development/Debug Mode
|
||||
|
||||
To start the server in development/debug mode, run:
|
||||
|
||||
```bash
|
||||
./start_server_debug.sh
|
||||
```
|
||||
|
||||
This script will:
|
||||
1. Set environment variables for development
|
||||
2. Enable debug mode
|
||||
3. Check and free port 9922 if it's in use
|
||||
4. Start the web server on port 9922 with debug options
|
||||
5. Make the server available at http://localhost:9922
|
||||
|
||||
## Environment Setup
|
||||
|
||||
The `pipenv.sh` script is automatically sourced by the startup scripts and handles:
|
||||
1. Setting the PYTHONPATH to include the src directory
|
||||
2. Creating a virtual environment with uv if it doesn't exist
|
||||
3. Activating the virtual environment
|
Reference in New Issue
Block a user