您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536
  1. # Dify Backend API
  2. ## Usage
  3. 1. Start the docker-compose stack
  4. The backend require some middleware, including PostgreSQL, Redis, and Weaviate, which can be started together using `docker-compose`.
  5. ```bash
  6. cd ../docker
  7. docker-compose -f docker-compose.middleware.yaml up -d
  8. cd ../api
  9. ```
  10. 2. Copy `.env.example` to `.env`
  11. 3. Generate a `SECRET_KEY` in the `.env` file.
  12. ```bash
  13. openssl rand -base64 42
  14. ```
  15. 4. Install dependencies
  16. ```bash
  17. pip install -r requirements.txt
  18. ```
  19. 5. Run migrate
  20. Before the first launch, migrate the database to the latest version.
  21. ```bash
  22. flask db upgrade
  23. ```
  24. 6. Start backend:
  25. ```bash
  26. flask run --host 0.0.0.0 --port=5001 --debug
  27. ```
  28. 7. Setup your application by visiting http://localhost:5001/console/api/setup or other apis...
  29. 8. If you need to debug local async processing, you can run `celery -A app.celery worker`, celery can do dataset importing and other async tasks.