kopia lustrzana https://github.com/wagtail/bakerydemo
Add initial demo scaffold without any site apps
rodzic
52e846ad7c
commit
0b54a7205c
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
1.5:f04bfbf0-1325-4cb4-a0e1-5ce72130f6b6
|
|
@ -0,0 +1 @@
|
|||
1486642324
|
|
@ -0,0 +1 @@
|
|||
501
|
|
@ -0,0 +1 @@
|
|||
f04bfbf0-1325-4cb4-a0e1-5ce72130f6b6
|
|
@ -0,0 +1 @@
|
|||
fbd9456e3df14fd6aba07a3cb6bc8859
|
|
@ -0,0 +1 @@
|
|||
{"virtualbox":{"/vagrant":{"guestpath":"/vagrant","hostpath":"/Users/edd/Documents/sites/bakerydemo","disabled":false,"__vagrantfile":true}}}
|
|
@ -0,0 +1 @@
|
|||
web: uwsgi --http :$PORT --module bakerydemo.wsgi --master --offload-threads 1
|
|
@ -0,0 +1,76 @@
|
|||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
||||
# configures the configuration version (we support older styles for
|
||||
# backwards compatibility). Please don't change it unless you know what
|
||||
# you're doing.
|
||||
Vagrant.configure(2) do |config|
|
||||
# The most common configuration options are documented and commented below.
|
||||
# For a complete reference, please see the online documentation at
|
||||
# https://docs.vagrantup.com.
|
||||
|
||||
# Every Vagrant development environment requires a box. You can search for
|
||||
# boxes at https://atlas.hashicorp.com/search.
|
||||
config.vm.box = "torchbox/wagtail-jessie64"
|
||||
config.vm.box_version = "~> 1.0"
|
||||
|
||||
# Disable automatic box update checking. If you disable this, then
|
||||
# boxes will only be checked for updates when the user runs
|
||||
# `vagrant box outdated`. This is not recommended.
|
||||
# config.vm.box_check_update = false
|
||||
|
||||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8000" will access port 8000 on the guest machine.
|
||||
config.vm.network "forwarded_port", guest: 8000, host: 8000
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
# using a specific IP.
|
||||
# config.vm.network "private_network", ip: "192.168.33.10"
|
||||
|
||||
# Create a public network, which generally matched to bridged network.
|
||||
# Bridged networks make the machine appear as another physical device on
|
||||
# your network.
|
||||
# config.vm.network "public_network"
|
||||
|
||||
# Share an additional folder to the guest VM. The first argument is
|
||||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
# config.vm.synced_folder "../data", "/vagrant_data"
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
# Example for VirtualBox:
|
||||
#
|
||||
# config.vm.provider "virtualbox" do |vb|
|
||||
# # Display the VirtualBox GUI when booting the machine
|
||||
# vb.gui = true
|
||||
#
|
||||
# # Customize the amount of memory on the VM:
|
||||
# vb.memory = "1024"
|
||||
# end
|
||||
#
|
||||
# View the documentation for the provider you are using for more
|
||||
# information on available options.
|
||||
|
||||
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
|
||||
# such as FTP and Heroku are also available. See the documentation at
|
||||
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
|
||||
# config.push.define "atlas" do |push|
|
||||
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
|
||||
# end
|
||||
|
||||
# Enable provisioning with a shell script. Additional provisioners such as
|
||||
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
||||
# documentation for more information about their specific syntax and use.
|
||||
# config.vm.provision "shell", inline: <<-SHELL
|
||||
# sudo apt-get update
|
||||
# sudo apt-get install -y apache2
|
||||
# SHELL
|
||||
config.vm.provision :shell, :path => "vagrant/provision.sh", :args => "bakerydemo"
|
||||
|
||||
# Enable agent forwarding over SSH connections.
|
||||
config.ssh.forward_agent = true
|
||||
end
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1 @@
|
|||
/local.py
|
|
@ -0,0 +1 @@
|
|||
from .dev import *
|
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,189 @@
|
|||
"""
|
||||
Django settings for bakerydemo project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 1.8.2.
|
||||
|
||||
For more information on this file, see
|
||||
https://docs.djangoproject.com/en/1.8/topics/settings/
|
||||
|
||||
For the full list of settings and their values, see
|
||||
https://docs.djangoproject.com/en/1.8/ref/settings/
|
||||
"""
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
import os
|
||||
|
||||
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
BASE_DIR = os.path.dirname(PROJECT_DIR)
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
|
||||
|
||||
|
||||
# Application definition
|
||||
|
||||
INSTALLED_APPS = [
|
||||
# 'bakerydemo.home',
|
||||
# 'bakerydemo.search',
|
||||
|
||||
'wagtail.contrib.wagtailsearchpromotions',
|
||||
'wagtail.wagtailforms',
|
||||
'wagtail.wagtailredirects',
|
||||
'wagtail.wagtailembeds',
|
||||
'wagtail.wagtailsites',
|
||||
'wagtail.wagtailusers',
|
||||
'wagtail.wagtailsnippets',
|
||||
'wagtail.wagtaildocs',
|
||||
'wagtail.wagtailimages',
|
||||
'wagtail.wagtailsearch',
|
||||
'wagtail.wagtailadmin',
|
||||
'wagtail.wagtailcore',
|
||||
|
||||
'modelcluster',
|
||||
'compressor',
|
||||
'taggit',
|
||||
|
||||
'django.contrib.admin',
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
]
|
||||
|
||||
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.messages.middleware.MessageMiddleware',
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
|
||||
'wagtail.wagtailcore.middleware.SiteMiddleware',
|
||||
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = 'bakerydemo.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
os.path.join(PROJECT_DIR, 'templates'),
|
||||
],
|
||||
'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 = 'bakerydemo.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': 'bakerydemo',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# 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.8/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-gb'
|
||||
|
||||
TIME_ZONE = 'Europe/London'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/1.8/howto/static-files/
|
||||
|
||||
STATICFILES_FINDERS = [
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
'compressor.finders.CompressorFinder',
|
||||
]
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(PROJECT_DIR, 'static'),
|
||||
]
|
||||
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
|
||||
# Django compressor settings
|
||||
# http://django-compressor.readthedocs.org/en/latest/settings/
|
||||
|
||||
COMPRESS_PRECOMPILERS = [
|
||||
('text/x-scss', 'django_libsass.SassCompiler'),
|
||||
]
|
||||
|
||||
|
||||
# Use Redis as the cache backend for extra performance
|
||||
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'django_redis.cache.RedisCache',
|
||||
'LOCATION': '127.0.0.1:6379',
|
||||
'KEY_PREFIX': 'bakerydemo',
|
||||
'OPTIONS': {
|
||||
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Use Elasticsearch as the search backend for extra performance and better search results
|
||||
|
||||
WAGTAILSEARCH_BACKENDS = {
|
||||
'default': {
|
||||
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
|
||||
'INDEX': 'bakerydemo',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
# Wagtail settings
|
||||
|
||||
WAGTAIL_SITE_NAME = "bakerydemo"
|
|
@ -0,0 +1,21 @@
|
|||
from .base import *
|
||||
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
TEMPLATES[0]['OPTIONS']['debug'] = True
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'CHANGEME!!!'
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2')
|
||||
|
||||
BASE_URL = 'http://localhost:8000'
|
||||
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
|
||||
|
||||
try:
|
||||
from .local import *
|
||||
except ImportError:
|
||||
pass
|
|
@ -0,0 +1,217 @@
|
|||
import os
|
||||
import dj_database_url
|
||||
|
||||
from .base import *
|
||||
|
||||
# Do not set SECRET_KEY, Postgres or LDAP password or any other sensitive data here.
|
||||
# Instead, use environment variables or create a local.py file on the server.
|
||||
|
||||
# Disable debug mode
|
||||
DEBUG = False
|
||||
TEMPLATES[0]['OPTIONS']['debug'] = False
|
||||
|
||||
|
||||
# Compress static files offline and minify CSS
|
||||
# http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
|
||||
COMPRESS_OFFLINE = True
|
||||
COMPRESS_CSS_FILTERS = [
|
||||
'compressor.filters.css_default.CssAbsoluteFilter',
|
||||
'compressor.filters.cssmin.CSSMinFilter',
|
||||
]
|
||||
COMPRESS_CSS_HASHING_METHOD = 'content'
|
||||
|
||||
|
||||
# Configuration from environment variables
|
||||
# Alternatively, you can set these in a local.py file on the server
|
||||
|
||||
env = os.environ.copy()
|
||||
|
||||
# On Torchbox servers, many environment variables are prefixed with "CFG_"
|
||||
for key, value in os.environ.items():
|
||||
if key.startswith('CFG_'):
|
||||
env[key[4:]] = value
|
||||
|
||||
|
||||
# Basic configuration
|
||||
|
||||
APP_NAME = env.get('APP_NAME', 'bakerydemo')
|
||||
|
||||
if 'SECRET_KEY' in env:
|
||||
SECRET_KEY = env['SECRET_KEY']
|
||||
|
||||
if 'ALLOWED_HOSTS' in env:
|
||||
ALLOWED_HOSTS = env['ALLOWED_HOSTS'].split(',')
|
||||
|
||||
if 'PRIMARY_HOST' in env:
|
||||
BASE_URL = 'http://%s/' % env['PRIMARY_HOST']
|
||||
|
||||
if 'SERVER_EMAIL' in env:
|
||||
SERVER_EMAIL = env['SERVER_EMAIL']
|
||||
|
||||
if 'CACHE_PURGE_URL' in env:
|
||||
INSTALLED_APPS += ( 'wagtail.contrib.wagtailfrontendcache', )
|
||||
WAGTAILFRONTENDCACHE = {
|
||||
'default': {
|
||||
'BACKEND': 'wagtail.contrib.wagtailfrontendcache.backends.HTTPBackend',
|
||||
'LOCATION': env['CACHE_PURGE_URL'],
|
||||
},
|
||||
}
|
||||
|
||||
if 'STATIC_URL' in env:
|
||||
STATIC_URL = env['STATIC_URL']
|
||||
|
||||
if 'STATIC_DIR' in env:
|
||||
STATIC_ROOT = env['STATIC_DIR']
|
||||
|
||||
if 'MEDIA_URL' in env:
|
||||
MEDIA_URL = env['MEDIA_URL']
|
||||
|
||||
if 'MEDIA_DIR' in env:
|
||||
MEDIA_ROOT = env['MEDIA_DIR']
|
||||
|
||||
|
||||
# Database
|
||||
|
||||
if 'DATABASE_URL' in os.environ:
|
||||
DATABASES = {'default': dj_database_url.config()}
|
||||
|
||||
else:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
'NAME': env.get('PGDATABASE', APP_NAME),
|
||||
'CONN_MAX_AGE': 600, # number of seconds database connections should persist for
|
||||
|
||||
# User, host and port can be configured by the PGUSER, PGHOST and
|
||||
# PGPORT environment variables (these get picked up by libpq).
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Redis
|
||||
# Redis location can either be passed through with REDIS_HOST or REDIS_SOCKET
|
||||
|
||||
if 'REDIS_URL' in env:
|
||||
REDIS_LOCATION = env['REDIS_URL']
|
||||
BROKER_URL = env['REDIS_URL']
|
||||
|
||||
elif 'REDIS_HOST' in env:
|
||||
REDIS_LOCATION = env['REDIS_HOST']
|
||||
BROKER_URL = 'redis://%s' % env['REDIS_HOST']
|
||||
|
||||
elif 'REDIS_SOCKET' in env:
|
||||
REDIS_LOCATION = 'unix://%s' % env['REDIS_SOCKET']
|
||||
BROKER_URL = 'redis+socket://%s' % env['REDIS_SOCKET']
|
||||
|
||||
else:
|
||||
REDIS_LOCATION = None
|
||||
|
||||
|
||||
if REDIS_LOCATION is not None:
|
||||
CACHES = {
|
||||
'default': {
|
||||
'BACKEND': 'django_redis.cache.RedisCache',
|
||||
'LOCATION': REDIS_LOCATION,
|
||||
'KEY_PREFIX': APP_NAME,
|
||||
'OPTIONS': {
|
||||
'CLIENT_CLASS': 'django_redis.client.DefaultClient',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Elasticsearch
|
||||
|
||||
if 'ELASTICSEARCH_URL' in env:
|
||||
WAGTAILSEARCH_BACKENDS = {
|
||||
'default': {
|
||||
'BACKEND': 'wagtail.wagtailsearch.backends.elasticsearch.ElasticSearch',
|
||||
'URLS': [env['ELASTICSEARCH_URL']],
|
||||
'INDEX': APP_NAME,
|
||||
'ATOMIC_REBUILD': True,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
# Logging
|
||||
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'handlers': {
|
||||
'mail_admins': {
|
||||
'level': 'ERROR',
|
||||
'class': 'django.utils.log.AdminEmailHandler',
|
||||
},
|
||||
},
|
||||
'formatters': {
|
||||
'default': {
|
||||
'verbose': '[%(asctime)s] (%(process)d/%(thread)d) %(name)s %(levelname)s: %(message)s'
|
||||
}
|
||||
},
|
||||
'loggers': {
|
||||
'bakerydemo': {
|
||||
'handlers': [],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
'formatter': 'verbose',
|
||||
},
|
||||
'wagtail': {
|
||||
'handlers': [],
|
||||
'level': 'INFO',
|
||||
'propagate': False,
|
||||
'formatter': 'verbose',
|
||||
},
|
||||
'django.request': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'ERROR',
|
||||
'propagate': False,
|
||||
'formatter': 'verbose',
|
||||
},
|
||||
'django.security': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'ERROR',
|
||||
'propagate': False,
|
||||
'formatter': 'verbose',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
if 'LOG_DIR' in env:
|
||||
# bakerydemo log
|
||||
LOGGING['handlers']['bakerydemo_file'] = {
|
||||
'level': 'INFO',
|
||||
'class': 'cloghandler.ConcurrentRotatingFileHandler',
|
||||
'filename': os.path.join(env['LOG_DIR'], 'bakerydemo.log'),
|
||||
'maxBytes': 5242880, # 5MB
|
||||
'backupCount': 5
|
||||
}
|
||||
LOGGING['loggers']['wagtail']['handlers'].append('bakerydemo_file')
|
||||
|
||||
# Wagtail log
|
||||
LOGGING['handlers']['wagtail_file'] = {
|
||||
'level': 'INFO',
|
||||
'class': 'cloghandler.ConcurrentRotatingFileHandler',
|
||||
'filename': os.path.join(env['LOG_DIR'], 'wagtail.log'),
|
||||
'maxBytes': 5242880, # 5MB
|
||||
'backupCount': 5
|
||||
}
|
||||
LOGGING['loggers']['wagtail']['handlers'].append('wagtail_file')
|
||||
|
||||
# Error log
|
||||
LOGGING['handlers']['errors_file'] = {
|
||||
'level': 'ERROR',
|
||||
'class': 'cloghandler.ConcurrentRotatingFileHandler',
|
||||
'filename': os.path.join(env['LOG_DIR'], 'error.log'),
|
||||
'maxBytes': 5242880, # 5MB
|
||||
'backupCount': 5
|
||||
}
|
||||
LOGGING['loggers']['django.request']['handlers'].append('errors_file')
|
||||
LOGGING['loggers']['django.security']['handlers'].append('errors_file')
|
||||
|
||||
|
||||
try:
|
||||
from .local import *
|
||||
except ImportError:
|
||||
pass
|
|
@ -0,0 +1,23 @@
|
|||
/* Responsive image/video classes */
|
||||
.rich-text img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.richtext-image.left{
|
||||
float:left;
|
||||
}
|
||||
.richtext-image.right{
|
||||
float:right;
|
||||
}
|
||||
.responsive-object {
|
||||
position: relative;
|
||||
}
|
||||
.responsive-object iframe,
|
||||
.responsive-object object,
|
||||
.responsive-object embed {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}404 - Page not found{% endblock %}
|
||||
|
||||
{% block body_class %}template-404{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Page not found</h1>
|
||||
|
||||
<h2>Sorry, this page could not be found.</h2>
|
||||
{% endblock %}
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Internal server error</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Internal server error</h1>
|
||||
|
||||
<h2>Sorry, there seems to be an error. Please try again soon.</h2>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,38 @@
|
|||
{% load compress static wagtailuserbar %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %}</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" type="text/x-scss" href="{% static 'css/main.scss' %}">
|
||||
{% endcompress %}
|
||||
|
||||
{% block extra_css %}
|
||||
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="{% block body_class %}{% endblock %}">
|
||||
{% wagtailuserbar %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
{% compress js %}
|
||||
<script type="text/javascript" src="{% static 'js/main.js' %}"></script>
|
||||
{% endcompress %}
|
||||
|
||||
{% block extra_js %}
|
||||
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
from django.conf.urls import include, url
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailcore import urls as wagtail_urls
|
||||
|
||||
# from bakerydemo.search import views as search_views
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^django-admin/', include(admin.site.urls)),
|
||||
|
||||
url(r'^admin/', include(wagtailadmin_urls)),
|
||||
url(r'^documents/', include(wagtaildocs_urls)),
|
||||
|
||||
# url(r'^search/$', search_views.search, name='search'),
|
||||
|
||||
]
|
||||
|
||||
|
||||
if settings.DEBUG:
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
# Serve static and media files from development server
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
# Add views for testing 404 and 500 templates
|
||||
urlpatterns += [
|
||||
url(r'^test404/$', TemplateView.as_view(template_name='404.html')),
|
||||
url(r'^test500/$', TemplateView.as_view(template_name='500.html')),
|
||||
]
|
||||
|
||||
|
||||
urlpatterns += [
|
||||
url(r'', include(wagtail_urls)),
|
||||
]
|
|
@ -0,0 +1,19 @@
|
|||
"""
|
||||
WSGI config for bakerydemo 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.8/howto/deployment/wsgi/
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from whitenoise.django import DjangoWhiteNoise
|
||||
|
||||
from django.core.wsgi import get_wsgi_application
|
||||
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bakerydemo.settings.production")
|
||||
|
||||
application = DjangoWhiteNoise(get_wsgi_application())
|
|
@ -0,0 +1 @@
|
|||
python manage.py compress --settings bakerydemo.settings.production
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bakerydemo.settings")
|
||||
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
execute_from_command_line(sys.argv)
|
|
@ -0,0 +1,2 @@
|
|||
bakerydemo
|
||||
==================
|
|
@ -0,0 +1,17 @@
|
|||
Django==1.9.9
|
||||
psycopg2==2.6.1
|
||||
elasticsearch==1.2.0
|
||||
django-redis==4.3.0
|
||||
wagtail==1.5.3
|
||||
django-libsass==0.6
|
||||
libsass==0.8.3
|
||||
Pillow==2.9.0
|
||||
|
||||
# Development tools
|
||||
stellar==0.4.3
|
||||
|
||||
# Production dependencies
|
||||
dj-database-url==0.3.0
|
||||
whitenoise==2.0.4
|
||||
uwsgi==2.0.11.2
|
||||
ConcurrentLogHandler==0.9.1
|
|
@ -0,0 +1 @@
|
|||
python-3.5.0
|
|
@ -0,0 +1,6 @@
|
|||
logging: 30
|
||||
migrate_from_0_3_2: false
|
||||
project_name: bakerydemo
|
||||
stellar_url: postgresql+psycopg2:///stellar_data
|
||||
tracked_databases: [bakerydemo]
|
||||
url: postgresql+psycopg2:///template1
|
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
|
||||
PROJECT_NAME=$1
|
||||
|
||||
PROJECT_DIR=/vagrant
|
||||
VIRTUALENV_DIR=/home/vagrant/.virtualenvs/$PROJECT_NAME
|
||||
|
||||
PYTHON=$VIRTUALENV_DIR/bin/python
|
||||
PIP=$VIRTUALENV_DIR/bin/pip
|
||||
|
||||
|
||||
# Create database
|
||||
su - vagrant -c "createdb $PROJECT_NAME"
|
||||
|
||||
|
||||
# Virtualenv setup for project
|
||||
su - vagrant -c "virtualenv --python=python3 $VIRTUALENV_DIR"
|
||||
# Replace previous line with this if you are using Python 2
|
||||
# su - vagrant -c "virtualenv --python=python2 $VIRTUALENV_DIR"
|
||||
|
||||
su - vagrant -c "echo $PROJECT_DIR > $VIRTUALENV_DIR/.project"
|
||||
|
||||
|
||||
# Upgrade PIP
|
||||
su - vagrant -c "$PIP install --upgrade pip"
|
||||
|
||||
# Install PIP requirements
|
||||
su - vagrant -c "$PIP install -r $PROJECT_DIR/requirements.txt"
|
||||
|
||||
|
||||
# Set execute permissions on manage.py as they get lost if we build from a zip file
|
||||
chmod a+x $PROJECT_DIR/manage.py
|
||||
|
||||
|
||||
# Run syncdb/migrate/update_index
|
||||
su - vagrant -c "$PYTHON $PROJECT_DIR/manage.py migrate --noinput && \
|
||||
$PYTHON $PROJECT_DIR/manage.py update_index"
|
||||
|
||||
|
||||
# Add a couple of aliases to manage.py into .bashrc
|
||||
cat << EOF >> /home/vagrant/.bashrc
|
||||
export PYTHONPATH=$PROJECT_DIR
|
||||
export DJANGO_SETTINGS_MODULE=$PROJECT_NAME.settings.dev
|
||||
|
||||
alias dj="django-admin.py"
|
||||
alias djrun="dj runserver 0.0.0.0:8000"
|
||||
|
||||
source $VIRTUALENV_DIR/bin/activate
|
||||
export PS1="[$PROJECT_NAME \W]\\$ "
|
||||
cd $PROJECT_DIR
|
||||
EOF
|
Ładowanie…
Reference in New Issue