Home > OS >  Deploying Django app with GoDaddy domains and cPanel
Deploying Django app with GoDaddy domains and cPanel

Time:12-07

I am trying to deploy my first Django app. I already own the domain using goDaddy domains and I am trying to set up the Django application. I am trying to find the terminal in the Advanced section in cPanel but it is not there. how can I use the terminal?

enter image description here

enter image description here

CodePudding user response:

Step 1: Create python app from setup python app given in cpanel. No need to put anything in any other field, that will be self-filled once you click on create button. Copy the path of virtual env that you got after clicking create button.

Step 2: Upload your django project files inside your python app with all the updated config settings like database, allowed urls, static url, and all other.

Step 3:

if you have terminal: Open the terminal from your cpanel and paste the path of virtual env in the terminal in press enter. Install all your pip dependencies. Run collectstatic, migration and etc.

if you don't have terminal: place all the project-related dependencies in the requirements.txt file and upload that to your python app folder in the file manager. Then go to setup python app option, there you will find configuration file option select requirements.txt by clicking Run pip install button then next to it you will find Execute Python Script, You can use that to execute all your collectstatic, migrate, etc commands.

Step 4: Go back to file manager inside your python app folder and Paste the following line in your passenger_wsgi.py after removing all of its contents.

from <Your django project name>.wsgi import application

Step 5 Get back to setup python app option and click on restart button, and boom. You are done.

  • Related