semvec/pypi-packages huggingface dataset:
quartcord 1.0.1
Discord OAuth2 extension for Quart.
License: MIT
Requires Python: >=3.8.0

# quartcord

[![PyPI](https://img.shields.io/pypi/v/quartcord)](https://pypi.org/project/quartcord/) [![Build](https://github.com/Sn1F3rt/quartcord/actions/workflows/build.yml/badge.svg)](https://github.com/Sn1F3rt/quartcord/actions/workflows/build.yml) [![Documentation Status](https://readthedocs.org/projects/quartcord/badge/?version=latest)](https://quartcord.readthedocs.io/en/latest/?badge=latest) 

## Table of Contents

- [About](#about)
- [Installation](#installation)
  * [Requirements](#requirements)
  * [Setup](#setup)
- [Basic Example](#basic-example)
- [Documentation](#documentation)
- [Support](#support)
- [Credits](#credits)
- [License](#license)

## About

Discord OAuth2 extension for Quart.

## Installation

### Requirements

- Quart
- pyjwt
- aiohttp
- oauthlib
- discord.py
- cachetools
- Async-OAuthlib

### Setup

To install current latest release you can use following command:
```sh
python -m pip install quartcord
```

## Basic Example

```python
from quart import Quart, redirect, url_for
from quartcord import DiscordOAuth2Session, requires_authorization, Unauthorized

app = Quart(__name__)

app.secret_key = b"random bytes representing quart secret key"

app.config["DISCORD_CLIENT_ID"] = 490732332240863233  # Discord client ID.
app.config["DISCORD_CLIENT_SECRET"] = ""  # Discord client secret.
app.config["DISCORD_REDIRECT_URI"] = ""  # URL to your callback endpoint.
app.config["DISCORD_BOT_TOKEN"] = ""  # Required to access BOT resources.

discord = DiscordOAuth2Session(app)


@app.route("/login/")
async def login():
    return await discord.create_session()


@app.route("/callback/")
async def callback():
    await discord.callback()
    return redirect(url_for(".me"))


@app.errorhandler(Unauthorized)
async def redirect_unauthorized(e):
    return redirect(url_for("login"))


@app.route("/me/")
@requires_authorization
async def me():
    user = await discord.fetch_user()
    return f"""
    <html>
        <head>
            <title>{user.name}</title>
        </head>
        <body>
            <img src='{user.avatar_url}' />
        </body>
    </html>"""


if __name__ == "__main__":
    app.run()
```

## Documentation

Head over to [documentation](https://quartcord.readthedocs.io/en/latest/) for full API reference. 

## Support

- [Project Issues](https://github.com/Sn1F3rt/quartcord/issues)
- [FumeStop Community Server](https://fumes.top/community) **(``Help > quartcord``)**

## Credits

- [Flask-Discord](https://github.com/weibeu/Flask-Discord/)
- [Quart-Discord](https://github.com/jnawk/Quart-Discord/) **(Do not use; no longer maintained)**

## License

[MIT License](LICENSE)

Copyright &copy; 2023 Sayan "Sn1F3rt" Bhattacharyya
django-react-templatetags 8.0.0
This django library allows you to add React components into your django templates.
License: MIT

[![Python tests](https://github.com/Frojd/django-react-templatetags/actions/workflows/main.yml/badge.svg?branch=develop)](https://github.com/Frojd/django-react-templatetags/actions/workflows/main.yml) [![PyPI version](https://badge.fury.io/py/django_react_templatetags.svg)](https://badge.fury.io/py/django_react_templatetags)

![Django-React-Templatetags](https://raw.githubusercontent.com/frojd/django-react-templatetags/develop/img/django-react-templatetags-logo.png)

# Django-React-Templatetags

This django library allows you to add React (16+) components into your django templates.


## Features

- Include react components using django templatetags
- Unlimited amount of components in one view
- Support custom models (that is from the beginning not json-serializable)
- Server side rendering with [Hypernova](https://github.com/airbnb/hypernova) or [Hastur](https://github.com/frojd/Hastur)


## Installation

Install the library with pip:

```
$ pip install django_react_templatetags
```


## Where to go from here?

You should first read [Getting started](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/getting-started.md), then go through these topics:
- [Settings](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/settings.md)
- [How to use the templatetags included in this library](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/templatetags-params.md)
- [Adding a single component](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/example-single-component.md)
- [Adding multiple components](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/example-multiple-components.md)
- [Examples](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/examples.md)
- [Working with models](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/working-with-models.md)
- [Server side rendering](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/server-side-rendering.md)
- [FAQ](https://github.com/Frojd/django-react-templatetags/blob/develop/docs/faq.md)


## Tests

This library include tests, just run `python runtests.py`

You can also run separate test cases: `python runtests.py tests.test_filters.ReactIncludeComponentTest`


## Coverage

Make sure you have Coverage.py installed, then run `coverage run runtests.py` to measure coverage. We are currently at 95%.


## Contributing

Want to contribute? Awesome. Just send a pull request.


## Security

If you believe you have found a security issue with any of our projects please email us at [security@frojd.se](security@frojd.se).


## License

Django-React-Templatetags is released under the [MIT License](http://www.opensource.org/licenses/MIT).