I've successfully got Django installed and running on my raspberry pi.
I am now tempted to create a script for automatically installing the required packages for anyone who wants to install Django themselves.
I have searched online but I haven't found anything like this yet.
Would this be useful for people, especially beginners?
Django on the Raspberry pi
19 posts
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
Yes!
I'd like to try Django on the Raspberry pi.
Looking forward to it.
I'd like to try Django on the Raspberry pi.
Looking forward to it.
- Posts: 9
- Joined: Sat Mar 10, 2012 7:56 am
Definitely interested. I was about to make a start myself but any head start I can get the better! Thank you.
- Posts: 20
- Joined: Wed Jun 06, 2012 9:11 pm
Sorry for the slow reply, with the 4 day weekend we've just had I've been busy relaxing and travelling 
I've written a script that runs awesomely on my linux desktop, just need to get it onto a pi and test it now.
I'll be making it for the Debian release first, as it is the one I'm most familiar with. Should have it ready in a few days!
Blog post and instructions will be included.
I've written a script that runs awesomely on my linux desktop, just need to get it onto a pi and test it now.
I'll be making it for the Debian release first, as it is the one I'm most familiar with. Should have it ready in a few days!
Blog post and instructions will be included.
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
Hey guys. I've successfully created a simple script that will install django on the raspberry pi.
This is aimed at people who are not used to heavy installation and it automates 100% of the process. It also downloads a few extra bits for django and you can add your own packages in requirements.txt if you wish:
The github repo is at:
https://github.com/phalt/DjangoPi
and I had no problems installing git and fetching it on my pi.
I'd really like some feedback on improvements or any bugs you encounter.
Enjoy!
This is aimed at people who are not used to heavy installation and it automates 100% of the process. It also downloads a few extra bits for django and you can add your own packages in requirements.txt if you wish:
The github repo is at:
https://github.com/phalt/DjangoPi
and I had no problems installing git and fetching it on my pi.
I'd really like some feedback on improvements or any bugs you encounter.
Enjoy!
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
Cracking thanks! Ill take a look as soon as ive got the latest firmware and my wireless dongle working again after the previous update killed it.
- Posts: 20
- Joined: Wed Jun 06, 2012 9:11 pm
Thanks for making the script! I recently gave it a go and it seemed to work quite well.
One thing I'm not sure about, that would be helpful to touch on in the documentation, is how to get Django to display your site via apache (rather than simply using the runserver command.)
It appears as though there are some additional steps required.
Also - might it not be better to use sqlite and / or lightpd (or maybe nginx) - as they are a bit more light weight?
Probably your major criteria should be ease of use, if you hope to make it easy for lots of people to setup webservers on their pis. Perhaps that's another reason to use a different webserver.
One thing I'm not sure about, that would be helpful to touch on in the documentation, is how to get Django to display your site via apache (rather than simply using the runserver command.)
It appears as though there are some additional steps required.
Also - might it not be better to use sqlite and / or lightpd (or maybe nginx) - as they are a bit more light weight?
Probably your major criteria should be ease of use, if you hope to make it easy for lots of people to setup webservers on their pis. Perhaps that's another reason to use a different webserver.
- Posts: 10
- Joined: Wed Jun 20, 2012 11:57 am
Also - might it not be better to use sqlite and / or lightpd (or maybe nginx) - as they are a bit more light weight?
Here's the sqlite/nginx version I made for my own benefit:
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=105768#p105768
- Posts: 15
- Joined: Fri Mar 16, 2012 7:46 pm
ceefan wrote:Also - might it not be better to use sqlite and / or lightpd (or maybe nginx) - as they are a bit more light weight?
Here's the sqlite/nginx version I made for my own benefit:
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=105768#p105768
Awesome nice work! I'm currently starting a bigger project related to this, I'll post news about it once I get it up and running, but it will encompass most django setups for raspberry pi.
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
- Posts: 3
- Joined: Mon Jun 25, 2012 10:56 am
Excellent script, works well on standard Squeeze Debian. Mysql seems to work well too. Well done and thanks.
NickT wrote:Excellent script, works well on standard Squeeze Debian. Mysql seems to work well too. Well done and thanks.
Glad it worked well! I added virtualenv support to it earlier this week.
This is also now being incorporated into a larger project - a full stack educational website running on a raspberry pi that teaches you to run a website on a raspberry pi (recursion!)
If you're interested:
https://sponsorcraft.com/p/djangopi
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
Bitnami stacks are not ready to Raspberry Pi.
These stacks are 100% x86-based.
Not compatible with ARM.
I asked that on the forums here
http://answers.bitnami.org/questions/67 ... spberry-pi
These stacks are 100% x86-based.
Not compatible with ARM.
I asked that on the forums here
http://answers.bitnami.org/questions/67 ... spberry-pi
- Posts: 2
- Joined: Sat Aug 18, 2012 8:35 pm
ceefan wrote:Also - might it not be better to use sqlite and / or lightpd (or maybe nginx) - as they are a bit more light weight?
Here's the sqlite/nginx version I made for my own benefit:
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=105768#p105768
I've started to use nginx as well after getting much better performance. Will update to accomodate it.
- Posts: 14
- Joined: Fri Jun 01, 2012 2:47 pm
- Location: Plymouth / Bristol
I just tried this on a fresh Raspbian setup and I get this.
./setup.sh: line 46: ../bin/activate: No such file or directory
Now we're going to install django and any other packages
./setup.sh: line 49: ../bin/pip: No such file or directory
Finally, lets make sure Django is installed properly - this will print the version number if successful
Traceback (most recent call last):
File "djangotest.py", line 1, in <module>
import django
ImportError: No module named django
./setup.sh: line 54: deactivate: command not found
Done!
- Posts: 8
- Joined: Sun Jul 29, 2012 3:43 pm
I his this issue, When i downloaded it I installed unzipped in in /home/pi/djangopi and there is a line in the setup.sh that looks like its looking for it at /djangopi
I changed that path and it seems to have finished the install compleately
I changed that path and it seems to have finished the install compleately
- Posts: 6
- Joined: Wed Sep 05, 2012 9:26 am
My only issue is I ran the script at github, and i not get the Welcome to nginx! page when i goto my IP.
Am i missing a step? how do I get to where I can update/make changes to my server.
Thanks
Matt
Am i missing a step? how do I get to where I can update/make changes to my server.
Thanks
Matt
- Posts: 6
- Joined: Wed Sep 05, 2012 9:26 am
hello,
I am having troubles getting the product to install.
I am running at the following level
root@raspberrypi4:~# uname -a
Linux raspberrypi4 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux
I have these files in my /root directory
root@raspberrypi4:~# ls -al
total 48
drwx------ 6 root root 4096 Mar 7 17:46 .
drwxr-xr-x 25 root root 4096 Mar 7 17:47 ..
-rw------- 1 root root 156 Mar 7 17:14 .bash_history
-rw-r--r-- 1 root root 570 Jan 31 2010 .bashrc
drwx------ 6 root root 4096 Oct 27 20:16 .config
-rwxr-xr-x 1 root root 112 Mar 7 17:44 djangotest.py
drwx------ 2 root root 4096 Mar 7 16:42 .netsurf
-rw-r--r-- 1 root root 140 Nov 19 2007 .profile
drwxr-xr-x 5 root root 4096 Oct 25 14:20 .rpi-firmware
-rwxr-xr-x 1 root root 1586 Mar 7 17:45 setup.sh
drwx------ 4 root root 4096 Oct 24 07:34 .thumbnails
-rw------- 1 root root 2873 Nov 2 21:16 .viminfo
here is what happens when I type ./setup.shroot@raspberrypi4:~# ./setup.sh
Updating all existing packages...
Hit http://mirrordirector.raspbian.org wheezy InRelease
Hit http://archive.raspberrypi.org wheezy InRelease
Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Reading package lists... Done
Installing some essential stuff...
Installing python essentials
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-virtualenv is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Installing nginx server...
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
nginx is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
The --no-site-packages flag is deprecated; it is now the default behavior.
New python executable in ./bin/python
ERROR: The executable ./bin/python is not functioning
ERROR: It thinks sys.prefix is u'/usr' (should be u'/')
ERROR: virtualenv is not compatible with this system or executable
Requirement already satisfied (use --upgrade to upgrade): django-fab-deploy in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
python-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
./setup.sh: line 45: cd: DjangoPi/: No such file or directory
./setup.sh: line 46: ../bin/activate: No such file or directory
Now we're going to install django and any other packages
./setup.sh: line 49: ../bin/pip: No such file or directory
Finally, lets make sure Django is installed properly - this will print the version number if successful
python: can't open file 'djangotest.py': [Errno 2] No such file or directory
./setup.sh: line 54: deactivate: command not found
Done!
Any suggestions would be greatly appreciated.. thanks..
I am having troubles getting the product to install.
I am running at the following level
root@raspberrypi4:~# uname -a
Linux raspberrypi4 3.6.11+ #371 PREEMPT Thu Feb 7 16:31:35 GMT 2013 armv6l GNU/Linux
I have these files in my /root directory
root@raspberrypi4:~# ls -al
total 48
drwx------ 6 root root 4096 Mar 7 17:46 .
drwxr-xr-x 25 root root 4096 Mar 7 17:47 ..
-rw------- 1 root root 156 Mar 7 17:14 .bash_history
-rw-r--r-- 1 root root 570 Jan 31 2010 .bashrc
drwx------ 6 root root 4096 Oct 27 20:16 .config
-rwxr-xr-x 1 root root 112 Mar 7 17:44 djangotest.py
drwx------ 2 root root 4096 Mar 7 16:42 .netsurf
-rw-r--r-- 1 root root 140 Nov 19 2007 .profile
drwxr-xr-x 5 root root 4096 Oct 25 14:20 .rpi-firmware
-rwxr-xr-x 1 root root 1586 Mar 7 17:45 setup.sh
drwx------ 4 root root 4096 Oct 24 07:34 .thumbnails
-rw------- 1 root root 2873 Nov 2 21:16 .viminfo
here is what happens when I type ./setup.shroot@raspberrypi4:~# ./setup.sh
Updating all existing packages...
Hit http://mirrordirector.raspbian.org wheezy InRelease
Hit http://archive.raspberrypi.org wheezy InRelease
Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages
Hit http://archive.raspberrypi.org wheezy/main armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages
Ign http://archive.raspberrypi.org wheezy/main Translation-en_GB
Ign http://archive.raspberrypi.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Reading package lists... Done
Installing some essential stuff...
Installing python essentials
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-virtualenv is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Installing nginx server...
Reading package lists... Done
Building dependency tree
Reading state information... Done
openssh-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Reading package lists... Done
Building dependency tree
Reading state information... Done
nginx is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
The --no-site-packages flag is deprecated; it is now the default behavior.
New python executable in ./bin/python
ERROR: The executable ./bin/python is not functioning
ERROR: It thinks sys.prefix is u'/usr' (should be u'/')
ERROR: virtualenv is not compatible with this system or executable
Requirement already satisfied (use --upgrade to upgrade): django-fab-deploy in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
python-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
./setup.sh: line 45: cd: DjangoPi/: No such file or directory
./setup.sh: line 46: ../bin/activate: No such file or directory
Now we're going to install django and any other packages
./setup.sh: line 49: ../bin/pip: No such file or directory
Finally, lets make sure Django is installed properly - this will print the version number if successful
python: can't open file 'djangotest.py': [Errno 2] No such file or directory
./setup.sh: line 54: deactivate: command not found
Done!
Any suggestions would be greatly appreciated.. thanks..
- Posts: 85
- Joined: Wed Jun 27, 2012 6:28 pm
I have exactly the same problem. I tried to run ./install.sh under root.
- Code: Select all
0 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
./setup.sh: line 45: cd: DjangoPi/: No such file or directory
./setup.sh: line 46: ../bin/activate: No such file or directory
Now we're going to install django and any other packages
./setup.sh: line 49: ../bin/pip: No such file or directory
Finally, lets make sure Django is installed properly - this will print the version number if successful
python: can't open file 'djangotest.py': [Errno 2] No such file or directory
./setup.sh: line 54: deactivate: command not found
Done!
- Posts: 1
- Joined: Sat Feb 09, 2013 8:33 am