On Aug 31, 2008, at 4:10 PM, Leaf wrote:

>
> I've recently discovered how incredibly customizable Mac OS 10.5's
> Terminal can be. For example, I created a custom setup that is useful
> for Django developers. Whenever it opens, it automatically starts my
> Django server, and instead of using Ctrl+C to stop the server, I can
> just press End to both shut down the server and exit the window. This
> is how I set it up:
>
> 1. In Terminal prefs, go to "Settings" and hit the plus below the
> settings list.
> 2. Name it "Django Server".
> 3. First, in Text, change all fonts to White and the selection to
> "Spindrift". (This is just for looks.)
> 4. Go to the Window group, and change the title to "Django Dev
> Server". Change the background to "Moss" (again, just for looks).
> 5. Move to Shell. Check "Run Command", type in "python /the/location/
> of/your/manage.py runserver" and check "Run inside shell" if it's not
> already checked. Also, select "Close if the shell exited cleanly" from
> "When the shell exits:".
> 6. Under Keyboard, delete the current entry for end. Add an entry for
> "shift + end", telling it to "scroll to end of buffer" (what the old
> end did). Then, add another entry for "end". Under "Action:" pick
> "Send String to Shell", click the text box, press Ctrl+C, type exit,
> and press Return. Click OK.
>
> Hope this is helpful. It's much easier than running manage.py
> runserver manually.

Nice.

Here's a more generic *nix method:

In .profile or .bashrc:

alias djg="cd ~/Documents/workspace/myproject && source ./env"
alias djr="djg && ./manage.py runserver"

In the env file, I have any environment variables that I need, which  
in this case is only PYTHONPATH.

Then, from any terminal, a simple "djr" gets me running, or a "djg"  
takes me to my project, so I can run any manage.py commands I need.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to