Setting up a Python application on your cPanel shared hosting through Domain India is straightforward. Follow this step-by-step guide to get your Python application up and running.
Step 1: Log in to Your cPanel Account
Visit www.domainindia.com and log in to your cPanel account using your credentials.
Step 2: Locate the “Software” Section
Once logged in, navigate to the “Software” section in your cPanel dashboard.
Step 3: Choose “Setup Python App”
In the “Software” section, find and click on “Setup Python App” to proceed.
Step 4: Create a New Python Application
Click “Create Application” to start setting up your Python application. Here, you will be prompted to enter the following details:
- Python version: Select the desired Python version.
- Application root: Specify the physical address on the server where your application files will be stored. For instance,
/home/user_name/public_html/your_app_name
. - Application URL: Set up the HTTP/HTTPS link to your application, such as
https://yourdomain.com/your_app_name
. - Application startup file: Typically
wsgi.py
. - Application entry point: Commonly designated as
app
. - Passenger log file: Designate a path for the log file, e.g.,
/home/user_name/logs/passenger.log
.
Step 5: Install Necessary Python Packages
Create a requirements.txt
file listing all the Python packages required for your application. In your application root directory, use the “Run Pip Install” function to specify the file path and install the packages.
Step 6: Upload Your Application Files
Using the cPanel file manager or an FTP client, upload your Python application files to the directory mentioned in the “Application root” field.
Step 7: Set Up a Database (If Necessary)
If your application demands a database, configure it via the cPanel dashboard, recording the database credentials to later set up your application.
Step 8: Configure Your Application
In the configuration files section, input any requisite scripts or commands to establish your environment and initiate necessary Python scripts.
Step 9: Verify Your Setup
Once set up, utilize the “Run Script” option to execute the Python script and initiate your application. Ensure to verify the output for any errors and correct them as needed.
Step 10: Launch Your Application
Access the predetermined application URL to launch your Python application successfully.
Step 11: Debugging Common Errors
Should you encounter errors, refer to the Passenger log file (e.g., /home/user_name/logs/passenger.log
) to find detailed error reports. For common issues:
- File Not Found Error: Verify the file paths and names are correctly specified.
- Permission Issues: Check the file permissions and amend them if necessary using commands such as
chmod
. - Dependency Errors: Ensure all dependencies in the
requirements.txt
file are correctly installed.
Step 12: Consult the Knowledge Base for Troubleshooting
For additional support, visit Domain India’s comprehensive knowledge base or contact customer support for tailored assistance.