Learn how to use Cosmic JS to power content for
your projects using tools you love.
Cosmic JS is an API-first CMS that integrates with Python. Use Cosmic JS to quickly build content-powered blogs, dynamic pages, and more. Install the Official Cosmic JS Python Client to start managing dynamic content. Cosmic JS offers an easy way to power content for your Python apps. As your Python CMS, Cosmic JS allows you to develop your application faster and easier.
Python CMS Articles
Python CMS Resources
git clone https://github.com/cosmicjs/cosmicjs-python.git cd cosmicjs-python python setup.py install
Then in your Python file:
from pythoncosmicjs import Api # Configure api = Api(bucket='bucket-slug', read_key='read_key', write_key='write_key') # Get all objects print(api.objects(limit=10, skip=5)) # limit, skip the default is None # Get objects by type print(api.object_type(type_slug='pages', limit=10, skip=5)) # limit, skip the default is None # Get object print(api.object(object_slug='object-slug')) # object_slug mandatory variable
More examples available on the Getting Started page.