Created
October 17, 2014 21:15
-
-
Save WnP/b61745fc66c60596ff25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define TEMPLATE | |
{% load cms_tags sekizai_tags placeholder_attr %} | |
<html> | |
<head> | |
<title>{% page_attribute "page_title" %}</title> | |
{% render_block "css" %} | |
<style> | |
div.dccb-test {width:400px;height:400px} | |
</style> | |
</head> | |
<body> | |
{% cms_toolbar %} | |
<div class="dccb-test" style="{% placeholder_attr 'My Background Css Placeholder' 'CssBackground' 'css_background' %}"> | |
{% placeholder 'My Background Css Placeholder' %} | |
</div> | |
{% render_block "js" %} | |
</body> | |
</html> | |
endef | |
export TEMPLATE | |
all: message | |
message: | |
@echo "nothing to compil, use \`make dev\` to build development environment" | |
clean: | |
rm -rf venv manage.py dev_project project.db static media | |
dev: | |
virtualenv2 venv && . ./venv/bin/activate && pip install djangocms-installer && pip install -e djangocms-placeholder-attr && pip install -e djangocms-css-background && djangocms -p . dev_project | |
echo "INSTALLED_APPS += ('filer', )" >> dev_project/settings.py | |
echo "INSTALLED_APPS += ('easy_thumbnails', )" >> dev_project/settings.py | |
echo "INSTALLED_APPS += ('djangocms-placeholder-attr', )" >> dev_project/settings.py | |
echo "INSTALLED_APPS += ('djangocms-css-background', )" >> dev_project/settings.py | |
. ./venv/bin/activate && python manage.py syncdb && python manage.py migrate | |
echo "$$TEMPLATE" > dev_project/templates/template_1.html | |
echo "CMS_TEMPLATES += (('template_1.html', 'djangocms-css-background Test Template'), )" >> dev_project/settings.py | |
@printf '_%.0s' {1..80} | |
@printf "\n\nWARNING: You must activate you virtualenv using: . ./venv/bin/activate" | |
@printf "\nGet into '.' directory and type 'python manage.py runserver' to start your project\n" | |
@printf '_%.0s' {1..80} | |
@printf '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Makefile for djangocms-css-background and djangocms-placeholder-attr
use for development prupose, you must have the folowing structure to work with:
$ make dev
will setup a full functionnal django-cms environement -in a virtualenv- with djangocms-placeholder-attr and djangocms-css-background installed in development mode, a template named djangocms-css-background Test Template is generated and registred, which help you to quickly works on the pruposemake clean
will remove all dev files uncluded the virtualenv