Django installation
Prerequisites
PeTeReport requires Python ≥ 3.8. Recommended installation requires pip
. As a base requirement, the following packages are needed:
- Ubuntu/Debian:
sudo apt-get install python3-pip python3-venv build-essential
- OpenSuse:
sudo zypper install python3-devel gcc
- CentOS:
sudo yum install python3-devel gcc
Environment
It is strongly recommended to set up the installation in a virtual environment (Pipenv):
Pipenv
- Linux:
sudo apt-get install pipenv
- pip:
python3 -m pip install pipenv
- MAC:
brew install pipenv
Dependencies
Easiest way in Linux (ubuntu): $ sudo bash scripts/ubuntu_environment_install.sh
Latex
Linux:
sudo apt-get install texlive-full
Mac:
brew remove basictex
brew cask install mactex
Pandoc
Linux:
sudo apt-get install pandoc
sudo apt-get install python3-pypandoc
Mac:
brew install pandoc
brew install pandoc-citeproc
Eisvogel
python3 -m pip install pandoc-latex-environment
- Download the latest version of the Eisvogel template from the release page.
- Extract the downloaded ZIP archive and open the folder.
- Move the template eisvogel.tex to your pandoc templates folder and rename the file to eisvogel.latex. The location of the templates folder depends on your operating system:
/Users/$USER/.pandoc/templates/eisvogel.latex
or/home/$USER/.pandoc/templates
PeTeReport
- Clone the project and cd into PeTeReport:
cd petereport/
- Create a new virtual environment and installing dependencies:
pipenv install
- Run the virtual environment:
pipenv shell
- Go to Django PeTeReport App:
cd app/
- Create the database:
python manage.py migrate
- Make the latest database changes:
python manage.py makemigrations
- Super user admin/P3t3r3p0rt will be created, but you can create a new super user:
python manage.py createsuperuser
- Populate the CWE data
python manage.py loaddata config/cwe-list.json
- Populate the OWASP data
python manage.py loaddata config/owasp-list.json
Start the server
- Run the virtual environment:
pipenv shell
- Go to Django PeTeReport App:
cd app/
- Start the django server:
python manage.py runserver --insecure
orpython manage.py runserver 0.0.0.0:8000 --insecure
- Go to http://127.0.0.1:8000/
- Login with any of users created admin/P3t3r3p0rt (administrator) and viewer/v13w3r (viewer) or the user credentials configured in the configuration file
- Try harder
- Create a report
- Close up and stop the server:
Ctrl + C
Upgrade PeTeReport
- Stop the server if it's running:
Ctrl + C
- Pull the latest code base via git:
git pull
or download the source and replace the files. - Setup any additional dependencies:
pipenv install
- Run the virtual environment:
pipenv shell
- Make the latest database changes:
python manage.py makemigrations
- Make the latest database changes:
python manage.py migrate
- Start the server:
python manage.py runserver --insecure
- Try harder again
Clean PeTeReport
- Stop the server if it's running:
Ctrl + C
- Run the virtual environment:
pipenv shell
- Go to Django PeTeReport App:
cd app/
- Run cleaner:
python clean.py
- Make the latest database changes:
python manage.py makemigrations
- Make the latest database changes:
python manage.py migrate
- Start the server:
python manage.py runserver --insecure
- Try harder again
Configuration
- Stop the server if it's running:
Ctrl + C
- Customize reports and configuration in
app/config/petereport_config.py
- Start the django server:
python manage.py runserver --insecure
orpython manage.py runserver 0.0.0.0:8000 --insecure