This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Relask

A Relay-based web development kit on Flask.

Features

  • Fast web development setup with ES6, React and Relay
  • Batteries included: React Router, Webpack and Babel
  • Server is powered by Python, Flask and Graphene
  • JWT integrated, with a working example using Flask-Login

Usage

  1. Install Relask:
pip install git+https://github.com/decentfox/relask
  1. Create a Flask application, for example: http://flask.pocoo.org/docs/quickstart/
  2. Initialize your Flask application with Relask (this requires npm):
FLASK_APP=xxx flask init-relask
  1. Under the root path of your Flask application, create scripts/app.js with something like this:
import React from "react";
import ReactDOM from "react-dom";
import {Route, IndexRoute} from "react-router";
import Relay from "react-relay";
import {Relask, RelayContainer} from "babel-loader!relask";


@RelayContainer
class Hello extends React.Component {
    render() {
        return (
            <div>Hello, {this.props.hello.name}!</div>
        );
    }

    static relay = {
        fragments: {
            hello: () => Relay.QL`fragment on Hello { name }`
        }
    };
}

ReactDOM.render((
    <Relask>
        <Route path="/" component={Hello} queries={{
            hello: () => Relay.QL`query { hello }`
        }}/>
    </Relask>
), document.getElementById('app'));
  1. Initialize the Relask extension with something like this:
import graphene
from flask import Flask
from graphene import relay
from relask import Relask


class Hello(relay.Node):
    name = graphene.String()

    def resolve_name(self, args, info):
        return 'World'

    @classmethod
    def get_node(cls, id, info):
        return Hello(id=id)


class Query(graphene.ObjectType):
    node = relay.NodeField()
    hello = graphene.Field(Hello)

    def resolve_hello(self, args, info):
        return Hello.get_node(1, None)


app = Flask(__name__)
relask = Relask(app)
relask.schema.query = Query
  1. See your result with one command - don’t worry about webpack any more:
FLASK_APP=xxx flask run

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2016-06-07)

  • First release on PyPI.
Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
relask-0.1.0.tar.gz (17.3 kB) Copy SHA256 Checksum SHA256 Source Jul 1, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting