A Website for a Phd: Pylinac and QaTrack+

A Website for a Phd: Pylinac and QaTrack+

February 23, 2025

It all started when a friend discovered some parts to improve withing this library.

An image analysis library for medical physics

MIT | An image analysis library for medical physics

And also…

QATrack+ is an open source program for managing the quality control program of radiotherapy and diagnostic imaging clinics.


Then I proposed to start documenting his learning process.

HUGO HEXTRA with Github Pages

I suggested to start by cloning this very same repository.

As the HUGO Hextra theme is just ready to roll.

git clone

You will need to accept to run github actions workflows in the forked repository and activate Github Pages:

GHA WF Activation

That’s it, you are already publishing a blog/docs into Github Pages!

To run it locally, it was required to:

  1. Git was already installed!
  2. Download Go: from go.dev
  3. Download HUGO from github releases: 0.117 as its the ones that works on Github Actions
  4. Get in love with Hextra Hugo Theme
  5. Discover diagrams with mermaid.js (with preview at https://mermaid.live/ ) and get in love with Katex!

Commands to know:

hugo server #.\hugo server if you are on windows
hugo #to render, if you want, aka to build it locally

But…changes were pushed to the repo, and nothing happened.

And its all about that when you are forking a repo with Github Actions workflows, you need to enable them (understandable, security reasons):

KeyStatic CMS with LandingPad Theme

After you have accepted that (one time), all will flow.

And…here it is the result: https://jlleongarcia.github.io/jlleongarcia/

Thanks to: HUGO + Hextra + Github Actions and Pages!

Conclusions

I hope that this is the beginning of a new journey for jlleongarcia.

A journey where the rest of the world can benefit from his amazing effort and discoveries in the radiophysics area of expertise.

No wonder, he already knows that Im there to help with any Python that could make the world a better place!

ℹ️
JLL was involved in the crearion of RStocks

Next Steps

  1. Learn to use containers
  2. Setup wsl within Windows

Right-click on “Windows PowerShell” and select “Run as administrator.”

wsl --install #this install linux

Windows will ask you to restart.

Then, you can creeate a user and pass for Linux.

Thats really it!

Log in again to wsl via CMD:

wsl

Right now, you will see that you are using Linux:

sudo apt update #this is ubuntu already!
sudo apt upgrade -y

#sudo snap install htop
#htop #see how much resources is taking

#to access it at another moment, just write:
#wsl
ℹ️
This is a great moment to get started with SelfHosting
ℹ️
Once containers are installed, you can bundle your apps or use the ones that other have created!
  1. To understand better Python Web Frameworks, specially Django, as its the one that QaTrack uses
Django’s Core Philosophy and Strengths 📌
  • “Batteries Included”:
    • This phrase perfectly captures Django’s philosophy. It means that Django provides a comprehensive set of tools and libraries out of the box. You don’t have to hunt for third-party packages for common tasks.
  • Convention Over Configuration:
    • Django promotes a set of conventions for how web applications should be structured. This reduces the amount of configuration you need to do, allowing you to focus on writing code.
  • ORM (Object-Relational Mapper):
    • Django’s ORM is a powerful tool that allows you to interact with databases using Python code. You define your data models in Python, and Django handles the database interactions for you. This makes database operations much easier and more secure.

Detailed Breakdown of Django’s Features:

  • DRY (Don’t Repeat Yourself):
    • This is a fundamental principle of good software development. Django enforces DRY by encouraging you to reuse code whenever possible. For example, you can define your data models once and reuse them throughout your application. Django’s template system also promotes code reuse.
  • Fast:
    • Django is designed for speed. Its efficient architecture and built-in caching mechanisms allow it to handle a large number of requests quickly.
  • Components:
    • Django provides a wide range of built-in components, including:
      • Authentication and Authorization: Handles user logins, permissions, and security.
      • URL Routing: Maps URLs to Python functions (views).
      • Template System: Allows you to create dynamic HTML pages.
      • Form Handling: Simplifies the process of creating and processing forms.
      • Admin Interface: Provides a ready-to-use interface for managing your application’s data.
  • Security:
    • Django has built-in security features that help protect your application from common vulnerabilities, such as:
      • SQL Injection Protection: Django’s ORM automatically escapes user input, preventing SQL injection attacks.
      • Cross-Site Scripting (XSS) Protection: Django’s template system automatically escapes HTML, preventing XSS attacks.
      • Cross-Site Request Forgery (CSRF) Protection: Django provides built-in CSRF protection.
  • Scalability:
    • Django is designed to be scalable. Its architecture allows you to easily scale your application to handle increasing traffic and data.
    • Django can work well with load balancers, and database scaling solutions.
  • Community:
    • Django has a large and active community. This means that you can easily find help and resources when you need them.

Use Cases:

  • E-commerce websites
  • Content management systems (CMS)
  • Social networking platforms
  • Data analysis and visualization applications
  • API development

In essence: Django is a powerful and versatile framework that’s well-suited for building complex web applications.

Its “batteries-included” approach, security features, and scalability make it a popular choice for developers of all skill levels.

  1. Write, Write, write! Markdown is all you need and Practice makes perfection!
ℹ️
See https://github.com/joemccann/dillinger as The last Markdown editor, ever.

Cool stuff for Researchers

  1. If you are building on top of existing libraries…

MIT | local pypi server (custom packages and auto-mirroring of pypi)

  1. https://github.com/vinta/awesome-python

A great source to get Python ideas (good for the Python unknown unknowns!)