Exemplo n.º 1
0
def root_page():
    """
    Get the global Wagtail root page (cleared of any subpages it might have)
    :return: Root page
    :rtype: wagtail.wagtailcore.models.Page
    """
    try:
        page = Page.objects.get(slug="root", depth=1)
    except Page.DoesNotExist:  # pragma: no cover
        page = Page.objects.create(
            title="Root",
            slug='root',
            content_type=ContentType.objects.get_for_model(Page),
            path='0001',
            depth=1,
            numchild=1,
            url_path='/',
        )

    for child in page.get_children():  # pragma: no cover
        child.delete()
    page.numchild = 0
    page.save(update_fields=("numchild", ))

    site = Site.objects.first()
    if not site:  # pragma: no cover
        site = Site()
    site.root_page = page
    site.is_default_site = True
    site.save()

    return page
Exemplo n.º 2
0
    def test_duplicate_slug(self):
        try:
            from wagtail.core.models import Site
        except ImportError:
            from wagtail.wagtailcore.models import Site
        # Create a test Site with a root page
        root = models.TestRootPage(title='title', depth=1, path='0001', slug_en='slug_en', slug_de='slug_de')
        root.save()

        site = Site(root_page=root)
        site.save()

        # Add children to the root
        child = root.add_child(
            instance=models.TestSlugPage1(title='child1', slug_de='child', slug_en='child-en', depth=2, path='00010001')
        )

        child2 = root.add_child(
            instance=models.TestSlugPage2(title='child2', slug_de='child-2', slug_en='child2-en', depth=2,
                                          path='00010002')
        )

        # Clean should work fine as the two slugs are different
        child2.clean()

        # Make the slug equal to test if the duplicate is detected
        child2.slug_de = 'child'
        self.assertRaises(ValidationError, child2.clean)
        child2.slug_de = 'child-2'

        # Make the translated slug equal to test if the duplicate is detected
        child2.slug_en = 'child-en'
        self.assertRaises(ValidationError, child2.clean)
Exemplo n.º 3
0
def django_db_setup(django_db_setup, django_db_blocker):
    with django_db_blocker.unblock():
        root_page = Page(title='test', path='test', depth=1)
        root_page.save()
        site = Site(hostname='www.example.com', root_page=root_page)
        site.save()
        count_settings = AnimalCountSettings(site_id=site.id)
        count_settings.save()
Exemplo n.º 4
0
 def test_site_name_default(self):
     site = Site(
         hostname="example.com",
         port=80,
         site_name="example dot com",
         is_default_site=True,
     )
     self.assertEqual(site.__str__(), "example dot com [default]")
Exemplo n.º 5
0
    def test_relative_url(self):
        try:
            from wagtail.core.models import Site
        except ImportError:
            from wagtail.wagtailcore.models import Site
        # Create a test Site with a root page
        root = models.TestRootPage(title='title slugurl',
                                   depth=1,
                                   path='0004',
                                   slug_en='title_slugurl_en',
                                   slug_de='title_slugurl_de')
        root.save()
        site = Site(root_page=root)
        site.save()

        # Add children to the root
        child = root.add_child(
            instance=models.TestSlugPage1(title='child1 slugurl',
                                          slug_en='child-slugurl-en',
                                          slug_de='child-slugurl-de',
                                          depth=2,
                                          path='00040001'))
        child.save_revision().publish()

        url_1_de = child.relative_url(site)
        self.assertEqual(
            url_1_de, '/de/child-slugurl-de/',
            'When using the default language, slugurl produces the wrong url.')

        trans_real.activate('en')

        url_1_en = child.relative_url(site)
        self.assertEqual(
            url_1_en, '/en/child-slugurl-en/',
            'When using non-default language, slugurl produces the wrong url.')

        # Add children using non-default language
        child2 = root.add_child(
            instance=models.TestSlugPage2(title='child2 slugurl',
                                          title_de='child2 slugurl DE',
                                          slug_de='child2-slugurl-de',
                                          slug_en='child2-slugurl-en',
                                          depth=2,
                                          path='00040002'))
        child2.save_revision().publish()

        url_2_en = child2.relative_url(site)
        self.assertEqual(
            url_2_en, '/en/child2-slugurl-en/',
            'When using non-default language, slugurl produces the wrong url.')

        trans_real.activate('de')

        url_2_de = child2.relative_url(site)
        self.assertEqual(
            url_2_de, '/de/child2-slugurl-de/',
            'When using non-default language, slugurl produces the wrong url.')
Exemplo n.º 6
0
    def test_oops_there_is_more_than_one(self):
        Site.objects.create(hostname='example.com', is_default_site=True,
                            root_page=Page.objects.get(pk=2))

        site = Site(hostname='test.com', is_default_site=True,
                    root_page=Page.objects.get(pk=2))
        with self.assertRaises(Site.MultipleObjectsReturned):
            # If there already are multiple default sites, you're in trouble
            site.clean_fields()
Exemplo n.º 7
0
def home_page():
    rp = root_page()
    rp.get_children().delete()
    hp = root_page().add_child(
        instance=FrontPage(title='Test Home', live=True))
    site = Site(hostname='localhost',
                is_default_site=True,
                port=80,
                site_name='Test site',
                root_page=hp)
    site.save()
    return hp
Exemplo n.º 8
0
    def setUp(self) -> None:
        self.user = get_user_model().objects.create_user(
            'Test User', '*****@*****.**', 'password')
        self.user.groups.add(Group.objects.get(name="Moderators"))
        self.client.force_login(self.user)

        self.default_site = Site.objects.get(id=1)
        self.root_page = Page.objects.get(id=1)
        self.training_root_page = Page(owner=self.user,
                                       slug='Test',
                                       title='Test')
        self.root_page.add_sibling(instance=self.training_root_page)
        PageViewRestriction.objects.create(page=self.training_root_page,
                                           restriction_type='password',
                                           password='******')
        self.training_root_page.save_revision().publish()
        self.training_site = Site(hostname='localhost',
                                  port='8000',
                                  site_name='Training',
                                  root_page=self.training_root_page)
        self.training_site.save()

        self.factory = RequestFactory()
Exemplo n.º 9
0
 def test_root_url_custom_port(self):
     site = Site(hostname="example.com", port=8000)
     self.assertEqual(site.root_url, "http://example.com:8000")
Exemplo n.º 10
0
 def test_root_url_https(self):
     site = Site(hostname="example.com", port=443)
     self.assertEqual(site.root_url, "https://example.com")
Exemplo n.º 11
0
 def test_there_can_only_be_one(self):
     site = Site(hostname="test.com",
                 is_default_site=True,
                 root_page=Page.objects.get(pk=2))
     with self.assertRaises(ValidationError):
         site.clean_fields()
Exemplo n.º 12
0
 def test_no_site_name_not_default_port_n(self):
     site = Site(hostname='example.com', port=8080, is_default_site=False)
     self.assertEqual(site.__str__(), 'example.com:8080')
Exemplo n.º 13
0
 def test_no_site_name_default_port_80(self):
     site = Site(hostname='example.com', port=80, is_default_site=True)
     self.assertEqual(site.__str__(), 'example.com [default]')
Exemplo n.º 14
0
 def test_site_name_not_default(self):
     site = Site(hostname='example.com', port=80, site_name='example dot com', is_default_site=False)
     self.assertEqual(site.__str__(), 'example dot com')
Exemplo n.º 15
0
    title="Home|ME|IITG",
    slug=
    "mech",  # Assuming there are no slugs so no need to check if its available
    seo_title="Mechanical Engineering · IITG",
)
root.add_child(instance=home)
root.save()

sites = Site.objects.all()
for site in sites:
    site.delete()

home_site = Site(
    hostname='127.0.0.1',
    port=8000,
    site_name='Home',
    root_page=home,
    is_default_site=True,
)
home_site.save()

if CategoriesHome.objects.all().count() > 0:
    for interestcategoryhomepage in CategoriesHome.objects.all():
        interestcategoryhomepage.delete()
if Categories.objects.all().count() > 0:
    for interestcategory in Categories.objects.all():
        interestcategory.delete()
interestcateogryhome = CategoriesHome(
    title='Research Interest Categories',
    slug='research_interest_divisions',
)
Exemplo n.º 16
0
 def test_no_site_name_default_port_n(self):
     site = Site(hostname="example.com", port=8080, is_default_site=True)
     self.assertEqual(site.__str__(), "example.com:8080 [default]")
Exemplo n.º 17
0
def get_fake_site():
    site = Site()
    site.id = 0
    site.pk = 0
    return site
Exemplo n.º 18
0
 def test_no_site_name_not_default_port_80(self):
     site = Site(hostname="example.com", port=80, is_default_site=False)
     self.assertEqual(site.__str__(), "example.com")
Exemplo n.º 19
0
 def test_root_url_http(self):
     site = Site(hostname='example.com', port=80)
     self.assertEqual(site.root_url, 'http://example.com')
Exemplo n.º 20
0
 def test_natural_key(self):
     site = Site(hostname="example.com", port=8080)
     self.assertEqual(site.natural_key(), ("example.com", 8080))
    def handle(self, *args, **options):
        # based on  see https://www.codista.com/de/blog/create-wagtail-pages-programmatically/

        self.delete_all_pages()

        root = Page.get_first_root_node()
        translatable_root_page = TranslatableSiteRootPage(title="Trans Root")
        root.add_child(instance=translatable_root_page)

        first_site = Site.objects.first()
        if not first_site:
            first_site = Site(
                hostname="localhost",
                port=80,
                root_page=translatable_root_page,
                is_default_site=True,
            )
            first_site.save()

        first_site.root_page = translatable_root_page
        first_site.save()

        # language_en = Language.objects.get(code='en')
        # language_de = Language.objects.get(code='de')

        # --- upload images ---

        images = {
            "bg-elements.png": -1,
            "benefit-1.png": -1,
            "benefit-3.png": -1,
            "benefit-2.png": -1,
            "illu-apps.png": -1,
            "feature-bullet.png": -1,
            "placeholder.png": -1,
            "todologo-circle.png": -1,
            "contact.png": -1,
        }

        webapp_url = clean_url_from_host_port(settings.CSD_WEBAPP_HOST,
                                              settings.CSD_WEBAPP_PORT)

        for key in images.keys():
            # we don't use the storage class here because we want to access the
            # source code in the file system locally
            file_path = settings.APPS_DIR.path("static_src/images/" + key)
            with open(file_path, "rb") as bg_file:
                image_file = ImageFile(bg_file, name=key)
                image = Image(title="key", file=image_file)
                image.save()
            images[key] = image.pk

        # we need to set is_lazy to tro, so that we can use a plain dict for
        # stream_data otherwise it fails weirdly
        home_page_en = FlexPage(title="Home English",
                                slug="en",
                                show_in_menus=True)
        home_page_en.body.is_lazy = True
        home_page_en.body.stream_data = [
            {
                "type": "hero",
                "value": {
                    "css_classes":
                    "",
                    "background_color":
                    "primary-A200",
                    "background_image":
                    images["bg-elements.png"],
                    "primary_content": [
                        {
                            "type": "headline",
                            "value": "Simply get your stuff done.",
                        },
                        {
                            "type":
                            "subtitle",
                            "value":
                            "Create, check off and delete your tasks and elements. Nothing more. Nothing less. Believe us: You have never got this much stuff done.",
                        },
                        {
                            "type": "button",
                            "value": {
                                "button_text": "Get the app",
                                "link": f"{webapp_url}",
                                "flat_button": True,
                            },
                        },
                    ],
                    "secondary_content": [],
                },
            },
            {
                "type": "layout_3_col",
                "value": {
                    "css_classes":
                    "",
                    "column_1": [
                        {
                            "type": "headline",
                            "value": "Keep track of your stuff."
                        },
                        {
                            "type": "image",
                            "value": images["benefit-1.png"]
                        },
                        {
                            "type":
                            "text",
                            "value":
                            "Write new todos and never forgot a task again. What else would you want from a todo app really?",
                        },
                    ],
                    "column_2": [
                        {
                            "type": "headline",
                            "value": "Actually do the stuff."
                        },
                        {
                            "type": "image",
                            "value": images["benefit-2.png"]
                        },
                        {
                            "type":
                            "text",
                            "value":
                            "Write your tasks down, do the tasks and then check them off. Most satisfying feeling ever.",
                        },
                    ],
                    "column_3": [
                        {
                            "type": "headline",
                            "value": "Have more time for real stuff."
                        },
                        {
                            "type": "image",
                            "value": images["benefit-3.png"]
                        },
                        {
                            "type":
                            "text",
                            "value":
                            "Don’t spend your time with hundreds of options. Spend it on important things instead.",
                        },
                    ],
                },
            },
            {
                "type": "layout_1_col_center",
                "value": {
                    "css_classes":
                    "vsp-remove-padding-bottom",
                    "column": [
                        {
                            "type": "headline",
                            "value": "You never got that much stuff done.",
                        },
                        {
                            "type":
                            "text",
                            "value":
                            "A todo list is perfect for all your tasks. Doing laundry? Going shopping? Cleaning your cat’s litter box? Whatever it is: You will get it done.",
                        },
                    ],
                },
            },
            {
                "type": "layout_1_col_wide",
                "value": {
                    "css_classes":
                    "vsp-remove-padding-top",
                    "align":
                    "center",
                    "column": [
                        {
                            "type": "image",
                            "value": images["illu-apps.png"]
                        },
                        {
                            "type":
                            "richtext",
                            "value":
                            "<h2>Secure from the get go.<br />Scalable into infinity and beyond.<br />Updated within minutes.</h2>",
                        },
                    ],
                },
            },
            {
                "type": "layout_flex",
                "value": {
                    "css_classes":
                    "",
                    "id":
                    "features",
                    "align":
                    "start",
                    "elements": [
                        [
                            {
                                "type":
                                "richtext",
                                "value":
                                "<h5>Features</h5><h1>We&#x27;ve got your stuff covered.</h1><p>You want to write down tasks and keep track of them and – hopefully – check them. Let us help you with that. </p><p></p><p></p>",
                            },
                            {
                                "type": "button",
                                "value": {
                                    "button_text": "Get the app",
                                    "link": f"{webapp_url}",
                                    "flat_button": True,
                                },
                            },
                        ],
                        [
                            {
                                "type": "image",
                                "value": images["placeholder.png"]
                            },
                            {
                                "type":
                                "richtext",
                                "value":
                                "<br><h4>Add new stuff.</h4><p>You can simply add new todos to the app whenever you want. And let’s be honest for a second. What else would really need from it?</p>",
                            },
                        ],
                        [
                            {
                                "type": "image",
                                "value": images["placeholder.png"]
                            },
                            {
                                "type":
                                "richtext",
                                "value":
                                "<br><h4>Keep track of your stuff.</h4><p>Never forget a task ever again. At least as long as it’s in your todo list. If you delete it, it’s not our fault.</p>",
                            },
                        ],
                        [
                            {
                                "type": "image",
                                "value": images["placeholder.png"]
                            },
                            {
                                "type":
                                "richtext",
                                "value":
                                "<br><h4>Search stuff you can’t find.</h4><p>Your list is getting too big? You can’t really keep track of things anymore? Don’t worry. There’s a search bar ready to go.</p>",
                            },
                        ],
                        [
                            {
                                "type": "image",
                                "value": images["placeholder.png"]
                            },
                            {
                                "type":
                                "richtext",
                                "value":
                                "<br><h4>Complete stuff.</h4><p>Make those sweet, sweet checkmarks and get rid of all the todos you have completed. We’re proud of you. And you should be, too!</p>",
                            },
                        ],
                        [
                            {
                                "type": "image",
                                "value": images["placeholder.png"]
                            },
                            {
                                "type":
                                "richtext",
                                "value":
                                "<br><h4>Enjoy your life after the stuff is done.</h4><p>You did it! You succesfully completed your todos. Now go ahead and enjoy your life. But do it quickly. The next todos are already waiting for you.</p>",
                            },
                        ],
                    ],
                },
            },
            {
                "type": "pricing",
                "value": {
                    "css_classes":
                    "",
                    "id":
                    "pricing",
                    "title":
                    "How much all of it even costs?",
                    "column_1": [
                        {
                            "type": "headline",
                            "value": "Basic"
                        },
                        {
                            "type": "feature_list",
                            "value": {
                                "features": [
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "You get a very nice first feature.",
                                    },
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "There’s a second feature as well!",
                                    },
                                    {
                                        "image": images["feature-bullet.png"],
                                        "title": "And a third one!",
                                    },
                                ]
                            },
                        },
                        {
                            "type":
                            "update_text",
                            "value":
                            "free updates for a year then <b>99€ / month</b> (optional)",
                        },
                        {
                            "type": "price_amount",
                            "value": {
                                "amount":
                                "15€",
                                "duration":
                                "per month",
                                "buy_now":
                                "or one time payment of 1.490,00€",
                                "button": [{
                                    "type": "button",
                                    "value": {
                                        "button_text":
                                        "This is also an option",
                                        "link": f"{webapp_url}",
                                        "flat_button": False,
                                    },
                                }],
                            },
                        },
                    ],
                    "column_2": [
                        {
                            "type": "headline",
                            "value": "Premium"
                        },
                        {
                            "type": "feature_list",
                            "value": {
                                "features": [
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "<b>All the Basic features are included already.</b>",
                                    },
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "The first premium feature is just really awesome.",
                                    },
                                    {
                                        "image": images["feature-bullet.png"],
                                        "title": "And the second one as well!",
                                    },
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "The third one will just make your jaw drop. ",
                                    },
                                ]
                            },
                        },
                        {
                            "type":
                            "update_text",
                            "value":
                            "free updates for a year then <b>99€ / month</b> (optional)",
                        },
                        {
                            "type": "price_amount",
                            "value": {
                                "amount":
                                "49€",
                                "duration":
                                "for 12 months",
                                "buy_now":
                                "or one time payment of 3.990,00€",
                                "button": [{
                                    "type": "button",
                                    "value": {
                                        "button_text": "Hey Choose this",
                                        "link": f"{webapp_url}",
                                        "flat_button": True,
                                    },
                                }],
                            },
                        },
                    ],
                    "column_3": [
                        {
                            "type": "headline",
                            "value": "Enterprise"
                        },
                        {
                            "type": "feature_list",
                            "value": {
                                "features": [
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "<b>Get the basic and premium stuff by default.</b>",
                                    },
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "This is it! The big one. The feature you’ve waited for.",
                                    },
                                    {
                                        "image": images["feature-bullet.png"],
                                        "title":
                                        "The second one is just dreamy.",
                                    },
                                    {
                                        "image":
                                        images["feature-bullet.png"],
                                        "title":
                                        "And the third one closes the deal for good. ",
                                    },
                                ]
                            },
                        },
                        {
                            "type":
                            "update_text",
                            "value":
                            "free updates for a year then <b>99€ / month</b> (optional)",
                        },
                        {
                            "type": "price_amount",
                            "value": {
                                "amount":
                                "99€",
                                "duration":
                                "per month",
                                "buy_now":
                                "or one time payment of 19.990,00€",
                                "button": [{
                                    "type": "button",
                                    "value": {
                                        "button_text":
                                        "This is also an option",
                                        "link": f"{webapp_url}",
                                        "flat_button": False,
                                    },
                                }],
                            },
                        },
                    ],
                    "additional_info": [
                        {
                            "type":
                            "title",
                            "value":
                            "Or maybe you just want to see what this is all about. Try out our preview!",
                        },
                        {
                            "type": "button",
                            "value": {
                                "button_text": "Get the app",
                                "link": f"{webapp_url}",
                                "flat_button": False,
                            },
                        },
                    ],
                },
            },
            {
                "type": "layout_4_col",
                "value": {
                    "css_classes":
                    "",
                    "align":
                    "center",
                    "title":
                    "Everything you could ask for.",
                    "column_1": [
                        {
                            "type": "image",
                            "value": images["todologo-circle.png"]
                        },
                        {
                            "type": "text",
                            "value":
                            "It’s fantastic, as this point makes clear.",
                        },
                    ],
                    "column_2": [
                        {
                            "type": "image",
                            "value": images["todologo-circle.png"]
                        },
                        {
                            "type": "text",
                            "value": "It’s great, tells this point.",
                        },
                    ],
                    "column_3": [
                        {
                            "type": "image",
                            "value": images["todologo-circle.png"]
                        },
                        {
                            "type": "text",
                            "value": "It’s marvelous, whispers the third one.",
                        },
                    ],
                    "column_4": [
                        {
                            "type": "image",
                            "value": images["todologo-circle.png"]
                        },
                        {
                            "type": "text",
                            "value":
                            "It’s ok. The last point isn’t as exited.",
                        },
                    ],
                },
            },
        ]

        translatable_root_page.add_child(instance=home_page_en)

        # -- TOS Page
        tos_page = FlexPage(title="Terms of Services",
                            slug="tos",
                            show_in_menus=True)
        tos_page.body.is_lazy = True
        tos_content_file = open(
            "webapp/website/example_content/terms_of_service.txt", "r")
        tos_content = tos_content_file.read()
        tos_page.body.stream_data = [{
            "type": "layout_1_col_wide",
            "value": {
                "align": "start",
                "column": [{
                    "type": "richtext",
                    "value": tos_content
                }],
            },
        }]
        home_page_en.add_child(instance=tos_page)

        # -- Privacy Policy Page
        privacy_page = FlexPage(title="Privacy Policy",
                                slug="privacy",
                                show_in_menus=True)
        privacy_page.body.is_lazy = True
        privacy_policy_content_file = open(
            "webapp/website/example_content/privacy_policy.txt", "r")
        privacy_policy_content = privacy_policy_content_file.read()
        privacy_page.body.stream_data = [{
            "type": "layout_1_col_wide",
            "value": {
                "align": "start",
                "column": [{
                    "type": "richtext",
                    "value": privacy_policy_content
                }],
            },
        }]
        home_page_en.add_child(instance=privacy_page)

        # -- Contact Page
        contact_page = FlexPage(title="Contact",
                                slug="contact",
                                show_in_menus=True)
        contact_page.body.is_lazy = True
        contact_page.body.stream_data = [{
            "type": "hero",
            "value": {
                "background_color":
                "primary-A100",
                # "background_image": images['bg-elements.png'],
                "primary_content": [
                    {
                        "type": "headline",
                        "value": "Interested in managing your todos with us?",
                    },
                    {
                        "type":
                        "richtext",
                        "value":
                        "<p><a href='mail:[email protected]'>[email protected]</a></p><p><a href='tel:+18505099090'>+18505099090</a></p><p>ARQITEQT<br> 2910 Kerry Forest Pkwy<br>#D4-217<br>32309 Tallahassee<br> </p>",
                    },
                ],
                "secondary_content": [{
                    "type": "image",
                    "value": images["contact.png"],
                }],
            },
        }]
        home_page_en.add_child(instance=contact_page)

        # -- Jobs Page
        jobs_page = FlexPage(title="Jobs", slug="jobs", show_in_menus=True)
        jobs_page.body.is_lazy = True
        jobs_page.body.stream_data = [{
            "type": "hero",
            "value": {
                "background_color":
                "primary-A100",
                # "background_image": images['bg-elements.png'],
                "primary_content": [
                    {
                        "type": "headline",
                        "value": "We are hiring",
                    },
                    {
                        "type":
                        "subtitle",
                        "value":
                        "At the moment we don't have any vacancies. but you are welcome to write us a few lines about why we absolutely should have you in our team.",
                    },
                ],
            },
        }]
        home_page_en.add_child(instance=jobs_page)

        # -- Imprint Page
        imprint_page = FlexPage(title="Imprint",
                                slug="imprint",
                                show_in_menus=True)
        imprint_page.body.is_lazy = True
        imprint_page.body.stream_data = [{
            "type": "layout_1_col_wide",
            "value": {
                "align":
                "start",
                "column": [{
                    "type":
                    "richtext",
                    "value":
                    "<h1>Imprint</h1><p></br></p><h3>Media owner of the website:</h3><p>ARQITEQT</br>2910 Kerry Forest Pkwy</br>#D4-217</br>32309 Tallahassee</br></br><a href='mail:[email protected]'>[email protected]</a></br><a href='+18505099090'>+18505099090</a></br></br>Head Office:  </br>Commercial Register Court: LG für ZRS Graz</br>UID: </br>Place of Jurisdiction: HG Graz</br> <a href='/en/privacy'>Privacy Policy</a> </p>",
                }],
            },
        }]
        home_page_en.add_child(instance=imprint_page)

        # -- Footer Snippet
        footer_en = Footer.objects.create(
            column_1="<p>Interested in<br/>working with us?</p>"
            '<p><a href="/en/contact">Get in touch.</a></p>',
            column_2="<p>ARQITEQT<br/>"
            "2910 Kerry Forest Pkwy<br/>"
            "#D4-217<br/>"
            "32309 Tallahassee<br/>"
            "</p><p>"
            '<a href="mail:[email protected]">[email protected]</a><br/>'
            '<a href="https://arqiteqt.io">https://arqiteqt.io</a><br/>'
            '<a href="tel:+18505099090">+18505099090</a></p>',
            column_3="<p>Interested in joining our team?"
            "</p><p>"
            '<a href="/en/jobs">'
            "See our job offerings</a></p>",
            copyright_info="ARQITEQT",
            language_code="en",
        )

        # -- add foooter menu

        footer_menu_en = FlatMenu(site=first_site,
                                  handle="footer_en",
                                  title="footer en")
        footer_menu_en.save()

        footer_menu_en_item_1 = FlatMenuItem.objects.create(
            menu=footer_menu_en, link_text="Imprint", link_page=imprint_page)
        footer_menu_en_item_2 = FlatMenuItem.objects.create(
            menu=footer_menu_en,
            link_text="Terms of Service",
            link_page=tos_page)

        footer_menu_en_item_3 = FlatMenuItem.objects.create(
            menu=footer_menu_en,
            link_text="Privacy Policy",
            link_page=privacy_page)

        # -- add header main menu

        header_main_menu_en = FlatMenu(site=first_site,
                                       handle="header_main_en",
                                       title="header main en")
        header_main_menu_en.save()

        header_main_menu_en_item_1 = FlatMenuItem.objects.create(
            menu=header_main_menu_en,
            link_text="Contact",
            link_page=home_page_en,
            url_append="contact",
        )
        header_main_menu_en_item_2 = FlatMenuItem.objects.create(
            menu=header_main_menu_en,
            link_text="Pricing",
            link_page=home_page_en,
            url_append="#pricing",
        )
        header_main_menu_en_item_3 = FlatMenuItem.objects.create(
            menu=header_main_menu_en,
            link_text="Features",
            link_page=home_page_en,
            url_append="#features",
        )

        # -- add header secondary menu

        header_secondary_menu_en = FlatMenu(site=first_site,
                                            handle="header_secondary_en",
                                            title="header secondary en")
        header_secondary_menu_en.save()

        header_secondary_menu_en_item_1 = FlatMenuItem.objects.create(
            menu=header_secondary_menu_en,
            link_text="Login",
            link_url=f"{webapp_url}/login",
        )
        header_secondary_menu_en_item_2 = FlatMenuItem.objects.create(
            menu=header_secondary_menu_en,
            link_text="Sign Up",
            link_url=f"{webapp_url}/signup",
        )

        self.stdout.write(
            self.style.SUCCESS("Successfully added example data"))