Install Django Cms on Raspberry Pi

There is one thing that needs to be mentioned. Whenever you want to do something following some links on the internet the results are not always as expected. So there needs to be a lot tweaking. Things are not always going according to plan….

I’m going to use raspberry pi 2 B .

1)  A software image needs to be installed, so for this I choose Win32DiskImager. As a software image I will use raspbian-jessie-lite.

fromat-sd-card

After this I used a HDMI cable to connect it to a TV screen, a keyboard and a wireless antenna. You can use as well a Ethernet to connect it to your access point. I’m not implying that this is the easiest way but sometimes the “fastest route” is the one you know best. Also this is just for the initial initial config steps. You can pimp you deployment as much as you want afterwards.

So you need to edit the following file followed by a reboot

root@raspberrypi:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
#country=GB
#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
#update_config=1
network={
ssid=”name of the access point”
psk=”password”
}
root@raspberrypi:~#

2) Ok so this is done. Now we need to do a software update. This is going to take a little bit of time so go and enjoy a coffee or whatever……

apt-get update

apt-get upgrade

3) This is where the actual deployment part starts. The steps above where the prerequisites so to speak. For this I will use the following references:

http://docs.django-cms.org/en/release-3.3.x/introduction/install.html

https://djangocms-installer.readthedocs.io/en/latest/libraries.html

http://infotechmanagefactory.com/en_US/steps-install-django-cms-raspberry-pi/

I proceeded to install the libraries and this is that happened:

library-1-1

 

So I added libjped-dev as well, but still didn’t work

library-2-1

 

Removed libjpeg8-dev and instead added libjpeg62-turbo-dev and it all went fine.

4) Getting closer……

root@raspberrypi:~# cd /home
root@raspberrypi:/home# mkdir workspace

root@raspberrypi:/home# cd workspace/
root@raspberrypi:/home/workspace#

root@raspberrypi:/home/workspace# apt-get install python-pip

root@raspberrypi:/home/workspace# sudo pip install virtualenv

root@raspberrypi:/home/workspace# virtualenv env
New python executable in /home/workspace/env/bin/python
Installing setuptools, pip, wheel…done.

root@raspberrypi:/home/workspace# source env/bin/activate
(env) root@raspberrypi:/home/workspace# pip install djangocms-installer

 

Then stumbled into the following error.

 

error-1

 

After a little bit of googling  I saw a couple of posts where it mentioned that I need to install python2.7-dev
 
So I proceeded to installed the package.

(env) root@raspberrypi:/home/workspace# sudo apt-get install python2.7-dev

Now all you need to do is start the server…..

 

(env) root@raspberrypi:/home/workspace/project# ls -ltr
total 244
-rwxr-xr-x 1 root root    250 Sep 24 21:57 manage.py
drwxr-xr-x 2 root root   4096 Sep 24 21:57 static
drwxr-xr-x 2 root root   4096 Sep 24 21:57 media
drwxr-xr-x 4 root root   4096 Sep 24 21:57 project
-rw-r–r– 1 root root 228352 Sep 24 22:12 project.db
-rw-r–r– 1 root root    417 Sep 24 22:12 requirements.txt
(env) root@raspberrypi:/home/workspace/project# python manage.py runserver 192.168.0.102:80
Performing system checks…

System check identified no issues (0 silenced).
September 25, 2016 – 04:41:37
Django version 1.8.14, using settings ‘project.settings’
Starting development server at http://192.168.0.102:80/
Quit the server with CONTROL-C.

 

Et voila! We have successfully installed django on raspbery pi.

django-cms-1

 

Hope you enjoyed this!

Leave a Reply

Your email address will not be published. Required fields are marked *