Logo

dev-resources.site

for different kinds of informations.

How to deploy django app on cpanel

Published at
12/13/2023
Categories
programming
cpanel
django
Author
jmegnidro
Categories
3 categories in total
programming
open
cpanel
open
django
open
Author
9 person written this
jmegnidro
open
How to deploy django app on cpanel

Image description

Deploying a Django Application on Cpanel | Beginner's Guide

Cpanel has become, in the vast world of hosting platforms, one of the widely used solutions by companies to deploy web application solutions. Notable providers include o2switch, Hostinger, LWS, and many others that you can find on the internet. However, it is often observed that Cpanel is particularly optimized for Content Management Systems (CMS) such as WordPress, Joomla, Drupal, and many others.

The task may appear challenging, especially for those who engage in programming from scratch. Despite the plethora of online assistance sites, I personally struggled for over six months to deploy a simple site that performed basic CRUD operations (Create, Read, Update, and Delete) on Cpanel with Django. I assure you, it can be a real frustration, especially when people expect results from you.

Today, I unveil the process for any beginner who does not want to use expensive web hosting solutions for their portfolio, blog, or small e-commerce site by adopting this solution.

What is Cpanel?
Cpanel is a common dashboard for managing web servers. It is highly popular among shared hosting providers. Without Cpanel, technical skills would be necessary for the configuration. However, not all hosting providers use Cpanel.

Configuration
Firstly, to initiate the deployment, you must have your project ready with basic configurations in the settings.py file.

You need to configure the settings for static files.

Image description

urls.py file Configuration

Image description

Pay close attention to the re_path; these are the two paths that will allow you to access the images stored in the database.

Here are the two important configurations you need to make. Ensure that you have created your .environ file to protect your secret keys and to avoid any potential attacks by hackers.

After this step, make sure you have your requirements.txt file.

Next step: Importation of your zip file.

Image description

After this step, move on to your Cpanel dashboard.
• Create your application.

Image description
Image description

• Install the dependencies in the requirements.txt file.

For security reasons, I won't be able to set up the virtual environment.

• Configure the settings.py file for production.

Image description
Image description

passenger_wsgi.py configuration

Image description
You must install the "whitenoise" library to enable your CSS styles to function on the site.

After these steps, the last step is to restart the server or, at least, the application. Once these steps are completed,
Congratulations, we have successfully deployed our site on Cpanel.

You can check your site in the Google search bar, and you're all set.

In conclusion, deploying on cPanel provides a user-friendly and accessible approach to managing your web hosting server. With its intuitive graphical interface, you can efficiently carry out deployments, even without in-depth technical expertise. However, it is always essential to follow security best practices and consider the specific requirements of your project when deploying on cPanel. By leveraging this platform, you simplify the management process and provide an optimal experience for your end users.

Thank you for reading, and see you soon for a new article.

cpanel Article's
30 articles in total
Favicon
Run NextJS App in shared-hosting cPanel domain!
Favicon
How to deploy laravel project on cpanel or shared hosting
Favicon
Host Nextjs 14 Application on cPanel
Favicon
VPS vs. Shared Hosting: Understanding the Key Differences
Favicon
How I Deployed Next.js to cPanel on Shared Hosting
Favicon
Error yang sering di jumpai ketika Setup NodeJS App pada cPanel.
Favicon
Deploy NextJs to cPanel
Favicon
Deploy Laravel to cPanel v.2
Favicon
Need Help! php server
Favicon
cPanel Hosting vs NGINX Hosting: A Comparison for Linux Hosting
Favicon
How to Import MBOX to cPanel?
Favicon
next js app on cPanel
Favicon
Deploy Laravel to cPanel v.1
Favicon
Deploy Frontend Web Application with React to cPanel.
Favicon
Deploy Backend API with Express Js to cPanel
Favicon
Web Hosting on cPanel WHM - What and How of cPanel and cPanel Terminal Commands- A Beginner Guide
Favicon
How to create a Node.js web server with cPanel
Favicon
How to install Node on cPanel shared hosting (without root access)
Favicon
The best FREE hosting control panel & alternative to CPanel: CyberPanel!
Favicon
Unlocking Economical Potential: Low-Cost cPanel Hosting Options
Favicon
cPanel UAPI Operations for Creating Subdomains, MySQL Databases, and File Operations
Favicon
My webhosting business journey
Favicon
How to Migrate Email from G Suite to cPanel?
Favicon
Steps To Remove/Delete Domain Name from cPanel?
Favicon
Resolving cPanel Git Error Code 128: ‘Permission Denied’ Issue
Favicon
How to Deploy your Django Web App and connect a MySQL Database in cPanel
Favicon
Plesk vs. cPanel: A Comprehensive Comparison
Favicon
How to deploy django app on cpanel
Favicon
Simple Guide to Deploying Your Vite React App on Cpanel for Beginners
Favicon
How To Set Up Auto Deploy For Laravel Applications On Cpanel

Featured ones: