forked from nephila/djangocms-page-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cms_helper.py
executable file
·89 lines (74 loc) · 2.03 KB
/
cms_helper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env python
from tempfile import mkdtemp
def gettext(s):
return s # NOQA
HELPER_SETTINGS = dict(
NOSE_ARGS=[
"-s",
],
CMS_CONFIRM_VERSION4=True,
ROOT_URLCONF="tests.test_utils.urls",
INSTALLED_APPS=[
"easy_thumbnails",
"filer",
"taggit",
"taggit_autosuggest",
"meta",
# "djangocms_page_tags",
"tests.test_utils",
],
LANGUAGE_CODE="en",
LANGUAGES=(
("en", gettext("English")),
("fr-fr", gettext("French")),
("it", gettext("Italiano")),
),
CMS_LANGUAGES={
1: [
{
"code": "en",
"name": gettext("English"),
"public": True,
},
{
"code": "it",
"name": gettext("Italiano"),
"public": True,
},
{
"code": "fr-fr",
"name": gettext("French"),
"public": True,
},
],
"default": {
"hide_untranslated": False,
},
},
CMS_TEMPLATES=(("page_meta.html", "page"),),
META_SITE_PROTOCOL="http",
META_SITE_DOMAIN="example.com",
META_USE_OG_PROPERTIES=True,
META_USE_TWITTER_PROPERTIES=True,
META_USE_SCHEMAORG_PROPERTIES=True,
THUMBNAIL_PROCESSORS=(
"easy_thumbnails.processors.colorspace",
"easy_thumbnails.processors.autocrop",
"filer.thumbnail_processors.scale_and_crop_with_subject_location",
"easy_thumbnails.processors.filters",
),
CACHES={"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}},
FILE_UPLOAD_TEMP_DIR=mkdtemp(),
)
def run():
from app_helper import runner
runner.cms("djangocms_page_meta")
def setup():
import sys
from app_helper import runner
runner.setup("djangocms_page_meta", sys.modules[__name__], use_cms=True)
if __name__ == "__main__":
run()
if __name__ == "cms_helper":
# this is needed to run cms_helper in pycharm
setup()