Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added example folder

  • Loading branch information...
commit 4c05e97b66442464add37b8b04f17cd48a93c59f 1 parent 196e0ee
@evildmp authored
View
0  example/__init__.py
No changes.
View
104 example/arkestra_settings.py
@@ -0,0 +1,104 @@
+import os
+from settings import STATIC_URL
+
+# ------------------------ Arkestra settings
+
+ARKESTRA_BASE_ENTITY = 1 # get this wrong, and you'll be sorry
+MULTIPLE_ENTITY_MODE = False
+MENU_MODIFIERS = {"ArkestraPages": ("contacts", "news",)}
+
+# heading levels
+
+h_page_title = PAGE_TITLE_HEADING_LEVEL = 1 # global value for the heading level for page titles (e.g. entity names in entity pages)
+H_MAIN_BODY = 2
+
+# a couple of things to explore later
+# try tuple( [(i[0],u"") for i in t if i[0]<=cutoff] + [i for i in t if i[0] > cutoff] ) to generate headings
+# tuple(i for i in HEADINGS if i[0] == 0 or i[0] > 2) gives the result ((0, u'No heading'), (3, u'Heading 3'), (4, u'Heading 4'), (5, u'Heading 5'))
+
+HEADINGS = (
+ (0, u"No heading"),
+# (1, u"Heading 1"),
+ (2, u"Heading 2"),
+ (3, u"Heading 3"),
+ (4, u"Heading 4"),
+ (5, u"Heading 5"),
+ )
+
+CASCADE_NEWS_AND_EVENTS = True # news & events items of children are automatically on parents' pages
+NEWS_AND_EVENT_LIMIT_TO = 6
+SHOW_VENUE_IN_EVENTS_LISTS = True
+SHOW_EVENT_TYPES = False
+COLLECT_TOP_EVENTS = False # in long lists, gather top events all together
+
+# ------------------------ Semantic editor
+
+SEMANTICEDITOR_MEDIA_URL = os.path.join(STATIC_URL, "semanticeditor/")
+
+# 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'}",
+ "{'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'}",
+])
+
+WYM_TOOLS = ",\n".join([
+ "{'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong'}",
+ "{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}",
+ "{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}",
+ "{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}",
+ "{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}",
+ "{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}",
+ # "{'name': 'Superscript', 'title': 'Superscript', 'css': 'wym_tools_superscript'}",
+ # "{'name': 'Subscript', 'title': 'Subscript', 'css': 'wym_tools_subscript'}",
+ "{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}",
+ "{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}",
+ # "{'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste'}",
+ "{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}",
+ #"{'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}",
+ #"{'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}",
+ #"{'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}",
+ "{'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'}",
+ #"{'name': 'Preview', 'title': 'Preview', 'css': 'wym_tools_preview'}",
+])
+
+# ------------------------ Links system
+
+LINK_SCHEMA = {
+ 'newsarticle': {
+ 'search_fields': ('title',),
+ 'metadata_field': 'subtitle',
+ 'heading': 'News articles',
+ },
+ 'person': {
+ 'search_fields': ('given_name','surname',),
+ 'heading': 'People',
+ },
+ 'event': {
+ 'search_fields': ('title',),
+ 'metadata_field': 'subtitle',
+ 'heading': 'Events',
+ },
+ 'external_link': {
+ 'search_fields': ('title', 'url'),
+ 'metadata_field': 'description',
+ 'heading': 'External resources',
+ },
+ 'vacancy': {
+ 'search_fields': ('title',),
+ 'metadata_field': 'summary',
+ 'heading': 'Vacancies',
+ },
+ 'page': {
+ 'search_fields': ('title_set__title',),
+ 'text_field': 'get_title',
+ },
+}
View
5 example/deployment_settings.py
@@ -0,0 +1,5 @@
+from settings import *
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+THUMBNAIL_DEBUG = False # if True, will cause template syntax errors for missing images
View
8 example/legacy_finders.py
@@ -0,0 +1,8 @@
+from django.contrib.staticfiles.storage import AppStaticStorage
+from django.contrib.staticfiles.finders import AppDirectoriesFinder
+
+class LegacyAppMediaStorage(AppStaticStorage):
+ source_dir = 'media'
+
+class LegacyAppDirectoriesFinder(AppDirectoriesFinder):
+ storage_class = LegacyAppMediaStorage
View
11 example/manage.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+from django.core.management import execute_manager
+try:
+ import settings # Assumed to be in the same directory.
+except ImportError:
+ import sys
+ sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
+ sys.exit(1)
+
+if __name__ == "__main__":
+ execute_manager(settings)
View
3  example/read_me_first.txt
@@ -0,0 +1,3 @@
+settings.py
+
+Find and edit the lines marked with # <-- EDIT
View
278 example/settings.py
@@ -0,0 +1,278 @@
+import os
+import os.path
+
+BASE_PATH = os.path.normpath(os.path.dirname(__file__))
+
+# FIXTURE_DIRS = [os.path.join(PROJECT_DIR, 'fixtures')]
+
+DEBUG = True
+TEMPLATE_DEBUG = DEBUG
+
+# ------------------------ misc settings
+
+SITE_ID = 1
+INTERNAL_IPS = ('127.0.0.1',)
+
+FILE_UPLOAD_PERMISSIONS = 0644
+FILE_UPLOAD_MAX_MEMORY_SIZE = 26214400
+
+# ------------------------ admin settings
+SERVER_EMAIL = '' # <-- EDIT
+
+ADMINS = () # <-- EDIT
+
+MANAGERS = ADMINS
+
+DATABASES = {} # <-- EDIT
+
+# Local time zone for this installation. Choices can be found here:
+# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
+# although not all choices may be avilable on all operating systems.
+# If running in a Windows environment this must be set to the same as your
+# system time zone.
+
+TIME_ZONE = 'Europe/London'
+DATE_FORMAT = "jS F Y"
+TIME_FORMAT = "H\.i"
+
+# Language code for this installation. All choices can be found here:
+# http://www.i18nguy.com/unicode/language-identifiers.html
+LANGUAGE_CODE = 'en-us'
+
+SITE_ID = 1
+
+# If you set this to False, Django will make some optimizations so as not
+# to load the internationalization machinery.
+LANGUAGE_CODE = "en"
+USE_I18N = True
+gettext = lambda s: s
+
+LANGUAGES = (
+('en', gettext('English')),
+('cy', gettext('Cymraeg')),
+)
+
+CMS_LANGUAGE_CONF = {
+ 'de':['fr'],
+ 'en':['fr'],
+}
+# Absolute path to the directory that holds media.
+# Example: "/home/media/media.lawrence.com/"
+MEDIA_ROOT = BASE_PATH+'/media'
+
+# URL that handles the media served from MEDIA_ROOT. Make sure to use a
+# trailing slash if there is a path component (optional in other cases).
+# Examples: "http://media.lawrence.com", "http://example.com/media/"
+MEDIA_URL = '/media/'
+
+# Absolute path to the directory static files should be collected to.
+# Don't put anything in this directory yourself; store your static files
+# in apps' "static/" subdirectories and in STATICFILES_DIRS.
+# Example: "/home/media/media.lawrence.com/static/"
+
+STATIC_ROOT = ''
+
+# URL prefix for static files.
+# Example: "http://media.lawrence.com/static/"
+STATIC_URL = '/static/'
+
+# URL prefix for admin static files -- CSS, JavaScript and images.
+# Make sure to use a trailing slash.
+# Examples: "http://foo.com/static/admin/", "/static/admin/".
+ADMIN_MEDIA_PREFIX = '/static/admin/'
+
+# Additional locations of static files
+STATICFILES_DIRS = (
+ # Put strings here, like "/home/html/static" or "C:/www/django/static".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+g)
+
+# List of finder classes that know how to find static files in
+# various locations.
+STATICFILES_FINDERS = (
+ 'django.contrib.staticfiles.finders.FileSystemFinder',
+ 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
+ 'legacy_finders.LegacyAppDirectoriesFinder',
+# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
+)
+
+# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
+# trailing slash.
+# Examples: "http://foo.com/media/", "/media/".
+# ADMIN_MEDIA_PREFIX = '/media/admin/'
+
+# Make this unique, and don't share it with anybody.
+SECRET_KEY = 'lngG56gjhrcuytvutgdjhjd6dkjk3=drp3*%$£k(*' # <-- EDIT
+
+# List of callables that know how to import templates from various sources.
+TEMPLATE_LOADERS = (
+# ('django.template.loaders.cached.Loader', (
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
+# )),
+)
+
+TEMPLATE_CONTEXT_PROCESSORS = (
+ 'django.core.context_processors.debug',
+ 'django.core.context_processors.i18n',
+ 'django.core.context_processors.media',
+ 'django.core.context_processors.static',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ 'django.core.context_processors.csrf',
+
+ "django.core.context_processors.request",
+
+ "cms.context_processors.media",
+ "arkestra_utilities.context_processors.arkestra_templates",
+)
+
+THUMBNAIL_PROCESSORS = (
+ 'easy_thumbnails.processors.colorspace',
+ 'easy_thumbnails.processors.autocrop',
+ 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
+ 'easy_thumbnails.processors.filters',
+ )
+
+THUMBNAIL_SUBDIR = "output"
+THUMBNAIL_DEBUG = False # if True, will cause template syntax errors for missing images
+
+MIDDLEWARE_CLASSES = (
+ 'django.middleware.common.CommonMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.doc.XViewMiddleware',
+
+ 'cms.middleware.page.CurrentPageMiddleware',
+ 'cms.middleware.user.CurrentUserMiddleware',
+ 'cms.middleware.toolbar.ToolbarMiddleware',
+ 'cms.middleware.media.PlaceholderMediaMiddleware',
+)
+
+ROOT_URLCONF = 'example.urls'
+
+TEMPLATE_DIRS = (
+ # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
+ # Always use forward slashes, even on Windows.
+ # Don't forget to use absolute paths, not relative paths.
+ BASE_PATH+'/templates/',
+)
+
+INSTALLED_APPS = (
+
+ # Django CMS applications
+
+ 'cms',
+ 'menus',
+ 'appmedia',
+ 'cms.plugins.text',
+ 'cms.plugins.snippet',
+ 'cmsplugin_filer_image',
+
+ # Arkestra applications
+
+ 'contacts_and_people',
+ 'news_and_events',
+ 'links',
+ 'arkestra_utilities',
+ # 'housekeeping', # poor thing, it's in a bit of a mess at the moment
+ 'arkestra_utilities.admin_tabs_extension',
+ 'arkestra_utilities.widgets.combobox', # so that static-files picks it up
+ # 'vacancies_and_studentships', # not needed for most sistes
+
+ # other applications
+
+ 'semanticeditor',
+ 'mptt',
+ 'easy_thumbnails',
+ 'typogrify',
+ 'filer',
+ 'widgetry',
+ 'south',
+ # 'features',
+
+ # core Django applications
+
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.admin',
+ 'django.contrib.sites',
+ 'django.contrib.admindocs',
+ 'django.contrib.messages',
+ 'django.contrib.humanize',
+ 'django.contrib.staticfiles',
+)
+
+# ------------------------ authentication
+
+AUTHENTICATION_BACKENDS = (
+ 'django.contrib.auth.backends.RemoteUserBackend',
+# 'auth.ldapauth.LDAPBackend',
+ 'django.contrib.auth.backends.ModelBackend',
+)
+
+AUTH_PROFILE_MODULE = 'contacts_and_people.Person'
+
+LOGIN_REDIRECT_URL = "/admin/"
+
+ENABLE_CONTACTS_AND_PEOPLE_AUTH_ADMIN_INTEGRATION=True
+
+# Override the server-derived value of SCRIPT_NAME
+# See http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#lighttpdfastcgiandothers
+FORCE_SCRIPT_NAME = ''
+# ------------------------ Django CMS
+
+CMS_DEFAULT_TEMPLATE = "arkestra.html"
+
+CMS_TEMPLATES = (
+ ('arkestra.html', gettext('Arkestra')),
+)
+
+CMS_APPLICATIONS_URLS = (
+ ('sampleapp.urls', 'Sample application'),
+ ('sampleapp.urlstwo', 'Second sample application'),
+)
+
+CMS_PLACEHOLDER_CONF = {
+ 'body': {
+ "plugins": (
+ 'SemanticTextPlugin',
+ 'CMSVacanciesPlugin',
+ 'CMSNewsAndEventsPlugin',
+ 'SnippetPlugin',
+ 'LinksPlugin',
+ 'CMSPublicationsPlugin',
+ 'ImagePlugin',
+ 'EntityAutoPageLinkPluginPublisher',
+ 'EntityMembersPluginPublisher',
+ 'FilerImagePlugin',
+ 'EntityDirectoryPluginPublisher',
+ 'CarouselPluginPublisher',
+ 'FocusOnPluginPublisher',
+ ),
+ "extra_context": {"theme":"16_5", "width":"800",},
+ "name": gettext("body"),
+ },
+}
+
+CMS_NAVIGATION_EXTENDERS = (('example.categories.navigation.get_nodes', 'Categories'),)
+CMS_SOFTROOT = True
+CMS_MODERATOR = False
+CMS_PERMISSION = True
+CMS_REDIRECTS = True
+CMS_SEO_FIELDS = True
+CMS_MENU_TITLE_OVERWRITE = True
+CMS_HIDE_UNTRANSLATED = False
+CMS_FLAT_URLS = False
+CMS_MEDIA_URL = STATIC_URL + 'cms/'
+
+CMS_PAGE_FLAGS = (
+ ('no_local_menu', 'Hide local menu') ,
+ ('no_page_title', "Don't display page title") ,
+ )
+
+from arkestra_settings import *
View
3  example/settings_deployment.py
@@ -0,0 +1,3 @@
+from settings import *
+DEBUG = False
+TEMPLATE_DEBUG = DEBUG
View
31 example/urls.py
@@ -0,0 +1,31 @@
+from django.conf.urls.defaults import *
+from django.conf import settings
+
+# Uncomment the next two lines to enable the admin:
+from django.contrib import admin
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ (r'^admin/doc/', include('django.contrib.admindocs.urls')),
+
+ (r'^admin/', include(admin.site.urls)),
+
+ (r'^semantic/', include('semanticeditor.urls')),
+ (r"", include("contacts_and_people.urls")),
+ (r"", include("features.urls")),
+
+
+ (r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
+)
+
+if settings.DEBUG:
+ urlpatterns+= patterns('',
+ url(r'^media/cms/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.CMS_MEDIA_ROOT, 'show_indexes': True}),
+ # url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
+ (r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
+ )
+
+urlpatterns += patterns('',
+ url('^autocomplete/$', 'widgetry.views.search', name='widgetry-search'),
+ url(r'^', include('cms.urls')),
+)
Please sign in to comment.
Something went wrong with that request. Please try again.