Skip to content

Instantly share code, notes, and snippets.

@manuganji
Forked from unbracketed/gist:228457
Last active June 27, 2018 10:07
Show Gist options
  • Select an option

  • Save manuganji/9069466 to your computer and use it in GitHub Desktop.

Select an option

Save manuganji/9069466 to your computer and use it in GitHub Desktop.

Revisions

  1. manuganji revised this gist Mar 9, 2014. 2 changed files with 3 additions and 1 deletion.
    1 change: 1 addition & 0 deletions postactivate
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,7 @@ alias djs='dj shell'
    alias djt='dj test'
    alias djm='dj migrate'
    alias djsm='dj startmigration'
    alias cvt='coverage run --source=. manage_freebase.py test .'

    #For more ideas/inspiration on managing settings across environments see:
    #http://github.com/tarequeh/django-config
    3 changes: 2 additions & 1 deletion postdeactivate
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,5 @@ unalias djdb
    unalias djs
    unalias djt
    unalias djm
    unalias djsm
    unalias djsm
    unalias cvt
  2. manuganji revised this gist Feb 18, 2014. 3 changed files with 34 additions and 29 deletions.
    29 changes: 0 additions & 29 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,29 +0,0 @@
    #I usually drop something like this into my virtualenv's postactivate for some
    #quick and handy shortcuts to common Django commands.
    #This way dropping in to do some work on any arbitrary project is as easy as:
    # 1. workon <project name>
    # 2. djr

    cd /path/to/site/root

    #Django command shortcuts
    alias dj='python manage.py'
    alias djr='dj runserver'
    alias djrp='dj runserver_plus'
    alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'
    alias djt='dj test'
    alias djm='dj migrate'
    alias djsm='dj startmigration'

    #A common convention for those who aren't keen on the local_settings approach to Django
    #settings overrides often use variations on the play of naming local overrides files
    #the same as the machine's hostname. Point Django to the correct one here:

    export SERVER_IDENTIFIER=hostname

    #For more ideas/inspiration on managing settings across environments see:
    #http://github.com/tarequeh/django-config


    23 changes: 23 additions & 0 deletions postactivate
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/bash
    # This hook is run after this virtualenv is activated.
    # Place this file at $VIRTUAL_ENV/bin

    # I usually drop something like this into my virtualenv's postactivate for some
    # quick and handy shortcuts to common Django commands.
    # This way dropping in to do some work on any arbitrary project is as easy as:
    # 1. workon <project name>
    # 2. djr

    #Django command shortcuts
    alias dj='python manage.py' # or some other file like manage_custom.py
    alias djr='dj runserver'
    alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djt='dj test'
    alias djm='dj migrate'
    alias djsm='dj startmigration'

    #For more ideas/inspiration on managing settings across environments see:
    #http://github.com/tarequeh/django-config


    11 changes: 11 additions & 0 deletions postdeactivate
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #!/bin/bash
    # This hook is run after this virtualenv is deactivated.

    # unset all aliases to leave things clean after you deactivate
    unalias dj
    unalias djr
    unalias djdb
    unalias djs
    unalias djt
    unalias djm
    unalias djsm
  3. unbracketed revised this gist Nov 8, 2009. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'
    alias djt='dj test'
    alias djm='dj migrate'
    alias djsm='dj startmigration'

    #A common convention for those who aren't keen on the local_settings approach to Django
  4. unbracketed revised this gist Nov 8, 2009. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'
    alias djt='dj test'
    alias djsm='dj startmigration'

    #A common convention for those who aren't keen on the local_settings approach to Django
    #settings overrides often use variations on the play of naming local overrides files
  5. unbracketed revised this gist Nov 7, 2009. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,10 @@ alias djt='dj test'
    #A common convention for those who aren't keen on the local_settings approach to Django
    #settings overrides often use variations on the play of naming local overrides files
    #the same as the machine's hostname. Point Django to the correct one here:

    export SERVER_IDENTIFIER=hostname

    #For more ideas/inspiration on managing settings across environments see:
    #http://github.com/tarequeh/django-config


  6. unbracketed revised this gist Nov 7, 2009. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,21 @@
    # 1. workon <project name>
    # 2. djr

    cd /path/to/site/root

    #cd /path/to/site/root
    #Django command shortcuts
    alias dj='python manage.py'
    alias djr='dj runserver'
    alias djrp='dj runserver_plus'
    alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'
    alias djt='dj test'
    alias djt='dj test'

    #A common convention for those who aren't keen on the local_settings approach to Django
    #settings overrides often use variations on the play of naming local overrides files
    #the same as the machine's hostname. Point Django to the correct one here:
    export SERVER_IDENTIFIER=hostname



  7. unbracketed revised this gist Nov 7, 2009. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -11,4 +11,5 @@ alias djr='dj runserver'
    alias djrp='dj runserver_plus'
    alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'
    alias djsp='dj shell_plus'
    alias djt='dj test'
  8. unbracketed revised this gist Nov 7, 2009. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    #I usually drop something like this into my virtualenv's postactivate for some
    #quick and handy shortcuts to common Django commands.
    #This way dropping in to do some work on any arbitrary project is as easy as:
    # 1. workon <project name>
    # 2. djr


    #cd /path/to/site/root
    alias dj='python manage.py'
    alias djr='dj runserver'
    alias djrp='dj runserver_plus'
  9. unbracketed created this gist Nov 7, 2009.
    8 changes: 8 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #I usually drop something like this into my virtualenv's postactivate for some
    #quick and handy shortcuts to common Django commands.
    alias dj='python manage.py'
    alias djr='dj runserver'
    alias djrp='dj runserver_plus'
    alias djdb='dj dbshell'
    alias djs='dj shell'
    alias djsp='dj shell_plus'