Skip to content

Instantly share code, notes, and snippets.

{
"user": {
"name": "John Dough",
"age": 42,
"friends": [
{"name": "Jane Doe"},
{"name": "Bill Green"}
]
}
}
{
user(id: 1) {
name
age
friends {
name
}
}
}
{
"user": {
"name": "John Dough",
"age": 42,
"city": "Tokyo"
}
}
{
user(id: 1) {
name
age
city
}
}
{
user(id: 1) {
name
age
}
}
<ul class="bxslider">
{% for medium in media %}
<div class="item {% if forloop.first %} active {% endif %}">
{% if medium.mediaType == 'video' %}
<li>
<iframe width="640" height="360" src="{{medium.mediaLink}}" frameborder="0" allowfullscreen>
</iframe>
</li>
<a href="{% url 'index' %}">This is my index page!</a>
<img id="teal" src="{% static 'img/teal_circle.png' %}" alt="teal circle">
@kshepp
kshepp / Extend_files.html
Created February 19, 2016 14:58
Extending files in Django
{% extends "NAME_OF_YOUR_PROJECT/base.html" %}
{% load static %}
{% block content %}
<!--Insert all of the page specific content here-->
{% endblock %}
@kshepp
kshepp / Simplified_base.html
Last active February 19, 2016 14:55
This is a simplified version of a base.html file in Django
{% load staticfiles %}
<!--Load static files will bring in all the css, images, and js files-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--This is where you can input all the css files. The files are in Django format and following the path from the 'static' file -->
<link href="{% static 'bootstrap/css/bootstrap-theme.css' %}"