(Lifted from .)
On my Debian system, first install Django:
apt-get install python-djangocd to where you want to put your new Django web application, and create a Django project:
django-admin.py startproject djangoHellowhich will cause a subdirectory djangoHello to be created, containing manage.py, settings.py, and urls.py, among other things. Now create an application within that project:
cd djangoHellowhich will create a helloworld subdirectory, containing models.py and views.py. Now edit djangoHello/helloworld/views.py to add the following lines:
python manage.py startapp helloworld
Now edit djangoHello/urls.py, and add the line below after the line above (that will already be in the file):
from django.http import HttpResponse def helloworld(request): return HttpResponse('Hello, World!')
#(r'^admin/(.*)', admin.site.root),Make sure you are in the project root directory (djangoHello) and start the built-in Django server:
python manage.py runserver 0.0.0.0:8000and point your browser at port 8000 (localhost:8000 if browser and Django are on the same machine) and observer your "Hello, World!".
I have been hearing buzz about the "screen" utility for some time, and having tried it, I am now a serious devotee. Wish I had looked at it earlier....
Screen basically gives access and control of multiple terminal sessions in one open SSH session to a server. Ie. instead of using SSH to login to a server from multiple terminals, just use one terminal and invoke "screen" once logged in.
Screen becomes useful with only a very short list of keystrokes:
Ctrl-a c - create a new "screen"
Ctrl-a n - cycle to the next "screen"
Ctrl-a p - cycle to the previous "screen"
Ctrl-a d - detach from screen program, which continues to run in background
Ctrl-a [ - permit scrolling through the terminal's history buffer
Ctrl-c - exit scroll mode and return to command mode
If you only have two or three "screens" open, that is about all you really need.
Killer Feature #1: No More Clobbered SSH Sessions
If you detach from screen and logout, or are forcibly detached by an interrupted SSH session, screen continues to run on the server in the background. That means, for instance, that you can allow a big file transfer to continue on the server without needing an open SSH session. Or, in the case of a network problem resulting in an interrupted SSH session, just log back into the server, and enter:
screen -r -d
to be returned to all your screen session, with all your open terminals, EXACTLY THE WAY YOU LEFT THEM. No more having to navigate back to where you were before. Absolutely indispensable in the crappy excuse for a network we have here in China.
Killer Feature #2: Terminal Sharing!!
Sharing your terminal (both input and output) is simple with screen, as long as both people can SSH into the server and su to the same user:
First one person starts screen, then the other person su's to the same username on the server and attaches to the other screen session as follows:
And now both people are looking at exactly the same screen / terminal session, and both can type into that terminal. Sometimes when the second person tries to attach, there is an error message like the following:
Cannot open your terminal '/dev/pts/3' - please check.
To fix, just chmod the file /dev/pts/3 to make permissions more permissive.