You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.1 KiB

  1. # Getting started
  2. ## Quick install guide
  3. First of all, you have to clone the repository:
  4. ```bash
  5. git clone https://github.com/doccano/doccano.git
  6. cd doccano
  7. ```
  8. To install doccano, there are three options:
  9. ### Option1: Pull the production Docker image
  10. ```bash
  11. docker pull doccano/doccano
  12. ```
  13. ### Option2: Pull the development Docker-Compose images
  14. ```bash
  15. docker-compose pull
  16. ```
  17. ### Option3: Setup Python environment
  18. First we need to install the dependencies. Run the following commands:
  19. ```bash
  20. pip install -r requirements.txt
  21. cd app
  22. ```
  23. Next we need to start the webpack server so that the frontend gets compiled continuously.
  24. Run the following commands in a new shell:
  25. ```bash
  26. cd server/static
  27. npm install
  28. npm run build
  29. # npm start # for developers
  30. cd ..
  31. ```
  32. ## Usage
  33. Let’s start the development server and explore it.
  34. Depending on your installation method, there are two options:
  35. ### Option1: Running the Docker image as a Container
  36. First, run a Docker container:
  37. ```bash
  38. docker run -d --name doccano -p 8000:80 doccano/doccano
  39. ```
  40. Then, execute `create-admin.sh` script for creating a superuser.
  41. ```bash
  42. docker exec doccano tools/create-admin.sh "admin" "admin@example.com" "password"
  43. ```
  44. ### Option2: Running the development Docker-Compose stack
  45. We can use docker-compose to set up the webpack server, django server, database, etc. all in one command:
  46. ```bash
  47. docker-compose up
  48. ```
  49. Now, open a Web browser and go to <http://127.0.0.1:8000/login/>. You should see the login screen:
  50. ![Login form](./login_form.png)
  51. ### Option3: Running Django development server
  52. Before running, we need to make migration. Run the following command:
  53. ```bash
  54. python manage.py migrate
  55. ```
  56. Next we need to create a user who can login to the admin site. Run the following command:
  57. ```bash
  58. python manage.py create_admin --noinput --username "admin" --email "admin@example.com" --password "password"
  59. ```
  60. Developers can also validate that the project works as expected by running the tests:
  61. ```bash
  62. python manage.py test server.tests
  63. ```
  64. Finally, to start the server, run the following command:
  65. ```bash
  66. python manage.py runserver
  67. ```