Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vms:python:django-apache [2018/08/23 00:43]
admin [Install Django]
vms:python:django-apache [2018/08/27 23:52] (current)
admin [Using virtualenvwrapper]
Line 333: Line 333:
 We keep python 2.7 as default to make sure nothing brakes as some packages, commands and utilities are relying on it. But we'll be able to use Python 3 for our Django development. We keep python 2.7 as default to make sure nothing brakes as some packages, commands and utilities are relying on it. But we'll be able to use Python 3 for our Django development.
  
 +==== Python 3.6(.4) ====
 +
 +In case you need to use Python 3.6, here is how to compile it on Debian 9. As this is quite a power hungry process, one might consider allowing sufficient resources to the VM before executing those commands, with an i7-2720QM CPU, a 4 core / 1 GB RAM VM takes about 20 minutes to complete the compilation...
 +
 +<​Code:​bash|As root user>
 +> apt-get update && apt-get upgrade
 +> apt-get install -y make build-essential libssl-dev zlib1g-dev
 +> apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm
 +> apt-get install -y libncurses5-dev ​ libncursesw5-dev xz-utils tk-dev
 +> wget https://​www.python.org/​ftp/​python/​3.6.4/​Python-3.6.4.tgz
 +> tar xvf Python-3.6.4.tgz
 +> cd Python-3.6.4
 +> ./configure --enable-optimizations
 +> make -j8
 +> make altinstall
 +</​Code>​
 +
 +To test that Python 3.6 is well installed and working, enter a Python shell:
 +
 +<​Code>​
 +> python3.6
 +Python 3.6.4 (default, Aug 27 2018, 23:04:48)
 +[GCC 6.3.0 20170516] on linux
 +Type "​help",​ "​copyright",​ "​credits"​ or "​license"​ for more information.
 +>>>​
 +</​Code>​
 +
 +The Python3.6(.4) binary will be located in ''/​usr/​local/​bin/​python3.6''​\\
 +You might want to add it to the available alternatives using the above mentioned method.
 ===== Configure the Python Virtual Environment ===== ===== Configure the Python Virtual Environment =====
  
Line 418: Line 447:
 </​Code>​ </​Code>​
  
 +In case you ever need to **remove** a ''​virtualenv'':​ 
 +<​Code:​bash|As dev user> 
 +> rmvirtualenv <​djangoenv>​ 
 +</​Code>​
 ===== Install Django ===== ===== Install Django =====
  
Line 623: Line 655:
 ===== Selenium, Firefox & Geckodriver ===== ===== Selenium, Firefox & Geckodriver =====
  
-If you plan to use Selenium to scrape websites content, you'll need to install Firefox and Geckodriver.+If you plan to use Selenium ​for functional tests or to scrape websites content, you'll need to install Firefox and Geckodriver.
  
 Though Firefox can be launched in //​headless//​ mode using the ''​-headless''​ option, it still requires the ''​libgtk-3-0''​ and ''​xvfb''​ packages to be installed in order to run, this has been reported in Bugzilla ([[https://​bugzilla.mozilla.org/​show_bug.cgi?​id=1372998]]) but seems unlikely to ever be addressed by the Mozilla community :-( Though Firefox can be launched in //​headless//​ mode using the ''​-headless''​ option, it still requires the ''​libgtk-3-0''​ and ''​xvfb''​ packages to be installed in order to run, this has been reported in Bugzilla ([[https://​bugzilla.mozilla.org/​show_bug.cgi?​id=1372998]]) but seems unlikely to ever be addressed by the Mozilla community :-(