SonarQube for django

aR chaudhary
Sep 23, 2020
Photo by Chris Ried on Unsplash

This is quick setup instruction for sonarqube to check your code quality of django application

Step 1: Install sonarqube, by this command you don’t have to manually download sonarqube and do setup part, but make sure you have Docker installed in your machine
docker run -d -p 9000:9000 -p 9092:9092 sonarqube

Step 2: open sonarqube, by copying url below to your browser and use username and password as mentioned below




Step 4: unzip your Sonar scanner, and copy your absolute path of bin which is inside sonar scanner like below

example => export PATH="$PATH:/home/achintya_ranjan/Downloads/sonar-scanner-cli-"

Step 5: run sonar scanner in your project directory

sonar-scanner -Dsonar.projectKey=YOUR_PROJECT_NAME -Dsonar.sources=. -Dsonar.qualitygate.wait=true

Step 6: Open localhost:9000 you’ll see your project name, make sure your project quality gate should pass(it will be in green color), and try to maintain 0 code smells and less security hotspots.