From 0b54a7205c5015f91691279ffe88905cb5132e00 Mon Sep 17 00:00:00 2001 From: Edd Baldry Date: Thu, 9 Feb 2017 12:20:21 +0000 Subject: [PATCH] Add initial demo scaffold without any site apps --- .DS_Store | Bin 0 -> 6148 bytes .../default/virtualbox/action_provision | 1 + .../default/virtualbox/action_set_name | 1 + .../machines/default/virtualbox/creator_uid | 1 + .vagrant/machines/default/virtualbox/id | 1 + .../machines/default/virtualbox/index_uuid | 1 + .../default/virtualbox/synced_folders | 1 + Procfile | 1 + Vagrantfile | 76 ++++++ bakerydemo/.DS_Store | Bin 0 -> 6148 bytes bakerydemo/__init__.py | 0 .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 114 bytes bakerydemo/__pycache__/urls.cpython-34.pyc | Bin 0 -> 1057 bytes bakerydemo/settings/.gitignore | 1 + bakerydemo/settings/__init__.py | 1 + .../__pycache__/__init__.cpython-34.pyc | Bin 0 -> 145 bytes .../settings/__pycache__/base.cpython-34.pyc | Bin 0 -> 3615 bytes .../settings/__pycache__/dev.cpython-34.pyc | Bin 0 -> 472 bytes bakerydemo/settings/base.py | 189 +++++++++++++++ bakerydemo/settings/dev.py | 21 ++ bakerydemo/settings/production.py | 217 ++++++++++++++++++ bakerydemo/static/css/main.scss | 23 ++ bakerydemo/static/js/main.js | 0 bakerydemo/templates/404.html | 11 + bakerydemo/templates/500.html | 17 ++ bakerydemo/templates/base.html | 38 +++ bakerydemo/urls.py | 41 ++++ bakerydemo/wsgi.py | 19 ++ bin/post_compile | 1 + docs/.DS_Store | Bin 0 -> 6148 bytes manage.py | 10 + readme.md | 2 + requirements.txt | 17 ++ runtime.txt | 1 + stellar.yaml | 6 + vagrant/provision.sh | 51 ++++ 36 files changed, 749 insertions(+) create mode 100644 .DS_Store create mode 100644 .vagrant/machines/default/virtualbox/action_provision create mode 100644 .vagrant/machines/default/virtualbox/action_set_name create mode 100644 .vagrant/machines/default/virtualbox/creator_uid create mode 100644 .vagrant/machines/default/virtualbox/id create mode 100644 .vagrant/machines/default/virtualbox/index_uuid create mode 100644 .vagrant/machines/default/virtualbox/synced_folders create mode 100644 Procfile create mode 100644 Vagrantfile create mode 100644 bakerydemo/.DS_Store create mode 100644 bakerydemo/__init__.py create mode 100644 bakerydemo/__pycache__/__init__.cpython-34.pyc create mode 100644 bakerydemo/__pycache__/urls.cpython-34.pyc create mode 100644 bakerydemo/settings/.gitignore create mode 100644 bakerydemo/settings/__init__.py create mode 100644 bakerydemo/settings/__pycache__/__init__.cpython-34.pyc create mode 100644 bakerydemo/settings/__pycache__/base.cpython-34.pyc create mode 100644 bakerydemo/settings/__pycache__/dev.cpython-34.pyc create mode 100644 bakerydemo/settings/base.py create mode 100644 bakerydemo/settings/dev.py create mode 100644 bakerydemo/settings/production.py create mode 100644 bakerydemo/static/css/main.scss create mode 100644 bakerydemo/static/js/main.js create mode 100644 bakerydemo/templates/404.html create mode 100644 bakerydemo/templates/500.html create mode 100644 bakerydemo/templates/base.html create mode 100644 bakerydemo/urls.py create mode 100644 bakerydemo/wsgi.py create mode 100644 bin/post_compile create mode 100644 docs/.DS_Store create mode 100755 manage.py create mode 100644 readme.md create mode 100644 requirements.txt create mode 100644 runtime.txt create mode 100644 stellar.yaml create mode 100755 vagrant/provision.sh diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 "vagrant/provision.sh", :args => "bakerydemo" + + # Enable agent forwarding over SSH connections. + config.ssh.forward_agent = true +end diff --git a/bakerydemo/.DS_Store b/bakerydemo/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0@H4Bs3xQfp!l=ydVT<(}V;}8XH2EXq7cyNQsllaW}26 z`y2cL{tr)if7}MR$e1K=i?lR~J$G zOy`RZxTdO7b*7r0jY5_%5zRzhyXtRucV54o9v!^N8wEVr-#^T2em2$WZxDSYGt-}Y z<1;@Lej>-m{ud@L0>;y^Zp7&HB6pwhG+4y!xw_8C9;vBMJmOjEC0=!4b;+Ps*O+*A Oo7}f;G9V8foBRchSrhyK literal 0 HcmV?d00001 diff --git a/bakerydemo/settings/.gitignore b/bakerydemo/settings/.gitignore new file mode 100644 index 0000000..75276c8 --- /dev/null +++ b/bakerydemo/settings/.gitignore @@ -0,0 +1 @@ +/local.py diff --git a/bakerydemo/settings/__init__.py b/bakerydemo/settings/__init__.py new file mode 100644 index 0000000..c787328 --- /dev/null +++ b/bakerydemo/settings/__init__.py @@ -0,0 +1 @@ +from .dev import * diff --git a/bakerydemo/settings/__pycache__/__init__.cpython-34.pyc b/bakerydemo/settings/__pycache__/__init__.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae2e163c49e829440f804f1d5b8fb927751dbba6 GIT binary patch literal 145 zcmaFI!^_1NGbcirfq~&M5W@izkmUfx#e6^_1&A0Kau^swQkWQmHJM*B0tGc0Z!v25 z0ZHbR)UuTfMJzxuF!4)6zbrAmC^4@@KPfRgwWu;BH8)?sIJKlCGcUbZKR!M)FS8^* YUaz3?7Kcr4eoARhsvXF{VjyM!0Q3JL+W-In literal 0 HcmV?d00001 diff --git a/bakerydemo/settings/__pycache__/base.cpython-34.pyc b/bakerydemo/settings/__pycache__/base.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5a3fb580eed367cd4b858705887938c30583e46 GIT binary patch literal 3615 zcmb7GOLN;s5^jhdJX7@K-Yj?2YLhOI?$UyZ^39C2)b+l{RrsCKyL&6 z1n8$g{{-|ipbZ$+fFR)KK-U&9C;@1b%VcF~StUJ{TMKr5>VvzJdEDSAo#2Y7G&=?x8S#Uv_<2C%iJ7Z=j)$9ArWq}bg z+8ACmHfiFvZBWN@8$2|EFtgljj5z`|GTa^MvGf4F_Yl_c0@koxjNlld<+%;~4^J(O zY1!-^roif_Vd(QG%_j9sE~POh8JM2aWNs4yo1y1hCT~u1Zl>_zDQldJZM$JxJZyL; z)0zyIVjyM(jb9CW%=rHkD_|!xf&L?|UN_o2H%6gh*^=qGVPFlVY|WVwn5USr-*My&u@=Fxgi!<-?b^Dx{B*}QbjS-_)PISB4rzRwW*dQKrYo(pI> z#t5PFd8CESm6L4$9I%P|OqLywGTXGrJY)f>zZal4F>J{Jg?JMN-|zd5;j!qbW`ykG3$fZv&`i7%{bN%J~PbM*a4(hdx7Dwo}b)=8Ncn^ITXib zHj;*id&Yb>XMTBEW_|kE4Vv-$VA{o`abWYPndKWY$G5SONkdGOxpdNKq;}HN2AP`2 zl^^8RbEVskYZDhv7TRiG8^l%l=tvjS=&L+xayH+DI(7jQIr9R`WNlsg*oSW!Q z7LE?54Ei1qM|i(~v2~wcn4Uj+5SNwizS>nteF_#Ybmc=Ou26PjjO{Qw$Yq|C=^LD% zdjZw4Sz9!TDIH^LlS9#J$05@!$FdD^BVVKzUJyNfU!+6JwVbijVeTkAo%(lf1ap3u^+3{TJxpSL~@7hVPl1?m_V#}BIuybh_ z*l3--L=xpY!BtMO@3)h;ju%*rXO3S?`}8F`R-Co&)QFT*xTxApCrz^G;QceAN;7#j z-!6shP1t<1%}vhVX3bl-tszI+Bn=0FiAe|1rzvf^xYb-T4fB*q;xhA=m`1BR4<1SP z@w4+}_u->&<7%hZlEoQ~>(7;+^rODAr@o3le;35Iu**s9^o+HV6Uv!Cc)Z{n z;VB++D{!#^#ua186G>Iq#XCmV$qqKGGFIv2I zsJ7c3<)z$L(!>=lUhemL1O2$)Y4y5$@xqyBxp8fv93FM#0jjUP)b>^3-BB~5YHfKS zix678As-J8^dn^8Wv}1XU&tL5mA$?euXN<@{;|A|ae8e90o6lAC%vu`SC26{b?0$6 zoppBZcjK~<4M=<)vmL0dJ+-4~`kvqgp{~seMT?A=Qi(1ykL%e2D~RidN?Vmvc`coz zn5?&Yhq$wvCiYj%5g%d7ExC1|XyoQgd4C|Q9Ziw@tph!4(i-_Nlk1u~P;}8~eurRF zY?2t>e%buh7zKtKHmCh)`pa%;a3=W|arHa=-7>b>(3Mo-URUwE0LRx?b zfnrtws=;TfD;RK1O^7t0Rfu$;Wrz%*7DOf->i?FD5dKWgKxZXbTOcNY5E>^4o@fPv zX6;QGfF_dYOZcWHki~~#=soy>G$@Bc05=+qQ@P#wYPVFjPo;L=J9g)I zvCOjVmE**GPU0m`v#W2dR_kcfUnE&@d(H*3H)IvtGcsSZgr-VLQXVrK=W_Q$^_vA@ zDg&aJ8!AhEMp7n?8{B=omE{l*hJ820fwThL8{u$zkH@m=`5_+pZhz_xgQ(PX13Y~k z^<@nYT(3Xvy1jes-$>)#nXGu5Ef*OUf{ParpYmfloi3d{SqPG3&Wx;?I8e6XPRg=u nl`K++vc0`M$kO$O(_PHI=MPKI6|o|=a0sD}Omh7NX< literal 0 HcmV?d00001 diff --git a/bakerydemo/settings/base.py b/bakerydemo/settings/base.py new file mode 100644 index 0000000..d4fc762 --- /dev/null +++ b/bakerydemo/settings/base.py @@ -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" diff --git a/bakerydemo/settings/dev.py b/bakerydemo/settings/dev.py new file mode 100644 index 0000000..8d0a7f4 --- /dev/null +++ b/bakerydemo/settings/dev.py @@ -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 diff --git a/bakerydemo/settings/production.py b/bakerydemo/settings/production.py new file mode 100644 index 0000000..a94a2ab --- /dev/null +++ b/bakerydemo/settings/production.py @@ -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 diff --git a/bakerydemo/static/css/main.scss b/bakerydemo/static/css/main.scss new file mode 100644 index 0000000..439cbf1 --- /dev/null +++ b/bakerydemo/static/css/main.scss @@ -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%; +} diff --git a/bakerydemo/static/js/main.js b/bakerydemo/static/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/bakerydemo/templates/404.html b/bakerydemo/templates/404.html new file mode 100644 index 0000000..c6418c4 --- /dev/null +++ b/bakerydemo/templates/404.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block title %}404 - Page not found{% endblock %} + +{% block body_class %}template-404{% endblock %} + +{% block content %} +

Page not found

+ +

Sorry, this page could not be found.

+{% endblock %} diff --git a/bakerydemo/templates/500.html b/bakerydemo/templates/500.html new file mode 100644 index 0000000..2a5be4c --- /dev/null +++ b/bakerydemo/templates/500.html @@ -0,0 +1,17 @@ + + + + + + + + + Internal server error + + + +

Internal server error

+ +

Sorry, there seems to be an error. Please try again soon.

+ + diff --git a/bakerydemo/templates/base.html b/bakerydemo/templates/base.html new file mode 100644 index 0000000..0ceb4d4 --- /dev/null +++ b/bakerydemo/templates/base.html @@ -0,0 +1,38 @@ +{% load compress static wagtailuserbar %} + + + + + + + + + + {% block title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock %}{% block title_suffix %}{% endblock %} + + + + {% compress css %} + + {% endcompress %} + + {% block extra_css %} + + {% endblock %} + + + + {% wagtailuserbar %} + + {% block content %}{% endblock %} + + {% compress js %} + + {% endcompress %} + + {% block extra_js %} + + {% endblock %} + + + diff --git a/bakerydemo/urls.py b/bakerydemo/urls.py new file mode 100644 index 0000000..45bcf72 --- /dev/null +++ b/bakerydemo/urls.py @@ -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)), +] diff --git a/bakerydemo/wsgi.py b/bakerydemo/wsgi.py new file mode 100644 index 0000000..05563c2 --- /dev/null +++ b/bakerydemo/wsgi.py @@ -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()) diff --git a/bin/post_compile b/bin/post_compile new file mode 100644 index 0000000..197cf6b --- /dev/null +++ b/bin/post_compile @@ -0,0 +1 @@ +python manage.py compress --settings bakerydemo.settings.production diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 $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