From e3e1f1fafa2060d95f92b38c3f53b9e2bc33db60 Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Sat, 14 Jan 2012 07:36:38 -0500 Subject: [PATCH] Removed old, HTML-style textbook --- textbook/__init__.py | 0 textbook/models.py | 3 --- textbook/tests.py | 16 ---------------- textbook/views.py | 18 ------------------ 4 files changed, 37 deletions(-) delete mode 100644 textbook/__init__.py delete mode 100644 textbook/models.py delete mode 100644 textbook/tests.py delete mode 100644 textbook/views.py diff --git a/textbook/__init__.py b/textbook/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/textbook/models.py b/textbook/models.py deleted file mode 100644 index 71a8362390..0000000000 --- a/textbook/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/textbook/tests.py b/textbook/tests.py deleted file mode 100644 index 501deb776c..0000000000 --- a/textbook/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/textbook/views.py b/textbook/views.py deleted file mode 100644 index 6cc9e8ba6c..0000000000 --- a/textbook/views.py +++ /dev/null @@ -1,18 +0,0 @@ -from djangomako.shortcuts import render_to_response, render_to_string -from django.shortcuts import redirect -import os -from django.conf import settings -from django.http import Http404 - -# We don't do subdirectories to reduce odds of possible future -# security issues. Feel free to re-add them if needed -- just make -# sure things like /../../etc/passwd are handled okay. - -valid_files=os.listdir(settings.TEXTBOOK_DIR) - -def index(request, filename): - if filename in valid_files: - text=open(settings.TEXTBOOK_DIR+filename).read() - return render_to_response('textbook.html',{'text':text}) - else: - raise Http404