How to deploy a Django Application and set your Python Environment
How to deploy a Django web application on Mochahost.com.
NOTE: This article applies for Linux Shared (Business + Mocha packages ONLY).Step-By-Step:
1. Login to Cpanel and in Software/Services area choose Setup Python App.
2. Setup new application form will appear. Choose Python
version for your application, application folder name (App
Directory) and App URI for accessing your application. Click Setup to create an application.
- After a little while a new application entry will be appended to
3. 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.
4. Wsgi entry is to specify python wsgi application entry point.
It must be specified as filename, must be callable and separated
by colon. If your app is running from file flask/run.py by calling
callable app, set flask/run.py:app.
- When Show control is clicked, python extensions section will be
expanded. It gives the ability to Add or Remove python modules.
- When start typing in input field, appropriate hints are shown in
- Choose the entry you want from drop-down and click
- If you click Delete, the corresponding module entry will
PS. In addition to setting path, uri and wsgi, the Python version can be changed as well by changing the value in select drop-down.
5. No changes are applied to application environment until Update
button is clicked. Before the Update button is clicked, all
changes can be reverted with Reset button.
- The newly created application will be supplied with stub only. A
real application ought to be put into application folder. After
application is placed into application folder, the wsgi parameter
can be set.
- Click Remove to delete the application - the application folder
itself will remain unmoved.