Install / host Django in Cpanel [Shared Hosting]

Published: 16 February 2023
on channel: Coders Gateway - Web Tech solutions
1,205
8

Cpanel + Django+ passenger file
Install
Django project installation in Cpanel
=====================================

cd myproject/
source /home/myuser/virtualenv/dpms/3.5/bin/activate
django-admin startproject dpms .
pip install django
django-admin startproject dpms .

mkdir assets
mkdir media
mkdir static

chmod 777 ./assets
chmod 777 ./media
chmod 777 ./static
chmod 755 ./manage.py

settings.py
-----------------
import os

ALLOWED_HOSTS = ['*']
or
ALLOWED_HOSTS = ['www.yourdomainURL']


STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "assets"),
]

==================================================


./manage.py collectstatic

python manage.py migrate
python manage.py createsuperuser

Username: adminuser
Password: admin123

passenger file - passenger_wsgi.py
---------------------------
from mydjango.wsgi import application

======================================
Restart django project


Watch video Install / host Django in Cpanel [Shared Hosting] online without registration, duration hours minute second in high quality. This video was added by user Coders Gateway - Web Tech solutions 16 February 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,205 once and liked it 8 people.