63. Skip to content

63. Debugging

63.1 Run BIMS

63.1.1 VSCode

In VSCode, to run, and debug the application use the following command:

python manage.py runserver 0.0.0.0:8000

In the ports tab, you should see the 8000 port. Click on the local port address and open it in your browser.

63.1.2 PyCharm

In PyCharm, you can run the server using the green triangle next to the Django server label in the run configurations pull down menu. Debug mode will also work and you will be able to step through views etc., as you work.

63.2 Debugging BIMS in the Browser

Debugging is the process of finding and resolving bugs within a script. All current browsers provide support for debugging tools. In Firefox, or Chrome, right-click and select Inspect on your application. To debug it, you will use the following tools:

  • Inspector or Elements: to examine and modify the HTML and CSS
  • Console: to view messages logged by the application and error messages.
  • Debugger or Sources: to set breakpoints and watchpoints in your application's JavaScript, and examine and modify the application's state.

63.2.1 Debugging BIMS's Python

During the development make sure DEBUG=True in core.settings.dev.py

63.2.1.1 Logging

Logging is defined in core.settings.contrib.py by the variable LOGGING

In your code you can use logging like this:

logger.info('Csv %s is already being processed by another worker', path_file)

🪧 Now that you have your IDE set up, we can move on to building the project.