Offset = request_uri.startswith(script_name) and len(environ) or 0Įnviron = request_uri.split('?', 1)Īpplication = PassengerPathInfoFix(application) Script_name = unquote(environ.get('SCRIPT_NAME', '')) Sets PATH_INFO from REQUEST_URI since Passenger doesn't provide it.ĭef _call_(self, environ, start_response): # MIDDLEWARE CLASS TO FIX PASSENGER'S URI ISSUES # (cwd + '/app_one') #You must add your project here # PASSENGER PATH INFO-FIX INITIALISATIONS# MEDIA_ROOT = os.path.join(BASE_DIR, 'media') STATIC_ROOT = os.path.join(BASE_DIR, 'static') #pip install Django=2.1.* # for older sqliteĮdit app_one/settings.py: ALLOWED_HOSTS = Pip install Django # you will need SQLite 3.8.3+ installed from source or system-wide for Django >=2.2, see at the top of the guide Passenger_wsgi.py is what will be called by Passenger module relative to the above directory ( Application startup file)Īpplication is app name defined in passenger_wsgi.py ( Application Entry Point)Įnter shell (cPanel’s Teminal or SSH client) and enter your virtualenv as advised in cPanel then continue with setting up Django: source /home/username/virtualenv/django_approot/3.7/bin/activate & cd /home/username/django_approot These will provide sqlite3 3.8.3+ for Django >=2.2: export LD_LIBRARY_PATH='/opt/atomicorp/atomic/root/usr/lib64/'Įxport PATH=/opt/atomicorp/atomic/root/bin:$PATHĪdd new Python app in cPanel - do not fill in Application startup file and Application Entry Point - it will be done automatically.ĭjango_approot is a directory under your home directory where your app will reside (APPROOT)Ĭhoose a domain to host the app at (you may also append a path to the domain) and Save. This is an update to the older article from here.Įnsure the lines exist above JVMcP section in ~/.bashrc. Published on in Java Python3 Django 3, SQLite 3.8.5 and Pyton 3.7 in cPanelĪs Cloudlinux in cPanel evolves constantly here is the current way of setting up Django 3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |