Commit 71ff6aec authored by chris's avatar chris

wagtail migration, part 1

parent bba20cb5
......@@ -13,7 +13,6 @@ https://docs.djangoproject.com/en/1.6/ref/settings/
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
......@@ -25,20 +24,37 @@ DEBUG = True
ALLOWED_HOSTS = []
# Application definition
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite'),
}
}
INSTALLED_APPS = (
'flyers.content',
'flyers.general',
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
'wagtail.wagtailembeds',
'wagtail.wagtailsites',
'wagtail.wagtailusers',
'wagtail.wagtailsnippets',
'wagtail.wagtaildocs',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
'modelcluster',
'taggit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'sorl.thumbnail',
'ckeditor',
'flyers.content',
'flyers.general'
)
MIDDLEWARE_CLASSES = (
......@@ -51,61 +67,42 @@ MIDDLEWARE_CLASSES = (
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
)
ROOT_URLCONF = 'flyers.urls'
WSGI_APPLICATION = 'flyers.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite'),
}
}
WAGTAIL_SITE_NAME = 'Flyers'
# Internationalization
# https://docs.djangoproject.com/en/1.6/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
LANGUAGE_CODE = 'fr-be'
SITE_MULTILINGUAL = False
'''
LANGUAGES = (
('en', 'English'),
('fr', 'Français'),
('es', 'Español'),
('ca', 'Català'),
)
'''
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
CKEDITOR_UPLOAD_PATH = os.path.join(BASE_DIR, 'media', 'uploads')
CKEDITOR_CONFIGS = {
'default': {
'toolbar_Full': [
['Styles', 'Format', 'Bold', 'Italic', 'Underline', 'Strike',
'SpellChecker', 'Undo', 'Redo'],
['Image', 'Link', 'Flash', 'Table', 'HorizontalRule'],
['TextColor', 'BGColor'],
['Smiley', 'SpecialChar'], ['Source'],
],
'extraAllowedContent': 'iframe[*]'
},
}
#CKEDITOR_JQUERY_URL = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
......@@ -121,28 +118,18 @@ TEMPLATES = [
'flyers.general.context_processors.general',
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
],
},
},
]
LANGUAGE_CODE = 'fr-be'
SITE_MULTILINGUAL = False
'''
LANGUAGES = (
('en', 'English'),
('fr', 'Français'),
('es', 'Español'),
('ca', 'Català'),
)
'''
try:
from local_settings import *
except ImportError as e:
......
from django.conf.urls import include, url
from django.views.generic import DetailView
from django.shortcuts import get_object_or_404
from flyers.content.models import Page
from flyers.general.models import Settings
from django.contrib import admin
from django.views.i18n import JavaScriptCatalog
from django.conf.urls.i18n import i18n_patterns
import settings
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.wagtailadmin import urls as wagtailadmin_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailsearch import urls as wagtailsearch_urls
class HomepageDetail(DetailView):
model = Page
def get_object(self):
settings = Settings.objects.get(pk=1)
if settings.home_page:
return get_object_or_404(Page, pk=settings.home_page.pk)
return None
urlpatterns = [
# Examples:
# url(r'^$', 'flyers.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^$', HomepageDetail.as_view()),
url(r'^(?P<slug>.+)/$', DetailView.as_view(model=Page)),
url(r'^django-admin/', include(admin.site.urls)),
url(r'^admin/', include(wagtailadmin_urls)),
url(r'^search/', include(wagtailsearch_urls)),
url(r'^documents/', include(wagtaildocs_urls)),
# Optional URL for including your own vanilla Django urls/views
# url(r'', include('myapp.urls')),
# For anything not caught by a more specific rule above, hand over to
# Wagtail's serving mechanism
url(r'', include(wagtail_urls)),
]
urlpatterns += i18n_patterns(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment