Random tarot card generator + rudimentary Django CMS

Related tags

CMSpythondjango
Overview

TAROT JUICER

:godmode:

Magick

This is a rudimentary Django-based CMS which dynamically presents tarot-related content placed onto unconventional but familiar contexts such as hollywood film and historical biography. Our purpose is to overturn and reform the audience's perspective beyond all recognition. The author endeavours to reach out (or "appeal") to the broadest audience possible.

DJANGO APPS

Here are Django apps I've created and what their purpose is:

  • generators: When a web user clicks the 'random' button, it serves one of twenty two tarot keys arbitrarily. Each tarot card webpage includes:

    • A picture of the tarot key
    • The name of the key
    • Astrological Attribute
    • Alchemical Attribute
    • Intelligence
    • Hebrew Letter
    • Letter Meaning
    • Description of the symbolic meaning
    • The description applied to:
      • Galileo
      • FLOSS
      • St Paul the Apostle

    This app houses the most dynamic functionality of my whole website

  • landings: Serves the landing/home page (the portal.html template) showing the extraordinary 'global initiation' message. This app also serves the 'about' template which is a webpage which explains the basic who, what, when, why (or purpose) of the website in general (similar to the preface to a book)

  • essays: Serves the article.html template which captures a curated list of the most high impact tarot cards and their application to Galileo and FLOSS (bound together simultaneously) along with a curated list of tart cards applied to St. Paul. This essays app also serves up static articles (without dynamic functionality) similar to a blog post - - for essays by the author on tarot applied to Forrest Gump and the war of ideas. This essays app even includes an 'objections' page for content involving anticipated rebuttals from my various audiences. This essays app also refers to a basic content_changelog.html template which enables the author to document changes made to essays or other content over time.

  • accounts: This feature gives website visitors who land on the 'gateway' landing page to enter a passphrase to gain access the rest of the site.

BUILD INSTRUCTIONS

For *nix:

$ virtualenv --python=python3.9 venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python manage.py runserver

You will also need to install postgresql v12.3. On Manjaro/Arch, you may use this:

$ sudo pacman -S postgresql postgresql-libs

USAGE NOTES

#1. Swapping lorem ipsum db out with real prod db content

The official Heroku docs cover provisioning Postgres, designating a primary database, sharing Postgres db's between applications, and more. This doc explains how to juggle/change/swap out one db instance for another.

#2. Postgres and cultivating an archive of backups

This note to self I moved into it's own (private - hidden) gist titled Guide to backing up Postgres on Friday 9 April 2021. More work needs to be done. My next step will involve either (a) learning AWS S3 or (b) writing a custom Python script using multiple symlinks to automate the download of Postgres instances and mirror them up to my Digital Ocean droplet.

#3. Handling db remote instances but locally

It's possible to run a remote AWS Postgres db locally. It's as straightforward as running:

(local venv) $ export DATABASE_URL='postgres://USER:[email protected]:PORT/NAME'

whose DATABASE_URL you can source from the Heroku Dashboard. If you are havinng trouble determining the right 'colored' DB you can use:

(local venv) $ heroku addons --app tarot-prod

You can also use:

(local venv) $ heroku pg:info --app tarot-prod

These commands should reveal the name of the add-on to distinguish the db with 'lorem' content from the db with 'real' content.

It's also very important to note that when exporting a db locally, you need to do it inside the same terminal that the local dev server is running in. For this to work, you'll need to exit the currnet local dev server, unset the existing db, export the db, and then finally run the server again.

You can view the current db configuration (probably db.sqlite3 default) with:

(local venv) $ echo $DATABASE_URL

To remove or backout from using a remote Postgres instance and reintroduce db.sqlite3, this is the command you need:

(local venv) $ unset DATABASE_URL

PLEASE NOTE and to emphasize once more: It's important that you handle all of the above commands in the same terminal emulator. If you run export $DATABASE_URL in one terminal, and then have the server running in a different terminal, it won't work. Use all of the above commands in the same terminal that you are running the local server in.

#4. Config variables

In the Heroku Dashboard, here are some of the variables you need to change for it to work in the production enviornment:

  • DJANGO_DEBUG : This config variable in production needs to be set to False to run the app, this will also resolve the check deploy issues
  • ALLOWED_HOSTS : Set its value by adding multiple hosts as ( separating each host by a space) host1 host2 host3
  • ADMIN_PATH : Set its value to make the admin path as secure as you prefer the best.
  • HEROKU_POSTGRESQL_ _URL : postgres://USER:[email protected]:PORT/NAME you can reset the PASSWORD variable on the fly by using:
    (local venv) $ heroku pg:credentials:rotate
    
    If you compare the postgres://USER:[email protected]:PORT/NAME in the Heroku dashboard before and after redunning the Heroku 'rotate' command, most of the variables remain the same however the USER and PASSWORD will be different. This protects keys that I may have previously referred to publiclly in the Issues section of this repo. More details can be gleaned from this Heroku help doc titled, How do I make sure my Heroku Postgres database credentials are correct? which I found by Googling: 'how to update postgresql credentials in heroku'.

#5. Resolving empty thumbnails (tarot card album) static files

If you accidentally upload duplicate tumbnails (generator app), Django will append a small hash to the .jpg and it won't parse when Django serves the tarot_key template. It's kind of a bug. The problem should only happen remotely on Heroku. If that happens (and it doesn't happen all the time), then the recourse is to use this command on Heroku: (local venv) $ heroku run python manage.py collectstatic -a tarot-testing --noinput --clear --no-post-process. Be sure to specify the right app (whether tarot-testing or tarot-prod). That will purge all static files with hashes. I don't completely understand why, but UmarGit and I went back forth on Upwork on June 14th, 2021.

This was an issue (#92) resolved on 9 April 2021 but which became an issue again on 14 May.

There seems to be three staticfiles directories declared inside settings.py. The one inside tarot_juicer/tarot_juicer/static is for development locally. The directroy tarot_juicer/staticfiles houses the static files on Heroku which will be intialized and created with the pgbounce buildpack in the cloud - - so there is no need for this directory locally. I'm not sure what tarot_juicer/static is for.

#6. heroku-cli x2

There are two heroku-cli app interfaces. The first heroku-cli app is installed locally for interacting between the local development environment and the remote server. The second heroku-cli app is installed remotely for interacting with itself. To install, you just navigate in Heroku settings for the app and click: “Add buildpack” and enter: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/cli.tgz. Next go to Manage Account (settings - - top right corner of avatar icon). Then scroll down and select: “Regenerate API Key”. Next time you push changes and Heroku rebuilds everything, then heroku-cli should be installed. For future reference, you may use the official Heroku doc for managing authentication and API token storage.

TO DO:

  • There are 5 ways to make my Django project more secure. https://hackernoon.com/5-ways-to-make-django-admin-safer-eb7753698ac8
    • One of them is to: "Visual disntinguish environemnts". It's a great suggestion by color coding the Django admin panel. I should implement a color coded banner at the top of every web page when the Django Admin user is logged in but the "Nuclear" option (in accounts app) is toggled on blocking all other web vistors out because right now, if the Nuclear option is triggered, the the 'logout' link on the /portal page appears but clicking on it does nothing. This is because the ADmin User has access. To help elinate confusion, there should be a colour coded banner at the top of /portal and all the other pages on the website whent he Admin user is browsing and the Nuclear option is toggled.
  • Use this guide to populate my README.md with 'badges': https://github.com/Naereen/badges/blob/master/README.md
    • e.g, correc this:
    • See Google Chrome bookmarks named: "GitHub "Badges" readme rst md icons build passing RESEARCH" in April directory

PURPOSE

"In a world where men do battle over whose version of God is most accurate, I cannot adequately express the deep respect and admiration I feel toward an organization in which men of differing faiths are able to break bread together in a bond of comradery, brotherhood, and friendship," - - On Freemasonry courtesy of Dan Brown in a 2009 interview as quoted on page 48-49 in Mark E Koltko-Rivera's (2011) Freemasonry: An Introduction (London England: Penguin Group)

Owner
Kyle Rafa Lazaro
coffee
Kyle Rafa Lazaro
A curated list of awesome packages, articles, and other cool resources from the Wagtail community.

Awesome Wagtail A curated list of awesome packages, articles, and other cool resources from the Wagtail community. Wagtail is a Python CMS powered by

Springload 1.7k Jan 03, 2023
A full stack e-learning application, this is the backend using django restframework and docker.

DevsPrime API API Service backing client interfaces Technologies Python 3.9 : Base programming language for development Bash Scripting : Create conven

Nnabue Favour Chukwuemeka 1 Oct 21, 2021
Python scripts to interact with the CakeCMS API.

Python scripts to interact with the CakeCMS API. Installation of the python module Prerequisites The cakecms module has to be installed first. Install

Fabian Thomas 3 Jan 31, 2022
Random tarot card generator + rudimentary Django CMS

TAROT JUICER This is a rudimentary Django-based CMS which dynamically presents tarot-related content placed onto unconventional but familiar contexts

Kyle Rafa Lazaro 7 Apr 26, 2022
A self-hosted application that lets you create podcast RSS feeds from YouTube playlists

Playlist2Podcast A self-hosted application that lets you create podcast RSS feeds from YouTube playlists. What Does This Do? Takes a list of YouTube p

Simon 12 Nov 14, 2022
LibreLingo🐢 🌎 📚 a community-owned language-learning platform

LibreLingo's mission is to create a modern language-learning platform that is owned by the community of its users. All software is licensed under AGPLv3, which guarantees the freedom to run, study, s

Daniel Kantor 1.4k Jan 09, 2023
Flask-SQLAlchemy implementation of nested/threaded comment replies.

Threaded comments using Common Table Expressions (CTE) for a MySQL Flask blog or CMS Credits to peterspython Also read more about the implementation h

ONDIEK ELIJAH OCHIENG 5 Nov 12, 2022
用Hexo的方式管理WordPress(使用Github Actions自动更新文章到WordPress)

方圆小站Github仓库 ---start--- 目录(2021年02月17日更新) 《刺杀小说家》一个勇士屠恶龙救苍生的故事 衡水的中学为高考服务,996.icu为人民企业家服务 轻薄的代价(纪念不足两岁MacBook轻薄本的陨落) PP鸭最佳替代品!《图压》批量压缩图片而不损失画质,支持JPG,

zhaoolee 166 Jan 06, 2023
E-Commerce Platform

Shuup Shuup is an Open Source E-Commerce Platform based on Django and Python. https://shuup.com/ Copyright Copyright (c) 2012-2021 by Shoop Commerce L

Shuup 2k Jan 07, 2023
wger Workout Manager is a free, open source web application that helps you manage your personal workouts, weight and diet plans and can also be used as a simple gym management utility.

wger (ˈvɛɡɐ) Workout Manager is a free, open source web application that helps you manage your personal workouts, weight and diet plans and can also be used as a simple gym management utility.

wger Project 2k Dec 29, 2022
LOOKING FOR NEW MAINTAINER - Quokka is a Content Management System - `docker run --rm -it -p 5000:5000 quokka/quokka`

Quokka The Happiest CMS in the world Quokka is a Content Management Framework written in Python. A lightweight framework to build CMS (Content Managem

Quokka Project 2.2k Jan 01, 2023
A Django blog app implemented in Wagtail

Puput Puput is a powerful and simple Django app to manage a blog. It uses the awesome Wagtail CMS as content management system. Puput is the catalan n

APSL 535 Jan 08, 2023
The easy-to-use and developer-friendly CMS

django CMS Open source enterprise content management system based on the Django framework and backed by the non-profit django CMS Association. Get inv

django CMS Association 9.1k Jan 08, 2023
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and ReactJS.

Saleor Commerce Customer-centric e-commerce on a modern stack A headless, GraphQL-first e-commerce platform delivering ultra-fast, dynamic, personaliz

Mirumee Labs 17.8k Jan 07, 2023
Django content management as it should be

Django content management as it should be. Documentation Read the full documentation or get a quick brief below. Install $ pip install djedi-cms Confi

5 Monkeys 75 Dec 13, 2022
Django Fiber - a simple, user-friendly CMS for all your Django projects

Django Fiber An important message about this project Hi Django Fiber enthusiasts! This project was started by the people at Ride The Pony, Leukeleu an

666 Dec 15, 2022
plumi video sharing

December 2017 update We are moving tickets from the Plumi tracker (trac.plumi.org) here, for historical reasons. Plumi video sharing system Plumi is a

Plumi 111 Dec 15, 2022
VaporCMS - The greatest content management system that will never exist

The greatest content management system that will never exist Overview WordPress is a huge success but could it be done better? Maybe being mo

Andrew Dailey 4 Jan 06, 2022
A plugin for Wagtail CMS, to have Icon Blocks (Fontawesome support)

WAGTAIL ICONIFY Library developed for Wagtail CMS, its purpose is to provide icon blocks from various libraries Special thanks to Alex Gleason, as wel

2 Jun 07, 2022
CSM: Construction Safety Management system

CSM: Construction Safety Management system 1. 서비스 소개 개요: 공사현장에서의 최적의 안전진단기술을 통한 고도화된 시스템으로 개선하고자 함 목표: 안전 관련 주요 시각데이터를 Cross-Domain으로 활용하여 통합 안전 관리기술의

5 Jul 29, 2022