Coder Social home page Coder Social logo

rowanlupton / pylodon Goto Github PK

View Code? Open in Web Editor NEW
98.0 17.0 14.0 31.77 MB

Flask-based ActivityPub server

License: MIT License

Python 100.00%
flask flask-restful flask-login jinja2 activitypub activitystreams federation federated python3 activipy

pylodon's People

Contributors

npdoty avatar rowanlupton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylodon's Issues

do we need separate hosts/uris for the api and the server?

(Please forgive my relative ignorance on the design practices.)

Do we need separate URIs for the API and for the Web-accessible server? It appears as if api.py is returning results compatible with the ActivityPub spec and that views.py and related return results for consumption by a Web browser. Rather than maintaining separate URI structures (whether on two different hosts or not), could the code just switch between these two based on the headers? If a user agent only Accepts application/ld+json, then we return ActivityPub JSON; if the user agent is expecting text/html, then it's a web browser and we should render a nice template.

created post @id's refer to API_URI, but feed view searches for posts on SERVER_URI

Created posts have an @id like: "@id" : "http://api.smilodon.localhost:5000/test/posts/0", but the viewPost route queries for a post with @id at the request's url_root, which isn't typically the same. So, when I try to load a particular post in the web browser, the server throws an error like:

16:50:01 web.1   |    File "/Users/nick/code/mastodon/smilodon/app/views.py", line 118, in viewPost
16:50:01 web.1   |      return render_template('feed.html', posts=p, mongo=mongo)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/env3/lib/python3.5/site-packages/flask/templating.py", line 134, in render_template
16:50:01 web.1   |      context, ctx.app)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/env3/lib/python3.5/site-packages/flask/templating.py", line 116, in _render
16:50:01 web.1   |      rv = template.render(context)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/env3/lib/python3.5/site-packages/jinja2/environment.py", line 1008, in render
16:50:01 web.1   |      return self.environment.handle_exception(exc_info, True)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/env3/lib/python3.5/site-packages/jinja2/environment.py", line 780, in handle_exception
16:50:01 web.1   |      reraise(exc_type, exc_value, tb)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/env3/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
16:50:01 web.1   |      raise value.with_traceback(tb)
16:50:01 web.1   |    File "/Users/nick/code/mastodon/smilodon/app/templates/feed.html", line 1, in top-level template code
16:50:01 web.1   |      {% extends 'basic.html' %}
16:50:01 web.1   |    File "/Users/nick/code/mastodon/smilodon/app/templates/basic.html", line 37, in top-level template code
16:50:01 web.1   |      <div class="content">{% block content %}{% endblock content %}</div>
16:50:01 web.1   |    File "/Users/nick/code/mastodon/smilodon/app/templates/feed.html", line 4, in block "content"
16:50:01 web.1   |      <p> {%for p in posts%}
16:50:01 web.1   |  TypeError: 'NoneType' object is not iterable

Whether there need to be separate URIs for the API and the server at all is also unclear to me, but probably a separate issue.

clean up requirements.txt

it's def got some libraries on it that aren't used by smilodon, that i tried out at one point or another

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.