On my server (Centos 7.8), it has 2 lower version oh Python packages (2.7.5 & 3.6.8). In order to get Django to match the course I am taking, I decided to upgrade to newer version. I found 3.8.6 first and 3.9.6 as the latest available so I chose 3.9.6.
First, I used the following commands to configure and compile Python 3.9: "--enable-shared" is needed to create "libpython3.9.so" for mod_wsgi-4.8.0 (or some other apps) to share the library with PIC (Position Independent Code).
Code: Select all
# LD_RUN_PATH=/usr/local/lib ./configure --enable-optimizations --enable-shared
# D_RUN_PATH=/usr/local/lib make altinstall
Code: Select all
# pip3.9 install django
Code: Select all
# django-admin startproject password_generator
I then got SQLite3.36.0 and configured, compiled and installed it but that still didn't work even though the following commands showed correct SQLite version:
Code: Select all
# python3.9
Python 3.9.6 (default, Jul 8 2021, 13:30:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.36.0'
Code: Select all
# C_INCLUDE_PATH=/usr/local/include CPLUS_INCLUDE_PATH=/usr/local/include LD_RUN_PATH=/usr/local/lib ./configure --enable-optimizations
# C_INCLUDE_PATH=/usr/local/include CPLUS_INCLUDE_PATH=/usr/local/include LD_RUN_PATH=/usr/local/lib make
# C_INCLUDE_PATH=/usr/local/include CPLUS_INCLUDE_PATH=/usr/local/include LD_RUN_PATH=/usr/local/lib make install
Code: Select all
$ python3.9 manage.py runserver
Code: Select all
$ python3.9 manage.py runserver 1.2.3.4:1234