Giter Site home page Giter Site logo

rochacbruno-archive / quokka_ng Goto Github PK

View Code? Open in Web Editor NEW
73.0 18.0 19.0 7.44 MB

:hamster: WIP - QuokkaCMS New Generation - Refactor from scratch using TinyDB

License: Other

Makefile 0.57% Python 87.75% HTML 11.68%
flask quokka cms pelican quokka-cms python hacktoberfest content-management content-management-system flask-application

quokka_ng's Introduction

Quokka

quokka

The Happiest CMF in the world

Quokka is a Content Management Framework written in Python.

A lightweight framework to build CMS (Content Management System) as websites, portals, blogs, applications and anything related to publishing content to the web.

Quokka is not limited to CMS area, it is also possible to create Quokka extensions to provide any kind of web application based on Python and Flask.

Quokka can also (optionally) generate a static website from the contents generated in its admin interface.

Features

  • Web based content management admin interface
  • Multiple content formats (markdown, rst, html, plaintext)
  • Compatibility with any of the Pelican Themes
  • Flat file NoSQL database TinyDB or optionally MongoDB for scale deployments
  • Host the Quokka server or generate a static website
  • Extensible via modules/plugins
  • Powered by Python, Flask, Flask-Admin, TinyMongo and Pelican Themes

Quick Start

Install and run for development mode

git clone https://github.com/rochacbruno/quokka
cd quokka
python3 -m venv venv
. venv/bin/activate
make install
make devserver

Or install quokka from PyPI

python3 -m venv venv
. venv/bin/activate
pip3 install quokka

NOTE: QuokkaCMS requires Python 3.6+

Start a project

$ quokka init NewWebsite --theme=flex --modules=gitpages,heroku
...
๐Ÿน Quokka project created ๐Ÿน
๐Ÿ“ Name: NewWebsite
๐Ÿ“ Location: /tmp/newwebsite
๐Ÿ“š Template: default
๐ŸŽจ Themes: flex theme installed
๐Ÿšš Modules: [gitpages, heroku] installed
๐Ÿ”ง Config: Config file written in /tmp/newwebsite/quokka.yml
โžก Go to /tmp/newwebsite
โš™ run `quokka runserver` to start!
๐Ÿ“„ Check the documentation on http://quokkaproject.org
๐Ÿน Happy Quokka! ๐Ÿน

YES! it outputs emojis ๐Ÿน

The above command will generate your project in myproject folder as:

.
โ”œโ”€โ”€ databases        # TinyDB database files (gitignored)
โ”œโ”€โ”€ modules          # Custom modules to load on EXTRA_EXTENSIONS
โ”œโ”€โ”€ static_build     # output static site
โ”œโ”€โ”€ themes           # Front-end Themes (Pelican and Quokka Themes supported)
โ”œโ”€โ”€ uploads          # Media uploaded via admin
โ”œโ”€โ”€ .gitignore       # gitignore to exclude sensitive files
โ”œโ”€โ”€ quokka.yml       # Project settings
โ”œโ”€โ”€ .secrets.yml     # To store keys, tokens and passwords (gitignored)
โ””โ”€โ”€ wsgi.py          # To deploy `gunicorn wsgi:app`

You can optionally pass arguments:

Choose existing theme (the default is Malt)

quokka init mywebsite --theme http://github.com/user/theme

Install modules

quokka init mywebsite --theme http://github.com/user/theme --modules="commerce,foo"

the above looks for quokka_commerce and quokka_foo in PyPI and installs it

Set important configurations

quokka init mywebsite --theme http://github.com/user/theme --config="auth_enabled=false"

That is optional, you have to edit quokka.yml to tune your settings.

Run your website

quokka runserver --port 5000

Access admin interface

http://localhost:5000/admin

Access your site

http://localhost:5000

Deploy

You can deploy your Quokka Website in a WSGI server

Check the wsgi.py and refer to it when deploying in wsgi servers.

cd myproject
gunicorn wsgi:app -w 4 -b "0.0.0.0:8000"

An example of supervisord config

[program:quokka]
command=/myproject/venv/bin/gunicorn wsgi:app -w 4 -b "0.0.0.0:8000"
directory=/myproject

For more information read Gunicorn documentation

Publish Static HTML website

NOTE: To generate a static website all user management, keys and passwords will be removed from settings.

You can generate a static HTML website to host anywhere

Once you have your website running locally you can easily generate a static HTML website from it.

$ quokka publish --static [--output path]
Generating static HTML website on ./static_build folder

Once you have a ./static_build folder populated with static website you can deploy it using SCP, FTP or git, it is a full static website.

Deploying to github pages from command line

NOTE: You need either ssh key access to github or it will ask login/password

quokka publish --static --git=rochacbruno/mysite --branch=gh_pages

The above is also available in admin under 'publish' menu.

Deploying via SCP

quokka publish --static --scp --dest='me@hostname:/var/www/mysite' [--sshkey ~/.ssh/key] [--password xyz]
password : ...

Deploying to Heroku

This requires heroku client installed, if Procfile is not found it will be generated

quokka publish --static --heroku --options

Deploying via FTP

quokka publish --static --ftp --host='ftp://server.com' --dest='/var/www/mysite'

Load database from remote deployment (only for TinyDB)

When you publish a static website along with the static files the database also goes to the server under the databases/ folder only as a backup and snapshot.

You can load that remote database locally e.g: to add new posts and then re-publish

quokka restoredb --remote --git=rochacbruno/mysite
Creating a backup of local database...
Downloading remote database
Restoring database..
Done...

Now you can run quokka runserver open your localhost:5000/admin write new content and then Publish website again using command line or admin interface.

NOTE: If you want to restore a local database use --local and --path path/to/db

Using MongoDB

You can choose to use MongoDB instead of TinyDB, That is useful specially if you deploy or local instance has more than one admin user concurrently and also useful if you want to install plugins which support MongoDB only (because it relies on aggregations and gridfs)

You only need a running instance of Mongo server and change quokka.yml:DB on your project from:

quokka:
  DB:
    system: tinydb
    folder: databases

to:

quokka:
  DB:
    system: mongodb
    name: my_database
    host: 127.0.0.1
    port: 2600

Then when running quokka again it will try to connect to that Mongo Server.

With that you can deploy your site on wsgi server or can also generate static website.

Running mongo in a Docker container

cd your_quokka_project_folder
docker run -d -v $PWD/databases:/data/db -p 27017:27017 mongo
# wait some seconds until mongo is started
quokka runserver

Contributing to Quokka CMS Development

Do you want to be part of this open-source project?

Take a look at Contributing Guidelines

Setup a contributor environment

Ensure you have Python3.6+ clone this repo and:

git clone https://github.com/$YOURNAME/quokka_ng
cd quokka_ng

# create a Python3.6 virtual env
make create_env

# activate the venv
. venv/bin/activate

# install Quokka in --editable mode (using flit)
make install

# run quokka
make devserver

Access http://localhost:5000/admin and http://localhost

ROADMAP

This list is available on https://github.com/rochacbruno/quokka_ng/issues

This is the list of tasks to be completed until 1.0.0 can be released. support 100% coming only for malt and bootstrap3 themes

quokka_ng's People

Contributors

bendoh avatar dhoeric avatar rochacbruno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quokka_ng's Issues

content extra fields

Add metadata field (as inner json) to allow content to have extra custom fields

Hey Bruno!

First I want to say I will still be following quokka, supporting it and using it for my sites! I am excited about the new version and I am glad by doing what you have to do, it will let you keep quokka, make it better and even keep your head more organized! With that said, I am trying to install the new version. I changed to using python3.6 on debian sid in my virtualenv
(quokkaenv) root ยป [quokka_ng]: python -V Python 3.6.1rc1 (quokkaenv) root ยป [quokka_ng]:

But when I went to install quokka, I would get errors. Tracing those errors myself I noticed I was simply missing things so I installed them one by one. Also I ran
git clone https://github.com/rochacbruno/quokka_ng.git in my virtualenv, changed directory to quokka, and ran pip3 install --upgrade -r requirements.txt. It grabbed a bunch of things, and installed them, just like the old version. But when I run pip3 install quokka I would still get errors. I traced them, found some more packages I needed, as a matter of fact one was flask_htmlbuilder, but the actual package I found i needed was QUOKKA-flask-htmlbuilder! So I went thru and installed some more things and finally I am stuck here I will attach the log below.

`(quokkaenv) root ยป [quokka_ng]: pip3 install quokka
Collecting quokka
Using cached quokka-0.2.0.tar.gz
Complete output from command python setup.py egg_info:
/tmp/pip-build-jla_rh9x/quokka/quokka/core/admin/init.py:7: ExtDeprecationWarning: Importing flask.ext.admin is deprecated, use flask_admin instead.
from flask.ext.admin import Admin
/tmp/pip-build-jla_rh9x/quokka/quokka/core/db.py:4: ExtDeprecationWarning: Importing flask.ext.mongoengine is deprecated, use flask_mongoengine instead.
from flask.ext.mongoengine import MongoEngine
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-jla_rh9x/quokka/setup.py", line 6, in
import quokka
File "/tmp/pip-build-jla_rh9x/quokka/quokka/init.py", line 15, in
from .core.admin import create_admin
File "/tmp/pip-build-jla_rh9x/quokka/quokka/core/admin/init.py", line 9, in
from ..models import (Link, Config, SubContentPurpose, ChannelType,
File "/tmp/pip-build-jla_rh9x/quokka/quokka/core/models.py", line 10, in
from quokka.core.db import db
File "/tmp/pip-build-jla_rh9x/quokka/quokka/core/db.py", line 4, in
from flask.ext.mongoengine import MongoEngine
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 646, in _load_unlocked
File "", line 616, in _load_backward_compatible
File "/usr/home/quokkaenv/lib/python3.6/site-packages/flask/exthook.py", line 77, in load_module
import(realname)
File "/usr/home/quokkaenv/lib/python3.6/site-packages/flask_mongoengine/init.py", line 6, in
import mongoengine
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/init.py", line 3, in
from mongoengine import document
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/document.py", line 10, in
from mongoengine.base import (BaseDict, BaseDocument, BaseList,
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/base/init.py", line 9, in
from mongoengine.base.document import *
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/base/document.py", line 17, in
from mongoengine.base.fields import ComplexBaseField
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/base/fields.py", line 462, in
class GeoJsonBaseField(BaseField):
File "/usr/home/quokkaenv/lib/python3.6/site-packages/mongoengine/base/fields.py", line 468, in GeoJsonBaseField
_geo_index = pymongo.GEOSPHERE
AttributeError: module 'pymongo' has no attribute 'GEOSPHERE'

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jla_rh9x/quokka/
(quokkaenv) root ยป [quokka_ng]:`

Thank you very much for your help, and once I get a basic stable site up, I would love to spend some time writing documentation and howtos for quokka! I have plenty of free time available so please let me know. I have three test machines of varying hardware from older to latest I can test on, with windows 10, arch linux, and debian sid available. I just need guidance on what needs to be done.

create admin metadata page

On /admin a new page "metadata" must be created, a key: multi_value where key is category name and value is a dict of metadata, also allowed by METADATA theme: variables

search

Typuesearch + (Elastic or Woosh) support (configurable via variable SEARCH_SYSTEM: )

feeds

Implement all needed feeds rss/atom etc

sitemap

Implement automatic sitemap

optional footer elements on malt

For malt theme allow footer elements to be dynamic based on admin metadata or config variable by CONFIG_VAR (FOOTER_ELEMENTS:{1:"text"})

something wrong when i start a project

hi
my python version is 3.6,and i try to use quokka for my project.
first step,i installed quokka successfully with 'pip install quokka'
then,when i use 'quokka init mywebsite',there's an error '[Errno 2] No such file or directory: 'settings.yml''.
i also can not find the file.
how can i solve it?

best regards

My 2 cents

I was an early follower when I want to try some light-weight cms framework. And quokka was a perfect match since at that time I was trying to learn mongodb and flask.
I tried to setup a few testing sites but honestly didn't use it at production.
The major concern:

  1. When I started to use quokka, I really wanted to understand it in detail. I tried but when get deeper, I feel it's still very complex. So I liked your new motivation to keep it simple and support through plugins.
  2. The CMS admin panel is too complex when you have a simple task and too simple when you really want to do something fancy.
  3. If possible, please publish some kind of architecture structure for your new project, (something like sqlalchemy did), so others would follow you easily. And by support features through plugins could help on this so as to attract more potential contributor that doesn't know everything as you.
  4. Is it possible you could make some built-in comment system or use some fancier external one? Current discus forum feel cumbersome for me. But it's my own feeling, maybe others don't think so.
  5. I'm still confused about the "CMS" title. How do you compare it with Django or else?

Will add more if I have other comment. But, great work and keep going!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.