Applies to: This article is kept for customers who still use a legacy cPanel or WHM environment on OneNet Servers. If your service runs on Plesk, PanelAlpha, or CrossBox, use the current guides instead.
This tutorial explains how to use Django framework.
Step One:
- Login to your cPanel account.
- Click on “Setup Python App”
Step Two:
- Select Python version from the drop-down list.
- Specify your application directory.
- Click “setup” button.
Step Three:
- Go to “modules” and click on “Show”.
- Type “Django” and click on it.
- Select the desired Django version.
- Click “Add”.
- Click on “Update” button followed by restart button.
Step Four:
- Edit “.bash_profile”. You can do that from cPanel –> File Manager.
Make sure that “Show Hidden Files (dotfiles)” is selected from File Manager –> Settings. - Add the following line at the bottom and save:
source virtualenv / NN / VV / bin / activate
Where NN is the folder that is created in Step Three, and VV is the version of Python.
Step Five:
- Go back to “Setup Python App”
- Click on “Edit” next to “WSGI file location” and add the wsgi.py path.
ie. python/wsgi.py:application