Skip to content

Instantly share code, notes, and snippets.

@kshepp
Last active February 19, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kshepp/5ed7c6263c73dc4b42fa to your computer and use it in GitHub Desktop.
Save kshepp/5ed7c6263c73dc4b42fa to your computer and use it in GitHub Desktop.
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' %}"
rel="stylesheet" media="screen">
<!--You can add in a navigation bar here if it stays the same across all pages-->
</head>
<div class="container">
{% block content %}
<!--No need to input anything here. This is where the body of your code will go from the other .html pages-->
{% endblock %}
</div>
<footer>
<!--Anything that repeats in your footer goes here-->
</footer>
<!--I input all of my javascript files at the end just in case the javascript doesn't execute then the page will still load-->
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script>
<!--You can insert more javascript files here-->
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment