Secondary Development

This installation document is suitable for people with certain programming ability to build the development environment for secondary development. If you are deploying in a production environment, it is recommended to Docker installation. If necessary, you can also consider manual deployment.

Requirements Environment

  • Python 3.6 and above
  • Nodejs 12.14 LTS
  • Redis 3.x and above
  • Modern browser

Installation Steps

The installation steps below assume that the project is installed in the /data/spug directory of a macOS system.

1. Clone project code

  1. git clone https://github.com/openspug/spug /data/spug

2. Create running environment

  1. cd /data/spug/spug_api
  2. python3 -m venv venv
  3. source venv/bin/activate
  4. pip install -U pip setuptools
  5. pip install -r requirements.txt

3. Initialize the database

Default Sqlite database.

  1. python manage.py updatedb

4. Create default administrator account

  1. python manage.py user add -u admin -p spug.dev -s -n admin
  2. # -u username
  3. # -p password
  4. # -s superuser
  5. # -n nickname

5. Start the api development environment service

  1. python manage.py runserver

6. Install front-end dependencies

You can replace npm with yarn

  1. cd /data/spug/spug_web
  2. npm install

7. Start front-end

  1. npm start

8. Access test

In normal cases, npm start will automatically open the project in the browser. If it is not opened, you can enter http://localhost:3000 in the browser to access. If you follow the above document, you will create a default administrator account in step 4:

  1. user name: admin
  2. password: spug.dev

9. Other optional services

Now you can access Spug normally, but some functions depend on additional services, please refer to Development Document.

Common installation issues

Please refer to Installation Problems