mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-10 16:24:49 +00:00
parent
f224e1ca2d
commit
05bcd96c28
11 changed files with 26 additions and 24 deletions
2
wagtail/project_template/.gitignore
vendored
2
wagtail/project_template/.gitignore
vendored
|
|
@ -4,4 +4,6 @@
|
|||
/*/*/settings/local.py
|
||||
/static/
|
||||
/media/
|
||||
/.vagrant/
|
||||
Vagrantfile.local
|
||||
/docs/_build/
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% templatetag openblock %} load static core_tags {% templatetag closeblock %}
|
||||
|
||||
{% templatetag openblock %} block body_class {% templatetag closeblock %}template-{% templatetag openvariable %} self|content_type_slugified {% templatetag closevariable %}{% templatetag openblock %} endblock {% templatetag closeblock %}
|
||||
{% templatetag openblock %} block body_class {% templatetag closeblock %}template-{% templatetag openvariable %} self|content_type|slugify {% templatetag closevariable %}{% templatetag openblock %} endblock {% templatetag closeblock %}
|
||||
|
||||
{% templatetag openblock %} block content {% templatetag closeblock %}
|
||||
<h1>Welcome to your new Wagtail site!</h1>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
from django import template
|
||||
from django.conf import settings
|
||||
from django.template.defaultfilters import slugify
|
||||
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
# Return the model name/"content type" as a css-friendly string e.g blog-page, news-listing-page
|
||||
# Usage: {% verbatim %}{{ self|content_type_slugified }}{% endverbatim %}
|
||||
# Return the model name/"content type" as a string e.g BlogPage, NewsListingPage.
|
||||
# Can be used with "slugify" to create CSS-friendly classnames
|
||||
# Usage: {% verbatim %}{{ self|content_type|slugify }}{% endverbatim %}
|
||||
@register.filter
|
||||
def content_type_slugified(model):
|
||||
return slugify(model.__class__.__name__)
|
||||
def content_type(model):
|
||||
return model.__class__.__name__
|
||||
|
|
|
|||
0
wagtail/project_template/project_name/manage.py
Normal file → Executable file
0
wagtail/project_template/project_name/manage.py
Normal file → Executable file
|
|
@ -12,7 +12,7 @@ from os.path import abspath, basename, dirname, join, normpath
|
|||
from sys import path
|
||||
|
||||
# Absolute filesystem path to the Django project directory:
|
||||
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
|
||||
DJANGO_ROOT = dirname(dirname(dirname(abspath(__file__))))
|
||||
|
||||
# Absolute filesystem path to the top-level project folder:
|
||||
PROJECT_ROOT = dirname(DJANGO_ROOT)
|
||||
|
|
@ -122,6 +122,10 @@ STATICFILES_FINDERS = (
|
|||
'compressor.finders.CompressorFinder',
|
||||
)
|
||||
|
||||
STATICFILES_DIRS = (
|
||||
join(DJANGO_ROOT, 'static'),
|
||||
)
|
||||
|
||||
MEDIA_ROOT = join(PROJECT_ROOT, 'media')
|
||||
MEDIA_URL = '/media/'
|
||||
|
||||
|
|
@ -151,7 +155,7 @@ TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
|
|||
)
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
normpath(join(PROJECT_ROOT, 'templates')),
|
||||
normpath(join(DJANGO_ROOT, 'templates')),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,11 @@
|
|||
-r requirements/dev.txt
|
||||
Django==1.6.5
|
||||
South==0.8.4
|
||||
psycopg2==2.5.2
|
||||
elasticsearch==1.1.1
|
||||
django-redis-cache==0.13.0
|
||||
django-celery==3.1.10
|
||||
wagtail==0.4.1
|
||||
|
||||
# Developer tools
|
||||
Fabric==1.9.0
|
||||
Sphinx==1.2.2
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
Django==1.6.5
|
||||
South==0.8.4
|
||||
psycopg2==2.5.2
|
||||
elasticsearch==1.1.1
|
||||
django-redis-cache==0.13.0
|
||||
django-celery==3.1.10
|
||||
wagtail==0.4
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
-r base.txt
|
||||
|
||||
Fabric==1.9.0
|
||||
Sphinx==1.2.2
|
||||
|
|
@ -1 +0,0 @@
|
|||
-r base.txt
|
||||
|
|
@ -1 +0,0 @@
|
|||
-r base.txt
|
||||
|
|
@ -17,7 +17,7 @@ createdb -Upostgres $PROJECT_NAME
|
|||
# Virtualenv setup for project
|
||||
su - vagrant -c "/usr/local/bin/virtualenv $VIRTUALENV_DIR && \
|
||||
echo $PROJECT_DIR > $VIRTUALENV_DIR/.project && \
|
||||
PIP_DOWNLOAD_CACHE=/home/vagrant/.pip_download_cache $PIP install -r $PROJECT_DIR/requirements/dev.txt"
|
||||
PIP_DOWNLOAD_CACHE=/home/vagrant/.pip_download_cache $PIP install -r $PROJECT_DIR/requirements.txt"
|
||||
|
||||
echo "workon $PROJECT_NAME" >> /home/vagrant/.bashrc
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue