Create Apache Configuration for Your Django wsgi Project
bmpokhrel9 | May 25, 2025

Create a new Apache config file:
sudo nano /etc/apache2/sites-available/yourproject.conf
Example configuration:
<VirtualHost *:80>
ServerName yourdomain.com
ServerAdmin [email protected]
Alias /static /path/to/your/project/static
<Directory /path/to/your/project/static>
Require all granted
</Directory>
<Directory /path/to/your/project/yourproject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
WSGIDaemonProcess yourproject python-path=/path/to/your/project python-home=/path/to/your/project/venv
WSGIProcessGroup yourproject
WSGIScriptAlias / /path/to/your/project/yourproject/wsgi.py
</VirtualHost>
Replace /path/to/your/project
with the absolute path to your Django project folder.
Enable Your Site and Restart Apache
sudo a2ensite yourproject.conf
sudo a2dissite 000-default.conf # Optional: disable default site
sudo systemctl restart apache2
1 COMMENTS:
if you have any problem comment here
Create Apache Configuration for Your Django wsgi Project
Create a new Apache config file:sudo nano /etc/apache2/sites-available/yourproject.conf Examp
Read MoreHow to Create a Django App – Step by Step Guide
How to Create a Django App – Step by Step Guide Django is a powerful and popular Python-b
Read MoreUnderstanding Python Files in a Django App – Full Guide for Beginners
Understanding Python Files in a Django App – Full Guide for BeginnersDjango is a high-level Python w
Read MoreUnderstanding Django Settings: The Backbone of Your Web App Configuration
Understanding Django Settings: The Backbone of Your Web App Configuration When you'
Read MoreHow to Use Django collectstatic the Right Way
🚀 How to Use Django collectstatic the Right WayWhen deploying a Django project to produc
Read More