From b094f3bbb99ba1a2edaec0c2f41fd4805225d90f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Mar 2009 21:20:01 -0700 Subject: [PATCH] IGN:Planet now deployed at planet.calibre-ebook.com --- src/calibre/www/planet/settings.py | 10 +++++----- src/calibre/www/planet/urls.py | 3 +-- src/calibre/www/settings.py | 1 + src/calibre/www/templates/404.html | 12 ++++++++++++ src/calibre/www/templates/500.html | 16 ++++++++++++++++ src/calibre/www/templates/base.html | 2 ++ 6 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 src/calibre/www/templates/404.html create mode 100644 src/calibre/www/templates/500.html diff --git a/src/calibre/www/planet/settings.py b/src/calibre/www/planet/settings.py index 372005af63..5c3a80b568 100644 --- a/src/calibre/www/planet/settings.py +++ b/src/calibre/www/planet/settings.py @@ -4,10 +4,10 @@ from calibre.www.settings import DEBUG, TEMPLATE_DEBUG, ADMINS, MANAGERS, \ TEMPLATE_LOADERS, TEMPLATE_DIRS, MIDDLEWARE_CLASSES, MEDIA_ROOT, \ MEDIA_URL, ADMIN_MEDIA_PREFIX -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. +if not DEBUG: + MEDIA_URL = 'http://planet.calibre-ebook.com/site_media/' + ADMIN_MEDIA_PREFIX = 'http://planet.calibre-ebook.com/admin_media/' + MEDIA_ROOT = '/usr/local/calibre/src/calibre/www/static/' if DEBUG: @@ -28,7 +28,7 @@ else: SECRET_KEY = open('/var/www/planet.calibre-ebook.com/django_secret_key').read().strip() -ROOT_URLCONF = 'planet.urls' +ROOT_URLCONF = 'calibre.www.planet.urls' INSTALLED_APPS = ( 'django.contrib.auth', diff --git a/src/calibre/www/planet/urls.py b/src/calibre/www/planet/urls.py index b952fb6072..fbe39425fe 100644 --- a/src/calibre/www/planet/urls.py +++ b/src/calibre/www/planet/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, include +from django.conf.urls.defaults import patterns, include, handler404, handler500 from django.conf import settings # Uncomment the next two lines to enable the admin: @@ -7,7 +7,6 @@ admin.autodiscover() urlpatterns = patterns('', - #(r'^admin/', include('django.contrib.admin.urls')), (r'^admin/(.*)', admin.site.root), diff --git a/src/calibre/www/settings.py b/src/calibre/www/settings.py index 4ff4d96ef9..546ea9b0ab 100644 --- a/src/calibre/www/settings.py +++ b/src/calibre/www/settings.py @@ -72,6 +72,7 @@ if DEBUG: ) else: TEMPLATE_DIRS = ( + '/usr/local/calibre/src/calibre/www/templates', ) diff --git a/src/calibre/www/templates/404.html b/src/calibre/www/templates/404.html new file mode 100644 index 0000000000..e2b32e79ea --- /dev/null +++ b/src/calibre/www/templates/404.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}Page not found{% endblock %} + +{% block header_text %}Page not found{% endblock %} + +{% block content %} + +

Sorry, but the requested page could not be found.

+{% endblock %} + +{% block footer_text %} {% endblock %} diff --git a/src/calibre/www/templates/500.html b/src/calibre/www/templates/500.html new file mode 100644 index 0000000000..fec6540d62 --- /dev/null +++ b/src/calibre/www/templates/500.html @@ -0,0 +1,16 @@ + + + + Page unavailable + + +

Page unavailable

+ +

Sorry, but the requested page is unavailable due to a + server hiccup.

+ +

Our engineers have been notified, so check back later.

+ + + diff --git a/src/calibre/www/templates/base.html b/src/calibre/www/templates/base.html index c4600d50aa..245d7edc9b 100644 --- a/src/calibre/www/templates/base.html +++ b/src/calibre/www/templates/base.html @@ -23,10 +23,12 @@