Metadata-Version: 2.1
Name: glass-web
Version: 0.0.2
Summary: A library for building web applications
Home-page: https://github.com/horlarwumhe/glass
Author: Horlarwumhe
Author-email: amachiever4real@gmail.com
License: UNKNOWN
Description: Glass is mini WSGI routing library for building web applications.
        It comes with bultin template engine. It is micro-framework because it comes with limited tools for web development. But it is extensible.
        
        Glass  comes with builtin development server.
        
        ## Installation
        
         Install from pypi;
        
        ```bash
        
          $ pip istall glass-web
        
        ```
        or clone from github;
        
        ```bash
        
          $ git clone https://github.com/horlarwumhe/glass.git
          $ cd glass
          $ pip install -r requirements.txt
          $ python setup.py install
        
        
        ```
        ##  Example
        
        ```py
        
          from glass import GlassApp
        
          app = GlassApp()
          @app.route('/')
          def home():
            return 'Hello, welcome.'
        
          @app.route('/greet/<name>')
          def greet(name):
              return 'Hello {}'.format(name)
        
          app.run()
          #app.run(host='127.0.0.1',port=8000,debug=True,auto_reload=True)
        
        ```
        
        ## Using Template
        
        Glass template syntax is very similar to django template.
        
        
        ```html
          # index.html
          <html>
          <title> {% block title %} Blog {% endblock %}</title>
          <body>
            {% block content %}
               {% for post in posts %}
                <h3> {{post.title}} </h3>
                Author: <b> {{post.author}}
                <a href='{{post.url}}'> read more </a>
                {% endfor %}
               {% endblock %}
           </body>
        
        
        ```
        
        ```py
        
        from glass import GlassApp
        from glass import render_template,render_string
        from glass import request,redirect
        
        app = GlassApp()
        @app.route('/')
        def home():
          posts = get_all_posts()
          return render_template('index.html',posts=posts)
        
        @app.route('/greet/<name>')
        def greet(name):
          template = '''
          Hello {{name}}, welcome to {{request.host}}
          '''
          return render_string(template,name=name)
        
        @app.route('/login',methods=["GET",'POST'])
        def login():
          if request.method == 'POST':
            name = request.post.get('username')
            password = request.post.get('password')
            do_login(name,password)
            return redirect('/')
          else:
            return render_template('login.html')
        
        
        app.run()
        
        ``` 
        ## Documentation
        Documentation is available on [glass site](http://glass.horlarwumhe.me). It is also available on [readthedocs](https://glassapp.readthedocs.io).
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.7
Description-Content-Type: text/markdown
