
Quokka CMS is a Content Management System written in Python.
A lightweight framework to build websites, portals, blogs, applications and anything related to publishing content to the web.
python3 -m venv venv
. venv/bin/activate
pip3 install quokka
NOTE: QuokkaCMS requires Python 3.6+
$ 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_commerceandquokka_fooin 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.ymlto tune your settings.
quokka runserver --port 5000
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ā
NOTE: To generate a static website all user management, keys and passwords will be removed from settings.
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.
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.
quokka publish --static --scp --dest='me@hostname:/var/www/mysite' [--sshkey ~/.ssh/key] [--password xyz]
password : ...
This requires
herokuclient installed, ifProcfileis not found it will be generated
quokka publish --static --heroku --options
quokka publish --static --ftp --host='ftp://server.com' --dest='/var/www/mysite'
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
--localand--path path/to/db
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.
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
Do you want to be part of this open-source project?
Take a look at Contributing Guidelinesā
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ā
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
This list is also available on https://github.com/rochacbruno/quokka_ng/issuesā
/ to get all rootsmodel.Contentflit and find a better way to releaseContent type
Image
Digest
Size
337.1 MB
Last updated
almost 9 years ago
docker pull dhoeric/quokka