Django - How To Get The Server Port Programmatically

Опубликовано: 30 Сентябрь 2024
на канале: codevev
90
4

#Django #Python #Shorts

If you ever need to get the Django server port programmatically and have it displayed in your template, all you need to do is call the "get_port()" method on the request in your view and pass the result to the template via context.

-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter:   / evgenyurubkov  
Instagram:   / evgenyurubkov  
Youtube:    / @codevev