How to install Django framework on synology  

  RSS

(@zerobase1)
Member Admin
Joined: 3 years  ago
Posts: 18
27/12/2017 5:11 pm  

precondition: python 2.7 or python 3.5 was already installed

#######################################################################

## python version: python 2.7,  os: synology ds916+ DSM

1. install get-pip.py, you may download at https://bootstrap.pypa.io with wget utility as below

# wget https://bootstrap.pypa.io/get-pip.py

2. run downloaded file, get-pip.py

# python get-pip.py

3. verify pip version

# pip -V

4. install django

# pip install django

when we try to run command above, but, we meet error message and that is as such

"Command "python setup.py egg_info' failed with error code 1 in /tmp/pip-build-A40J24/django/"

so, we try to run command 'pip install django==1.7, that is, we give a hint to pip "install django version 1.7".

again,

# pip install django==1.7

Successfully installed django-1.7

5. create first project based on django framework.

# mkdir DjangoProject

# cd DjangoProject

# mkdir django17_test

#cd django17_test

~/DjangoProject/django17_test# django-admin startproject mytestsite

# cd mytestsite

~/DjangoProject/django17_test/mytestsite# python manage.py runserver 

6. check web site http://127.0.0.1:8000

here, you should welcome default html page created by django framework.

#######################################################################

#######################################################################

## python version: python 3.5,  os: synology ds916+ DSM

1. install get-pip.py, you may download at https://bootstrap.pypa.io with wget utility as below

# wget https://bootstrap.pypa.io/get-pip.py

2. run downloaded file, get-pip.py

# python3 get-pip.py

3. verify pip version

# python3 -m pip -V

4. install django

# python3 -m pip install django

Successfully installed django-2.0

5. create first project based on django framework.

# mkdir DjangoProject

# cd DjangoProject

~/DjangoProject# django-admin startproject mytestsite20

# cd mytestsite20

~/DjangoProject/mytestsite20# python3 manage.py runserver 

6. check web site http://127.0.0.1:8000

here, you should welcome default html page created by django framework.

caution: If you wish to run django framework project on multiple python environment, you had better use virtual environment.

Also, as both project, one is project with django 1.7, the other is that with django 2.0 is slightly different, you should manage two projects at each other folder.


ReplyQuote
(@zerobase1)
Member Admin
Joined: 3 years  ago
Posts: 18
01/11/2018 10:30 am  

I came across 'Unable to establish SSL connection' error when ran wget to get-pip.py file on window environment.

So, I check the version of wget.exe and it's 1.11.4, which is out of date.

After googling in terms with 'Unable to establish SSL connection wget', I downloaded latest version wget 1.19.4 at  https://eternallybored.org/misc/wget/

https://eternallybored.org/misc/wget/releases/wget-1.19.4-win32.zip

It's Ok. 

This post was modified 2 years  ago 4 times by junkyu

ReplyQuote
Share: