In the article, you can learn about the complete installation of a Django project.
You need to follow these steps carefully:
Step # 1: Log in to cPanel.
Step # 2: In Software/Services area choose Select Python Environment option.
Step # 3: Create a project form will appear. Choose the interpreter version for your application, the application folder name (project path), and URI for accessing your application. Click “Create project” to create an application.
After a little while, a new application entry will be appended to the web page.
Step # 4: You can edit path (folder name in homedir, for example /home/clman1), uri for application, wsgi handler. If you click Edit – the value is converted to input field and thus becomes editable. When editing is complete, click Save.
Step # 5: Wsgi entry is to specify python wsgi application entry point. It must be specified as a filename, must be callable, and separated by a colon. If your app is running from file flask/run.py by calling callable app, set flask/run.py:app.
Step # 6: When Show control is clicked, the python extensions section will be expanded. It gives the ability to add or remove python modules. When start typing in the input field, appropriate hints are shown in the drop-down list. Choose the entry you want from the drop-down and click Add.
If you click Delete, the corresponding module entry will disappear.
In addition to setting path, uri and wsgi, the interpreter version can be changed as well by changing the value in the select drop-down.
Step # 7: No changes are applied to the application environment until the Update button is clicked. Before the Update button is clicked, all changes can be reverted with the Reset button.
The newly created application will be supplied with a stub only. A real application ought to be put into the application folder. After the application is placed into the application folder, the wsgi parameter can be set.
Click Remove to delete the application – the application folder itself will remain unmoved.
Note. For LVE Manager version 0.9-10 and higher:
When creating an application you can use the key –domain, which attaches the application to the domain. If the –domain key is not specified, then the main user’s domain will be used by default.
To create an application run:
/usr/bin/selectorctl --interpreter=<python|ruby> --version=VERSION [--user=USER] [--domain=DOMAIN] [--print-summary] [--json] –-create-webapp <FOLDER_NAME> <URI>
When changing the application URI, –domain key can be used simultaneously, in this case not only URI will be changed, but also the application domain.
To change the application URI run:
/usr/bin/selectorctl --interpreter=<python|ruby> [--user=USER] [--domain=NEW_DOMAIN] [--print-summary] [--json] --transit-webapp <FOLDER_NAME> <NEW_URI>
The possibility to choose a domain when creating an application was added to the web interface as well.
Also, you can run simple commands from the web interface (e.g. you can install packages from specific repositories or control web applications by means of django-admin).