Skip to content

Instantly share code, notes, and snippets.

@sunweiye
Forked from jbs1/django_on_strato.md
Created June 18, 2020 13:08
Show Gist options
  • Select an option

  • Save sunweiye/a68685dfa78dbdc774904d97f9a9e0a5 to your computer and use it in GitHub Desktop.

Select an option

Save sunweiye/a68685dfa78dbdc774904d97f9a9e0a5 to your computer and use it in GitHub Desktop.

Revisions

  1. @jbs1 jbs1 revised this gist Sep 7, 2018. 1 changed file with 10 additions and 4 deletions.
    14 changes: 10 additions & 4 deletions django_on_strato.md
    Original file line number Diff line number Diff line change
    @@ -12,12 +12,18 @@ python get-pip.py --user
    ~/.local/bin/pip install django --user
    ```

    Next check the location of the 'sites-packages' folder. 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:
    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())
    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>`.



  2. @jbs1 jbs1 revised this gist Sep 7, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions django_on_strato.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ Next check the location of the 'sites-packages' folder. It should be `~/.local/l
    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:
    * ```
    if site.getusersitepackages() not in sys.path:
    print sys.path.append(site.getusersitepackages())
    ```
    ```
    if site.getusersitepackages() not in sys.path:
    print sys.path.append(site.getusersitepackages())
    ```
  3. @jbs1 jbs1 revised this gist Sep 7, 2018. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion django_on_strato.md
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,15 @@ 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
    ~/.local/bin/pip install django --user
    ```

    Next check the location of the 'sites-packages' folder. 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:
    * ```
    if site.getusersitepackages() not in sys.path:
    print sys.path.append(site.getusersitepackages())
    ```
  4. @jbs1 jbs1 revised this gist Sep 7, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion django_on_strato.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    From STRATO Hosting Basic and up python is enabled on the server. [https://www.strato.de/hosting/#features](Hosting plans)
    From STRATO Hosting Basic and up python is enabled on the server. [Hosting plans](https://www.strato.de/hosting/#features)

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

  5. @jbs1 jbs1 created this gist Sep 7, 2018.
    14 changes: 14 additions & 0 deletions django_on_strato.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    From STRATO Hosting Basic and up python is enabled on the server. [https://www.strato.de/hosting/#features](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
    ```