- Edited
Manually migrating a Django app isn't difficult. We'll have most of it automated soon, but the basic steps are:
- Create a Django app here at Opalstack: https://help.opalstack.com/article/61/installing-django
- Create your database here at Opalstack: https://help.opalstack.com/article/51/managing-databases
- Export your database from the old host and import it here (I recommend using the command line method): https://help.opalstack.com/article/82/-exporting-and-importing-postgresql-databases
- Install your app's dependencies into the app's virtualenv: https://help.opalstack.com/article/60/pythonuwsgi-applications#installing-python-dependencies-for-your-project
- Don't forget your database libraries: https://help.opalstack.com/article/68/using-databases-with-django
- Copy your Django project directory (or pull it from your repo) into the app directory and configure uwsgi to use it: https://help.opalstack.com/article/66/serving-your-own-django-project
- Set up your static content: https://help.opalstack.com/article/67/serving-static-content-for-your-django-project
- Hook the Django app and static app up to a site: https://help.opalstack.com/article/52/managing-sites
If you need the app to use Python 2.7 then you can convert the virtualenv over to Python 2.7 by running the following commands before performing step 4 above:
export PATH=$HOME/.local/bin:$PATH
pip2.7 install --user -U pip==20.3.4
pip2.7 install --user virtualenv
cd ~/apps/appname
mv env env.old
virtualenv --python=python2.7 env
source env/bin/activate
pip install uwsgi django
# specify the django version if you need an older version, eg django==X.Y
# older versions need to be installed like this:
# pip install --ignore-installed --no-binary django Django==X.Y
./stop
./start
We will have Python 2.7 installed system-wide for as long is it is available in our OS package repositories. If it's going to be removed, then we'll give you plenty of notice so that you can either upgrade (come on, do it already ) or build your own install of Python 2.7 to keep your app running.