Skip to main content

Installation

Install celestis using pip

  pip install celestis

Documentation

How to run celestis server?

First, you must create the files necessary for your project. You can do this by running the following command:

celestis create-files

The above command will prompt you to enter your project name. Once you provide this information, the necessary files are created in the current directory of the terminal

Say your project name is example. Then, run the following commands on your terminal:

cd example
python server.py

Now, you can navigate to http://localhost:8080 to view your website.

Creating custom routes

Say you want your users to visit your website's about page when they hit the route /about-us.

This can be coded by using the urls.py file. In it, write the following code:

# First value of tuple refers to the route and the second value names the function that returns the HTML for the about page
urls = [("/", "home"), ("/about-us", "about")]

The most important part is to not make the array multiline as that would give an error.

The about function must be created in views.py:

def home():
  return "<h1>Home page</h1>"

def about():
  return "<h1>About us</h1>"

Rendering an HTML template

In the previous example, we returned a string that contained HTML code. But if you want to link an HTML file to the url, you can use the render_template function:

from celestis.view import render as rd

def home():
  # Relative path can be the following: static/home.html
  return rd.render_template("relative/path/to/home.html")

def about():
  # Relative path can be the following: static/about.html
  return rd.render_template("relative/path/to/about.html")

Authors

Metadata

Release files for celestis 1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celestis 1.9
File Size Uploaded Provenance Actions
celestis-1.9.tar.gz 4.3 kB Without provenance Details for celestis-1.9.tar.gz

Release files / celestis-1.9.tar.gz

Download URL celestis-1.9.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c18c14e28096d3e25d571ac5ca4c245c59b1efbaf7167709b27e2b32507c10d2
BLAKE2b-256 checksum
How to use checksums
5695315972fbe8bc735b03aa3d8e258c81a4e0588bc6269aa6c8f2d921aa20a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

Security for celestis 1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page