Field-by-field guidance for the CloudLinux Python Selector Create Application page in DirectAdmin. To access: Select the Python version supported by the application and its dependencies. For a new application, Python Enter the application's directory relative to the DirectAdmin user's home directory: This corresponds to the full filesystem path: Do not normally enter the full path in the Application root field. Also avoid placing the application source directly inside A suitable directory layout is: Select the relevant domain and specify the URI at which the application will be published. To publish at the domain root: The application will be available at: To publish below a path: The application will be available at: For a dedicated subdomain, create the subdomain in DirectAdmin first, then select it and use A dedicated subdomain is generally cleaner for framework applications, particularly where the application generates URLs or serves static files. Enter: The file must exist directly in the application root: Passenger loads this file when starting the Python application. Enter: This is the name of the WSGI callable exposed by The field expects the callable name. It does not expect a filename, filesystem path, module path, or function invocation. Do not enter values such as: Enter an absolute path that is writable by the DirectAdmin user: Create the log directory first if necessary: An alternative is to keep the log inside the application directory: Using a dedicated Add only the variables required by the application. Common examples include: Assuming the Django project package is named The environment variable may also be entered in the Python Selector:Applies To:
Important:
Article:
exampleuserexample.com/home/exampleuser/apps/myapphttps://example.com/myappRecommended field values
Field
Value to enter
Python version
Select the version required by the application, commonly Python
3.11 or 3.12 where available.
Application root
apps/myapp
Application URL
Select
example.com, then enter /myapp as the URI.
Application startup file
passenger_wsgi.py
Application entry point
application
Passenger log file
/home/exampleuser/logs/myapp-passenger.logField explanations
Python version
3.11 or 3.12 is usually appropriate where CloudLinux provides it.requirements.txt for compatibility.Application root
apps/myapp/home/exampleuser/apps/myapppublic_html unless the application specifically requires it./home/exampleuser/apps/myapp/
├── passenger_wsgi.py
├── requirements.txt
├── app.py
└── other application filespython311 or python312. A descriptive application name is clearer and avoids potential conflicts.Application URL
Domain: example.com
URI: /https://example.com/Domain: example.com
URI: /myapphttps://example.com/myapp/ as the URI:Domain: app.example.com
URI: /Application startup file
passenger_wsgi.py/home/exampleuser/apps/myapp/passenger_wsgi.pyApplication entry point
applicationpassenger_wsgi.py. For example:from app import app as applicationapp.py
passenger_wsgi.py
application()Passenger log file
/home/exampleuser/logs/myapp-passenger.logmkdir -p ~/logs/home/exampleuser/apps/myapp/passenger.log~/logs directory is usually easier to manage.Environment variables
Variable
Example value
APP_ENVproduction
FLASK_ENVproduction
DJANGO_SETTINGS_MODULEmyproject.settings
SECRET_KEYA long, randomly generated value
DATABASE_URLThe application's database connection string
DEBUGFalsepublic_html. Use application environment variables or another protected configuration mechanism.Flask example
Create Application values
Python version: 3.11
Application root: apps/myapp
Application URL: example.com /myapp
Application startup file: passenger_wsgi.py
Application entry point: application
Passenger log file: /home/exampleuser/logs/myapp-passenger.logapp.py
from flask import Flask
app = Flask(__name__)
@app.get("/")
def index():
return "Flask application is working"passenger_wsgi.py
from app import app as applicationrequirements.txt
FlaskDjango example
Create Application values
Python version: 3.11
Application root: apps/mydjango
Application URL: example.com /
Application startup file: passenger_wsgi.py
Application entry point: application
Passenger log file: /home/exampleuser/logs/mydjango-passenger.logpassenger_wsgi.py
myproject:import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()DJANGO_SETTINGS_MODULE = myproject.settingsAfter creating the application
requirements.txt, where available.
Example assumptions
Do not automatically select the highest available version. Check the application's documentation, development environment, and
Avoid naming the application directory after a Python runtime, such as
Do not store passwords, API keys, or other secrets in files beneath
Restart the application after changing Python source files, dependencies, the startup file, or environment variables so that Passenger reloads the application.