Small and simple gravatar usage in Flask.

Overview

Flask Gravatar

About

This is small and simple integration gravatar into flask.

Installation

Flask-Gravatar is on PyPI so all you need is:

pip install Flask-Gravatar

Documentation

Initialize with flask application and default parameters:

gravatar = Gravatar(app,
                    size=100,
                    rating='g',
                    default='retro',
                    force_default=False,
                    use_ssl=False,
                    base_url=None)

Then in your template:

{{ '[email protected]' | gravatar }}

Bigger and adult:

{{ '[email protected]' | gravatar(size=200, rating='x') }}

Parameters

All parameters are described in gravatar documentation.

Testing

Running the test suite is as simple as:

python setup.py test

or, to also show code coverage:

./run-tests.sh
Comments
  • config: read defaults from app config

    config: read defaults from app config

    • Try to read configuration values from application config if a context is available otherwise return an instance config or extension default. (closes #23)
    opened by jirikuncar 6
  • config: read defaults from app config

    config: read defaults from app config

    Investigate possibility to read default configuration from app.config if not arguments are given to Gravatar constructor.

    -- see https://github.com/zzzsochi/Flask-Gravatar/blob/master/flask_gravatar/init.py#L47-L67

    opened by jirikuncar 2
  • global: general package improvements

    global: general package improvements

    • Adds simple tests and Travis CI integration.
    • Unifies usage of package version and changelog.
    • Improves PEP8 and PEP257 code style.

    Signed-off-by: Jiri Kuncar [email protected]

    opened by jirikuncar 2
  • Use of setuptools instead of distutils.

    Use of setuptools instead of distutils.

    Hi,

    Thank you for the amazing work.

    Here is a very dumb and simple patch to use setuptools instead of distutils.

    This is especially useful when generating a Debian package (which I actually done here for Flask-Gravatar) because distutils doesn't deal nicely with the fact that the __init__.py file in flaskext is provided by Flask itself.

    opened by ereOn 2
  • This isn't a namespace package.

    This isn't a namespace package.

    If you install it as-is, you actually can't get at any of the stuff inside the flask_gravatar package. It's just a regular package, not a namespace one, so removing that line fixes it.

    Also, pep8 formatting on setup.py.

    opened by pib 1
  • add custom base url support

    add custom base url support

    This add support of costom base url.

    In our country china, for some reason you knew, origin gravatar url offen get blocked or very slow, so there are many alternative CDN Provider give us a extra option to resolve this matter.

    For example, we can use http://gravatar.duoshuo.com/ or http://9429127371.a.uxengine.net/ istead of origin http://www.gravatar.com/, like this image. it's just a reverse proxy so I think it's safe enough.

    So if it is convenient for you, could you accept this request?

    Thanks!

    opened by chuangbo 1
  • Add init_app method, pass app later

    Add init_app method, pass app later

    add a init_app method to the Gravatar class, so that we can make an instance without having to pass an app ( unit testing purposes, create_app factory, among other things) , and pass the app later on using init_app, like most flask extensions do

    thanks.

    opened by klinkin 1
  • Update URLs of Gravatars according to current documentation

    Update URLs of Gravatars according to current documentation

    According to https://secure.gravatar.com/site/implement/images#secure-images subdomain secure should be used with SSL. URLs starting with https:// and not on secure subdomain causes certificate alerts in my Firefox.

    opened by honzajavorek 1
  • Adds optional support for HTTPS

    Adds optional support for HTTPS

    This adds a parameter to the class initialization, use_ssl, that defaults to False. If set to True the URL for Gravatar requests uses https rather than http.

    opened by maxcountryman 1
  • docs: fix simple typo, unregistred -> unregistered

    docs: fix simple typo, unregistred -> unregistered

    There is a small typo in flask_gravatar/init.py.

    Should read unregistered rather than unregistred.

    Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    opened by timgates42 0
Owner
Alexander Zelenyak
Paramedic, moto tourist, programmer.
Alexander Zelenyak
Flask-Discord-Bot-Dashboard - A simple discord Bot dashboard created in Flask Python

Flask-Discord-Bot-Dashboard A simple discord Bot dashboard created in Flask Pyth

Ethan 8 Dec 22, 2022
Flask-template - A simple template for make an flask api

flask-template By GaGoU :3 a simple template for make an flask api notes: you ca

GaGoU 2 Feb 17, 2022
This is a small notes web app, with python and flask microframework. Using sqlite3

Python Notes App. This is a small web application maked with flask-python for add notes easily and quickly. Dependencies. You can create a virtual env

Eduard 1 Dec 26, 2021
Small flask based opds catalog designed to serve a directory via OPDS

teenyopds Small flask based opds catalog designed to serve a directory via OPDS, it has currently only been verified to work with KyBook 3 on iOS but

Adam Furbee 4 Jul 14, 2022
Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Flask-Rebar Flask-Rebar combines flask, marshmallow, and swagger for robust REST services. Features Request and Response Validation - Flask-Rebar reli

PlanGrid 223 Dec 19, 2022
Brandnew-flask is a CLI tool used to generate a powerful and mordern flask-app that supports the production environment.

Brandnew-flask is still in the initial stage and needs to be updated and improved continuously. Everyone is welcome to maintain and improve this CLI.

brandonye 4 Jul 17, 2022
Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Ajay kumar sharma 5 Jun 14, 2022
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Max Countryman 310 Dec 14, 2022
Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Max Countryman 282 Feb 11, 2021
Flask-Starter is a boilerplate starter template designed to help you quickstart your Flask web application development.

Flask-Starter Flask-Starter is a boilerplate starter template designed to help you quickstart your Flask web application development. It has all the r

Kundan Singh 259 Dec 26, 2022
Flask Project Template A full feature Flask project template.

Flask Project Template A full feature Flask project template. See also Python-Project-Template for a lean, low dependency Python app. HOW TO USE THIS

Bruno Rocha 96 Dec 23, 2022
A Fast API style support for Flask. Gives you MyPy types with the flexibility of flask

Flask-Fastx Flask-Fastx is a Fast API style support for Flask. It Gives you MyPy types with the flexibility of flask. Compatibility Flask-Fastx requir

Tactful.ai 18 Nov 26, 2022
Flask-app scaffold, generate flask restful backend

Flask-app scaffold, generate flask restful backend

jacksmile 1 Nov 24, 2021
flask-reactize is a boostrap to serve any React JS application via a Python back-end, using Flask as web framework.

flask-reactize Purpose Developing a ReactJS application requires to use nodejs as back end server. What if you want to consume external APIs: how are

Julien Chomarat 4 Jan 11, 2022
Pf-flask-rest-com - Flask REST API Common Implementation by Problem Fighter Library

In the name of God, the Most Gracious, the Most Merciful. PF-Flask-Rest-Com Docu

Problem Fighter 3 Jan 15, 2022
Open-source Flask Sample built on top of flask-dance library

Open-source Flask Sample built on top of flask-dance library. The project implements the social login for Github and Twitter - Originally coded by TestDriven.IO.

App Generator 4 Jul 26, 2022
Flask-redmail - Email sending for Flask

Flask Red Mail: Email Sending for Flask Flask extension for Red Mail What is it?

Mikael Koli 11 Sep 23, 2022
Quick and simple security for Flask applications

Note This project is non maintained anymore. Consider the Flask-Security-Too project as an alternative. Flask-Security It quickly adds security featur

Matt Wright 1.6k Dec 19, 2022