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
git clone https://github.com/openspug/spug /data/spug
2. Create running environment
cd /data/spug/spug_api
python3 -m venv venv
source venv/bin/activate
pip install -U pip setuptools
pip install -r requirements.txt
3. Initialize the database
Default Sqlite
database.
python manage.py updatedb
4. Create default administrator account
python manage.py user add -u admin -p spug.dev -s -n admin
# -u username
# -p password
# -s superuser
# -n nickname
5. Start the api development environment service
python manage.py runserver
6. Install front-end dependencies
You can replace npm
with yarn
cd /data/spug/spug_web
npm install
7. Start front-end
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:
user name: admin
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