Upgrading to OppiaMobile Server v0.12.0
OppiaMobile v0.12.0 has moved to using Python 3 and Django 2, so you will need
to update the versions of Python and Django that you are using. The migration
steps are described below, running the commands from the root of your
OppiaMobile server installation (eg /home/oppia/
).
Update Virtual Environment
Remove the existing virtualenv:
$ sudo rm -R env
Create a new virtualenv:
$ virtualenv -p /usr/bin/python3 env
Activate the new virtualenv:
$ source env/bin/activate
Note
If you get an error at step 2 (eg virtualenv is not compatible with this
system or executable
), you may need to update virtualenv first (with pip
install --upgrade virtualenv
)
Update MySQL connectors
The MySQL connector libraries in Python 3 have been changed:
Run:
$ sudo apt-get install python3-mysqldb python3-dev libpython3-dev
Run:
(env)$ pip install mysqlclient
Update Pillow dependencies
The new version of Oppia uses an updated version of Pillow, so you may need to update the Pillow dependencies to ensure the new version installs correctly:
Run:
$ sudo apt-get install libjpeg-dev zlib1g-dev
Add required Oppia packages
Since we have removed the old virtualenv, we need to re-install, and at the same time, update the required packages:
Run:
(env)$ pip install -r ../django-oppia/requirements.txt
Update database
Run:
(env)$ python manage.py migrate
Note
If you get a message about stale .pyc files, then run find . -name "*.pyc"
-type f -delete
. But use this carefully and make sure you only run it from
the django-oppia directory.
Update static files
Run:
(env)$ python manage.py compilescss
- don’t worry about the unclosed files warning messagesRun:
(env)$ python manage.py collectstatic
For live servers using mod_wsgi on Apache webserver
If you are using Apache as the webserver, then you will need to update the version of mod_wsgi:
Run
sudo apt-get install libapache2-mod-wsgi-py3
Also update the path in the apache config file to the python site packages