Skip to content

Instantly share code, notes, and snippets.

View harijay's full-sized avatar

Hari Jayaram harijay

View GitHub Profile
{
"CantoCurses": {
"browser": {
"path": "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome"
},
"color": {
"1": 0,
"10": 9,
"100": 99,
"101": 100,
#!/bin/sh
#Script to install Canto
git clone https://github.com/themoken/canto-next.git
cd canto-next
#sudo $(xcrun --find python3) setup.py install
# This didnt work as the System python3 did not play well with ncurses from homebrew
# and probably wasnt compiled with built in ncurses support
# This uses the compiled Python
/usr/local/bin/python3.8 setup.py install
from django.shortcuts import render
def index(request):
#Get Last five Polls and now use the render shortcut , I like this option less
latest_questions = Question.objects.order_by('-pub_date')[:5]
context = {
'latest_questions':latest_questions,
}
return render(request,"polls/index.html",context)
from django.http import HttpResponse
from django.template import loader
def index(request):
#Get Last five Polls
latest_questions = Question.objects.order_by('-pub_date')[:5]
template = loader.get_template("polls/index.html")
context = {
'latest_questions':latest_questions,