This fork by rebane2001 is an improved version of the script!
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
mkdir mydumbproject | |
cd mydumbproject | |
python3 -m venv .venv | |
. .venv/bin/activate | |
python3 -m pip install django-cms | |
djangocms mydumbproject # will ask to type superuser name/email/password | |
python3 mydumbproject/manage.py runserver 0.0.0.0:8000 |
The script was not working anymore, so here's an official blog post for installing djangocms in a few commands.
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
tail -q -n +0 -f \ | |
/var/log/apache2/logs-for-website-1.log \ | |
/var/log/apache2/logs-for-website-2.log \ | |
/var/log/apache2/logs-for-website-3.log \ | |
/var/log/apache2/logs-for-website-4.log \ | |
| awk '$8=$1$8' \ | |
| goaccess \ | |
--log-format='%v %h %l %u [%d:%t +%^] \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"' \ | |
--date-format=%d/%b/%Y \ | |
--time-format=%T \ |
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
#!/bin/sh | |
# Author: Corentin Bettiol | |
# Contact: corentin [at] 244466666 [dot] xyz | |
# Version: v040623 | |
# License: WTFPL2 (https://wtfpl2.com/) | |
# Source: https://gist.github.com/corentinbettiol/de6cbeb7a9286d06339b4a80d64a7876 | |
echo "Utility used to select the screen to link to all devices of wacom bamboo tablets connected to the computer." |
Here's how to list all plugins in the post_content placeholder of a djangocms-blog post:
for plugin in post_content.get_plugins():
print(f"{plugin.plugin_type} - [{plugin.position}][{plugin.depth}][{plugin.path}]")
try:
print(plugin.get_plugin_instance()[0].body[:50])
except:
pass
print("\n----\n")
Here's a small gist allowing you to find a Page (the DjangoCMS object) from a slug:
def get_page(self, page_url):
"""Try to find a cms page with the same slug, and returns the id of its public page."""
potential_pages = Page.objects.filter(title_set__slug=page_url.split("/")[-2]) # get "dede" in "https://aa.aa/aa/aa/aa/dede/"
for page in potential_pages:
if page.get_absolute_url() == page_url.replace(domain_name, "") and page.publisher_is_draft == False:
return page
breakpoint()
NewerOlder