GithubHelp home page GithubHelp logo

josuebrunel / spewe Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 66 KB

Just another lil Python Web Framework closer to a spew than a framework :smile: (Not on PyPi yet)

License: MIT License

Python 97.30% HTML 2.70%
framework python webframework webserver wsgi

spewe's People

Contributors

josuebrunel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spewe's Issues

Add Class Based View support

Expected:

from spewe import Spewe
from spewe.view import View

app = Spewe()

@app.route('/users/(?<uuid>[\w,-]+)/$')
class User(View):
      
   def get(self, request, **kwargs):
      pass     

add template integrity check

right now you open a block without closing it

{% if user.authenticated %}<p>Hello {{user.username}}</p>

that ain't cool

make eval safe (again)

Since eval is used in template's statement evaluation, one can easily anything from the runtime context and it shouldn't be the case.

{{ locals() }}

That should be prohibited.

Capture url argument or parameter

Url arguments or parameters should be passed to the target view

@app.route(r'^/users/(?P<uuid>[\w,-]+)/$', methods=['GET'])
def users(request, uuiid, *args, **kwargs):
     user = User.manager.get(uuid=uuid)
     return JSONResponse(user.to_json())

Add Cookies support

We should be able to get cookies from the request such as below:

@app.route(r'^/account/$')
def account(request, *args, **kwargs):
     cookies = request.cookies
     ...

Add session handling

Add session handling through a simple middleware. We should be able to do something as below :

@app.route(r'^/whatever/$')
def whatever(request, *args, **kwargs):
     session = request.session
     ....

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.