This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base/theme.html" %} | |
{% load widget_tweaks %} | |
{% block main_content %} | |
<div class="header-buffer"> | |
</div> | |
<section id="services"> | |
<div class="container"> | |
<div class="row"> | |
{% if form %} | |
<div class="col-md-12"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
def hello_world(request): | |
return HttpResponse('Hello World') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
# Create your models here. | |
class Course(models.Model): | |
created_at = models.DateTimeField(auto_now_add=True) | |
title = models.CharField(max_length=255) | |
description = models.TextField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>{% block title %}{% endblock %}</title> | |
</head> | |
<body>{% block content %}{% endblock %}</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout.html" %} | |
{% block title %}{{ course.title }}{% endblock %} | |
{% block content %} | |
<article> | |
<h2>{{ course.title }}</h2> | |
{{ course.description }} | |
<section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout.html" %} | |
{% block title %}{{ step.title }} - {{ step.course.title }}{% endblock %} | |
{% block content %} | |
<article> | |
<h2>{{ step.course.title }}</h2> | |
<h3>{{ step.title }}</h3> | |
{{ step.content|linebreaks }} | |
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layout.html" %} | |
{% block title %}Available Courses{% endblock %} | |
{% block content %} | |
<div class="cards"> | |
{% for course in courses %} | |
<div class="card"> | |
<header><a href="{% url 'detail' pk=course.pk %}">{{ course.title }}</a></header> | |
<div class="card-copy"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from django.utils import timezone | |
from .models import Course | |
# Create your tests here. | |
class CourseModelTests(TestCase): | |
def test_course_creation(self): | |
course = Course.objects.create( | |
title="Python Regular Expressions", | |
description="Learn to write regular expressions in Python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.core.urlresolvers import reverse | |
from django.test import TestCase | |
from django.utils import timezone | |
from .models import Course, Step | |
# Create your tests here. | |
class CourseModelTests(TestCase): | |
def test_course_creation(self): | |
course = Course.objects.create( |
OlderNewer