Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
andrewebdev committed Jun 19, 2016
2 parents c2fecba + e4a8012 commit 2c435dea23319be6e9011e7381afca2b4092b5a2
Showing 390 changed files with 46,741 additions and 3,026 deletions.
View
@@ -5,8 +5,11 @@
*.egg-info
.*.cfg
*.db
+*.sqlite3
+*.sublime-workspace
.children
.project
+.ropeproject
bin
develop-eggs
eggs
@@ -15,4 +18,4 @@ MANIFEST
dist/
demoproject/src/*
demoproject/config.rb
-*.sublime-workspace
+venv/
View
@@ -4,8 +4,7 @@ python:
install:
- pip install --upgrade setuptools
- - python demoproject/bootstrap.py -c demoproject/travis.cfg
- - demoproject/bin/buildout -c demoproject/travis.cfg
+ - pip install -r demo/requirements.txt
script:
- - demoproject/bin/test
+ - ./runtests.py
View
@@ -0,0 +1,12 @@
+FROM python:2.7
+ENV PYTHONBUFFERRED 1
+RUN pip install --upgrade pip
+
+RUN mkdir /demo
+
+WORKDIR /demo/
+ADD demo/requirements.txt /demo/requirements.txt
+RUN pip install -r requirements.txt
+
+ADD demo /demo/
+
View
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2013 Andre Engelbrecht
+Copyright (c) 2010-2016 Andre Engelbrecht
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
File renamed without changes.
@@ -6,13 +6,9 @@
from ostinato.statemachine.forms import sm_form_factory
-class EntryForm(sm_form_factory(sm_class=BlogEntryWorkflow)):
- class Meta:
- model = Entry
-
-
class EntryAdmin(admin.ModelAdmin):
- form = EntryForm
+ form = sm_form_factory(sm_class=BlogEntryWorkflow)
+
list_display = ('title', 'slug', 'author', 'entry_state', 'created_date',
'publish_date')
list_filter = ('state', 'author')
@@ -23,4 +19,4 @@ def entry_state(self, obj):
entry_state.short_description = "State"
-admin.site.register(Entry, EntryAdmin)
+admin.site.register(Entry, EntryAdmin)
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.4 on 2016-04-19 21:15
+from __future__ import unicode_literals
+
+from django.conf import settings
+from django.db import migrations, models
+import django.db.models.deletion
+import taggit.managers
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ('taggit', '0002_auto_20150616_2121'),
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('ostinato_pages', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Entry',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('title', models.CharField(max_length=255, verbose_name='Title')),
+ ('slug', models.SlugField(help_text='A unique, url-friendly slug based on the title', unique=True, verbose_name='Slug')),
+ ('content', models.TextField(verbose_name='Content')),
+ ('state', models.IntegerField(choices=[(1, b'Private'), (10, b'Archived'), (3, b'Review'), (5, b'Published')], default=1, verbose_name='State')),
+ ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Created date')),
+ ('modified_date', models.DateTimeField(auto_now=True, null=True, verbose_name='Modified date')),
+ ('publish_date', models.DateTimeField(blank=True, null=True, verbose_name='Publish date')),
+ ('archived_date', models.DateTimeField(blank=True, null=True, verbose_name='Archived date')),
+ ('allow_comments', models.BooleanField(default=True, verbose_name='Allow comments')),
+ ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Author')),
+ ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
+ ],
+ options={
+ 'verbose_name_plural': 'Entries',
+ },
+ ),
+ migrations.CreateModel(
+ name='LandingPage',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('meta_keywords', models.CharField(blank=True, max_length=250, null=True)),
+ ('meta_description', models.TextField(blank=True, null=True)),
+ ('max_latest_entries', models.IntegerField(default=10, help_text=b'The maximum number of latest entries to display')),
+ ('page', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='blog_landingpage_content', to='ostinato_pages.Page')),
+ ],
+ options={
+ 'abstract': False,
+ },
+ ),
+ ]
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.4 on 2016-04-20 21:54
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('blog', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='entry',
+ name='state',
+ field=models.CharField(choices=[(b'review', b'Review'), (b'archived', b'Archived'), (b'private', b'Private'), (b'published', b'Published')], default=b'private', max_length=20, verbose_name='State'),
+ ),
+ ]
File renamed without changes.
@@ -32,4 +32,5 @@ class LandingPage(SEOPage):
class ContentOptions:
template = 'blog/landing_page.html'
- view = 'blog.views.LandingPageView'
+ view = 'blog.views.LandingPageView'
+
@@ -1,13 +1,14 @@
-from django.conf.urls import patterns, url
+from django.conf.urls import url
from django.conf import settings
from blog.models import Entry
from blog.views import EntryPreviewView, EntryDetailView
-urlpatterns = patterns('',
+urlpatterns = [
url(r'^(?P<id>[\d]+)/$', EntryPreviewView.as_view(), name="blog_entry_preview"),
url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>[-\w]+)/$',
EntryDetailView.as_view(), name="blog_entry_detail"),
-)
+]
+
@@ -37,3 +37,4 @@ def get_context_data(self, **kwargs):
c = super(EntryDetailView, self).get_context_data(**kwargs)
c['page'] = Page.objects.filter(template="blog.landingpage")[0]
return c
+
File renamed without changes.
View
@@ -0,0 +1,172 @@
+"""
+Django settings for demo project.
+
+Generated by 'django-admin startproject' using Django 1.9.4.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.9/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/1.9/ref/settings/
+"""
+
+import os
+import sys
+import ostinato.polyprep
+
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
+BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = '(04#f3m#e=588929)x_vn)8fu$91rz%=&d2!wmu^)r7t85u#)&'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+INSTALLED_APPS = [
+ 'django.contrib.admin',
+ 'django.contrib.auth',
+ 'django.contrib.contenttypes',
+ 'django.contrib.sessions',
+ 'django.contrib.messages',
+ 'django.contrib.staticfiles',
+ 'django.contrib.sites',
+
+ 'ostinato',
+ 'ostinato.pages',
+ 'ostinato.contentfilters',
+
+ # Other dependencies
+ 'mptt',
+ 'taggit',
+ # 'taggit_templatetags',
+
+ # Our Website Custom apps
+ 'demo',
+ 'website',
+ 'blog'
+]
+
+MIDDLEWARE_CLASSES = [
+ 'django.middleware.security.SecurityMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+ 'django.middleware.common.CommonMiddleware',
+ 'django.middleware.csrf.CsrfViewMiddleware',
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.clickjacking.XFrameOptionsMiddleware',
+]
+
+ROOT_URLCONF = 'demo.urls'
+
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'context_processors': [
+ 'django.template.context_processors.debug',
+ 'django.template.context_processors.request',
+ 'django.contrib.auth.context_processors.auth',
+ 'django.contrib.messages.context_processors.messages',
+ ],
+ },
+ },
+]
+WSGI_APPLICATION = 'demo.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'demo.db',
+ }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/1.9/topics/i18n/
+LANGUAGE_CODE = 'en-GB'
+TIME_ZONE = 'UTC'
+USE_I18N = True
+USE_L10N = True
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/1.9/howto/static-files/
+STATIC_URL = '/static/'
+
+# Send emails to the console
+EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+
+# Ostinato settings
+SITE_ID = 1
+OSTINATO_PAGES_SITE_TREEID = 1
+
+# Third party app config
+TINYMCE_DEFAULT_CONFIG = {
+ 'theme': 'advanced',
+ 'plugins': "paste",
+ 'relative_urls': False,
+ # 'remove_script_host': False,
+ # 'document_base_url': '',
+
+ 'theme_advanced_buttons1' : "bold,italic,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,|,undo,redo,|,link,unlink,code,image,|,formatselect,|,pastetext,",
+ 'theme_advanced_buttons2' : "",
+ 'theme_advanced_buttons3' : "",
+ 'theme_advanced_buttons4' : "",
+ 'theme_advanced_toolbar_location' : "top",
+ 'theme_advanced_toolbar_align' : "left",
+ 'theme_advanced_statusbar_location' : "bottom",
+ 'theme_advanced_resizing' : True,
+ 'theme_advanced_blockformats' : "h1,h2,h3,p,blockquote",
+
+ 'width': 760,
+ 'height': 400,
+
+ 'paste_strip_class_attributes': 'all',
+ 'paste_auto_cleanup_on_paste' : True,
+ 'paste_convert_middot_lists': False,
+ 'paste_remove_styles' : True,
+ 'paste_retain_style_properties': '',
+
+ 'extended_valid_elements': "a[class|name|href|target|title|onclick|rel],"\
+ "script[type|src],"\
+ "iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],"\
+ "$elements",
+}
+
+if 'test' in sys.argv:
+ from test_settings import *
+
View
@@ -0,0 +1,14 @@
+from django.conf.urls import url, include
+from django.conf.urls.static import static
+from django.contrib import admin
+from django.conf import settings
+
+
+urlpatterns = [
+ url(r'^blog/', include('blog.urls')),
+ url(r'^admin/', admin.site.urls),
+ url(r'^tinymce/', include('tinymce.urls')),
+] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+
+urlpatterns += [url(r'^', include('ostinato.pages.urls'))]
+
View
@@ -0,0 +1,16 @@
+"""
+WSGI config for demo project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")
+
+application = get_wsgi_application()
@@ -3,7 +3,7 @@
import sys
if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "odemo.settings")
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings")
from django.core.management import execute_from_command_line
Oops, something went wrong.

0 comments on commit 2c435de

Please sign in to comment.