Skip to content

Instantly share code, notes, and snippets.

@jbs1
Last active March 26, 2024 10:04
Show Gist options
  • Save jbs1/33d33316a1636689c75fe926d0991557 to your computer and use it in GitHub Desktop.
Save jbs1/33d33316a1636689c75fe926d0991557 to your computer and use it in GitHub Desktop.
Django on STRATO webhosting server

From STRATO Hosting Basic and up python is enabled on the server. Hosting plans

You can connect to the sever via SSH through ssh <your domain>@ssh.strato.de. The Password is you 'Masterpasswort'.

Since you have neither sudo access nor apt-get or something similar, you have to improvise.

First download and install PIP in the user dir and then install Django:

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
~/.local/bin/pip install django --user

Next you migh have to add the location of the 'sites-packages' folder to the python path. It should be ~/.local/lib/python2.7/site-packages but it might be a different python version on your folder. You need to put this dir into the python path variable. You have to options for that:

  • set pythonpath variable through set PYTHONPATH=${PYTHONPATH}:"~/.local/lib/python2.7/site-packages"
  • add this to the start of your script:
import sys,site
if site.getusersitepackages() not in sys.path:
	print sys.path.append(site.getusersitepackages())

To execute 'django-admin' use this command: ~/.local/bin/django-admin.

To start a new project use ~/.local/bin/django-admin startproject <project name>.

@89Q12
Copy link

89Q12 commented Oct 18, 2020

May I ask how you worked around the problem with wsgi/mod_wsgi ? As you don't have access to apache2 config files or is there something I didn't realize, because fastcgi is deprecated.

@dzahedia
Copy link

I need the samething for flask and I just followed the steps, however, I get this error for library install.
ImportError: ld.so.1: python3.8: libffi.so.6: open failed: No such file or directory

Any idea, how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment