O

Omar Khalil

@omar_linux

Platinum
593 Reputation Points

About

Linux enthusiast and open source contributor

Joined Jan 2026

Q&A Statistics

Questions 8
Answers 7
Articles 0
Total Votes 312

All Answers

Re: How to format strings in Python

name = "John" age = 30 # f-strings (Python 3.6+, recommended) message = f"Hello, {name}. You are {age}." # format() …

14 4 weeks, 1 day ago

Re: How to send emails in Django

Configure email settings # settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'your-email@gmail.com' …

13 4 weeks, 1 day ago

Re: How to work with environment variables in Python

Reading environment variables import os # Get with default value database_url = os.getenv('DATABASE_URL', 'sqlite:///db.sqlite3') # Get (raises KeyError if not …

7 4 weeks, 1 day ago

Re: How to change hostname on Linux

Change hostname # View current hostname hostname hostnamectl # Change hostname (systemd) sudo hostnamectl set-hostname new-hostname # Edit hosts file …

29 4 weeks, 1 day ago

Re: How to add swap space on Linux

Create swap file # Create 4GB swap file sudo fallocate -l 4G /swapfile # Or using dd sudo dd if=/dev/zero …

12 4 weeks, 1 day ago

Re: PostgreSQL connection refused in Django - solutions

This is usually a configuration issue. Here's how to fix it: Check PostgreSQL is listening # Check PostgreSQL status sudo …

9 4 weeks, 1 day ago