Skip to content

Instantly share code, notes, and snippets.

View joaodubas's full-sized avatar
🤓
always learning

Joao P Dubas joaodubas

🤓
always learning
View GitHub Profile
@joaodubas
joaodubas / tmux.md
Created October 19, 2012 10:40 — forked from avelino/tmux.md
tmux cheat sheet

tmux - terminal multiplexer

Managing tmux sessions:

$ tmux      # start tmux server
$ tmux at   # attach running sessions to a terminal
$ tmux ls   # list running tmux sessions

Sharing sessions between terminals:

$ tmux new -s session_name # make new named session

$ tmux at -t session_name # attach to exist session (allowing shared sessions)

@joaodubas
joaodubas / route.py
Created November 8, 2011 18:44 — forked from henriquebastos/route.py
Route is a better urls function, consider all Http verbs, and return 405 (NotAllowed) with the list of proper methods
# -*- encoding: utf-8 -*-
# Usage:
# urlpatterns += patterns('',
# route(r'^$', GET='getview', POST='postview', PUT='putview', DELETE='deleteview', name='viewname'),
# )
#
from django.http import HttpResponseNotAllowed
from django.core.urlresolvers import RegexURLPattern, get_callable
def discover_view(view, prefix=''):
from django import forms
from models import Pais
class MyForm(forms.Form):
pais = forms.ModelChoiceField(queryset = Pais.objects.all())
def __init__(self, *args, **kwargs):
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._