Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Last active November 4, 2020 10:48
Show Gist options
  • Save eclecticmiraclecat/9afafe15a13696136bab7559139f5a6c to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/9afafe15a13696136bab7559139f5a6c to your computer and use it in GitHub Desktop.

python3 manage.py startapp polls

polls/templates/polls/index.html

polls/static/polls/css/style.css polls/static/polls/images/hi.jpg

# views.py
def display(request):
  context = {'name': 'bob'}
  return render(request, 'polls/index.html', context
<!-- index.html -->
{% load static %}

<link rel="stylesheet" type="text/css" href="{% static 'polls/css/style.css' %}">

<img src="{% static 'polls/images/hi.jpeg' %}"
     
{{ name }}     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment