Skip to content
Browse files

arkestra/example for Django 1.3 now works

  • Loading branch information...
1 parent ffe5659 commit d4d8dd6c228eaa6cd69a8c3ed2e3e3fd6cc15c6c @evildmp committed Nov 13, 2012
Showing with 10,239 additions and 109 deletions.
  1. +0 −17 example/arkestra_settings.py
  2. +10,137 −1 example/example_database.json
  3. +98 −87 example/settings.py
  4. +1 −2 news_and_events/tests.py
  5. +3 −2 news_and_events/views.py
View
17 example/arkestra_settings.py
@@ -2,7 +2,6 @@
# They are not just Arkestra settings, but settings for other applications
# that Arkestra requires to be just so.
-from arkestra_utilities.settings import *
# These are the only settings you really need.
# If you need to modify other aspects of Arkestra's behaviour, see the
@@ -36,22 +35,6 @@
from settings import STATIC_URL
SEMANTICEDITOR_MEDIA_URL = os.path.join(STATIC_URL, "semanticeditor/")
-PAGE_TITLE_HEADING_LEVEL = 2
-
-# ensure that the highest_page_body_heading_level is made available below
-
-WYM_CONTAINERS = ",\n".join([
- "{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
-# "{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}", # I assume you reserve <h1> for your page templates
- "{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
- "{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
- "{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
- "{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
- "{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
-# "{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
- "{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
- # "{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}", # not ready for this yet
-])
# ------------------------ Link system
View
10,138 example/example_database.json
10,137 additions, 1 deletion not shown because the diff is too large. Please use a local Git client to view these changes.
View
185 example/settings.py
@@ -1,4 +1,4 @@
-# Django settings for arkestra_medic project.
+# Django settings for example project.
import os
import os.path
@@ -7,12 +7,17 @@
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
+# set the BASE_PATH for convenience's sake
+BASE_PATH = os.path.normpath(os.path.dirname(__file__))
+
DEBUG = True
TEMPLATE_DEBUG = DEBUG
-# ------------------------ admin settings
+ADMINS = (
+ # ('Your Name', 'your_email@example.com'),
+)
-# ------------------------ databases
+MANAGERS = ADMINS
DATABASES = {
'default': {
@@ -53,11 +58,11 @@
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
+# calendars according to the current locale.
USE_L10N = True
-BASE_PATH = os.path.normpath(os.path.dirname(__file__))
-
+# If you set this to False, Django will not use timezone-aware datetimes.
+USE_TZ = False
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
@@ -135,16 +140,9 @@
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
- )
-
-THUMBNAIL_PROCESSORS = (
- 'easy_thumbnails.processors.colorspace',
- 'easy_thumbnails.processors.autocrop',
- 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
- 'easy_thumbnails.processors.filters',
- )
+)
-ROOT_URLCONF = 'urls'
+ROOT_URLCONF = 'example.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
@@ -153,6 +151,63 @@
BASE_PATH+'/templates/',
)
+INSTALLED_APPS = (
+
+ # Django CMS applications
+
+ 'arkestra_utilities',
+ 'cms',
+ 'menus',
+ # 'appmedia',
+ 'cms.plugins.text',
+ 'cms.plugins.snippet',
+ 'sekizai',
+ # 'djcelery', # will need to be enabled for celery processing
+
+ # Arkestra applications
+
+ 'contacts_and_people',
+ 'vacancies_and_studentships',
+ 'news_and_events',
+ 'links',
+ 'arkestra_utilities.widgets.combobox',
+ 'arkestra_image_plugin',
+ 'video',
+ 'housekeeping',
+
+ # other applications
+
+ 'polymorphic',
+ 'semanticeditor',
+ 'mptt',
+ 'easy_thumbnails',
+ 'typogrify',
+ 'filer',
+ 'widgetry',
+ # 'south',
+ # 'adminsortable',
+
+ # core Django applications
+ # these should be last, so we can override their templates
+
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.sites',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'django.contrib.admin',
+ 'django.contrib.admindocs',
+ 'django.contrib.humanize',
+)
+
+THUMBNAIL_PROCESSORS = (
+ 'easy_thumbnails.processors.colorspace',
+ 'easy_thumbnails.processors.autocrop',
+ 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
+ 'easy_thumbnails.processors.filters',
+ )
+
# ------------------------ Django Celery
try:
import djcelery
@@ -229,77 +284,33 @@
('cy', gettext('Cymraeg')),
)
-INSTALLED_APPS = (
-
- # Django CMS applications
-
- 'arkestra_utilities',
- 'cms',
- 'menus',
- # 'appmedia',
- 'cms.plugins.text',
- 'cms.plugins.snippet',
- 'sekizai',
- # 'djcelery', # will need to be enabled for celery processing
-
- # Arkestra applications
-
- 'contacts_and_people',
- 'vacancies_and_studentships',
- 'news_and_events',
- 'links',
- 'arkestra_utilities.widgets.combobox',
- 'arkestra_image_plugin',
- 'video',
- 'housekeeping',
-
- # other applications
-
- 'polymorphic',
- 'semanticeditor',
- 'mptt',
- 'easy_thumbnails',
- 'typogrify',
- 'filer',
- 'widgetry',
- # 'south',
- # 'adminsortable',
-
- # core Django applications
-
- 'django.contrib.auth',
- 'django.contrib.contenttypes',
- 'django.contrib.sessions',
- 'django.contrib.sites',
- 'django.contrib.messages',
- 'django.contrib.staticfiles',
- 'django.contrib.admin',
- 'django.contrib.admindocs',
- 'django.contrib.humanize',
- 'django.contrib.staticfiles',
-)
-
-# A sample logging configuration. The only tangible logging
-# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error.
-# See http://docs.djangoproject.com/en/dev/topics/logging for
-# more details on how to customize your logging configuration.
-LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'class': 'django.utils.log.AdminEmailHandler'
- }
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
- 'propagate': True,
- },
- }
-}
+# ------------------------ WYMeditor/SemanticEditor
+
+# these override the settings in cms.plugins.text.settings
+
+WYM_TOOLS = ",\n".join([
+ "{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}",
+ "{'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}",
+ "{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}",
+ "{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}",
+ "{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}",
+ "{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}",
+ "{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}",
+ "{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}",
+ "{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}",
+])
+
+WYM_CONTAINERS = ",\n".join([
+ "{'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p'}",
+ # "{'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1'}", # I assume you reserve <h1> for your page templates
+ "{'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2'}",
+ "{'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3'}",
+ "{'name': 'H4', 'title': 'Heading_4', 'css': 'wym_containers_h4'}",
+ "{'name': 'H5', 'title': 'Heading_5', 'css': 'wym_containers_h5'}",
+ "{'name': 'H6', 'title': 'Heading_6', 'css': 'wym_containers_h6'}",
+# "{'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre'}",
+ "{'name': 'BLOCKQUOTE', 'title': 'Blockquote', 'css': 'wym_containers_blockquote'}",
+ # "{'name': 'TH', 'title': 'Table_Header', 'css': 'wym_containers_th'}", # not ready for this yet
+])
from arkestra_settings import *# import pdb; pdb.set_trace()
View
3 news_and_events/tests.py
@@ -7,7 +7,6 @@
# we're testing the behaviour of a method that uses date-related functions
import datetime
-from django.utils import timezone
from models import NewsArticle
from contacts_and_people.models import Entity
@@ -27,7 +26,7 @@ def setUp(self):
self.tootharticle = NewsArticle(
title = "All about teeth",
slug = "all-about-teeth",
- date = timezone.now() + datetime.timedelta(days=30),
+ date = datetime.datetime.now() + datetime.timedelta(days=30),
)
print self.tootharticle.date
def test_generic_attributes(self):
View
5 news_and_events/views.py
@@ -1,7 +1,8 @@
+import datetime
+
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import Http404
-from django.utils import timezone
from contacts_and_people.models import Entity
from links.link_functions import object_links
@@ -160,7 +161,7 @@ def newsarticle(request, slug):
if request.user.is_staff:
newsarticle = get_object_or_404(NewsArticle, slug=slug)
else:
- newsarticle = get_object_or_404(NewsArticle, slug=slug, published=True, date__lte=timezone.now())
+ newsarticle = get_object_or_404(NewsArticle, slug=slug, published=True, date__lte=datetime.datetime.now())
return render_to_response(
"news_and_events/newsarticle.html",
{

1 comment on commit d4d8dd6

@evildmp
Owner

tests don't work in Django 1.3 though because of override_settings

Please sign in to comment.
Something went wrong with that request. Please try again.