|
|
1 жил өмнө | |
|---|---|---|
| .. | ||
| .vscode | 1 жил өмнө | |
| constants | 1 жил өмнө | |
| controllers | 1 жил өмнө | |
| core | 1 жил өмнө | |
| docker | 1 жил өмнө | |
| events | 1 жил өмнө | |
| extensions | 1 жил өмнө | |
| fields | 1 жил өмнө | |
| libs | 1 жил өмнө | |
| migrations | 1 жил өмнө | |
| models | 1 жил өмнө | |
| schedule | 1 жил өмнө | |
| services | 1 жил өмнө | |
| tasks | 1 жил өмнө | |
| templates | 1 жил өмнө | |
| tests | 1 жил өмнө | |
| .dockerignore | 2 жил өмнө | |
| .env.example | 1 жил өмнө | |
| Dockerfile | 1 жил өмнө | |
| README.md | 1 жил өмнө | |
| app.py | 1 жил өмнө | |
| commands.py | 1 жил өмнө | |
| config.py | 1 жил өмнө | |
| pyproject.toml | 1 жил өмнө | |
| requirements.txt | 1 жил өмнө | |
The backend require some middleware, including PostgreSQL, Redis, and Weaviate, which can be started together using docker-compose.
cd ../docker
docker-compose -f docker-compose.middleware.yaml -p dify up -d
cd ../api
.env.example to .envGenerate a SECRET_KEY in the .env file.
openssl rand -base64 42
3.5 If you use annaconda, create a new environment and activate it
conda create --name dify python=3.10
conda activate dify
Install dependencies
pip install -r requirements.txt
Run migrate
Before the first launch, migrate the database to the latest version.
flask db upgrade
⚠️ If you encounter problems with jieba, for example
> flask db upgrade
Error: While importing 'app', an ImportError was raised:
Please run the following command instead.
pip install -r requirements.txt --upgrade --force-reinstall
Start backend:
flask run --host 0.0.0.0 --port=5001 --debug
Setup your application by visiting http://localhost:5001/console/api/setup or other apis...
If you need to debug local async processing, you can run celery -A app.celery worker -P gevent -c 1 --loglevel INFO -Q dataset,generation,mail, celery can do dataset importing and other async tasks.