Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.05 KB

File metadata and controls

28 lines (17 loc) · 1.05 KB

Adding setproctitle to Django

In a recent episode of Python Bytes cohost Michael Kennedy highlighted a new package called setproctitle.

In a nutshell, setproctitle

allows a process to change its title (as displayed by system tools such as ps, top or MacOS Activity Monitor).

I thought this would be a neat idea to try with one of my Django projects and it turns out it was straight forward to implement.

To set it up you:

pip install setproctitle

Update your settings.py file to include the following

import setproctitle

SITE_TITLE = "Super Awesome WebSite Title"
setproctitle.setproctitle(f"Django Web Process: {SITE_TITLE}")

Now when you run your Django App you can easily find it running in system tools such as ps, top or MacOS Activity Monitor

setproctitle with django