Skip to content

raj23689/Emuleo

Repository files navigation

Emuleo

Emuleo

Emuleo → A toy web framework made by me for learning purpose.

Code style: black GitHub last commit GitHub stars

Installation

To install Emuleo library, open a command line then write things those are below

python -m pip install git+https://github.com/raj23689/Emuleo.git

If the top command isn't working, try this one

python3 -m pip install git+https://github.com/raj23689/Emuleo.git

Start quickly by creating project

To create a Emuleo project you need to open a command line and type below command

python -m emuleo init ...

Note

Don't forget to replace ... with your project name

walkthrough

You can load data on server using this server, make a .py file named same as template file in /server directory. you need to export a load function which returns a response, below is given an example load function

for example index.py

from emuleo.app import Response

async def load():
    return Response(200,[], { "name": "John" })

Note

You have to use jinja3.x syntax for templating, Here's jinja docs for more information.

Example template

Here is an example template index.html

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
		<link rel="stylesheet" href="../styles/index.css" />
	</head>
	<body>
		<h1>Hello {{ name }}</h1>
		<script src="../scripts/index.js"></script>
	</body>
</html>

contributing

Everyone is free to fork and contribute to this project, hope this framework becomes a success!

Made with ♥ by raj23689

About

A toy implementation of a web framework in python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages