rowanlupton / pylodon Goto Github PK
View Code? Open in Web Editor NEWFlask-based ActivityPub server
License: MIT License
Flask-based ActivityPub server
License: MIT License
when a user creates a post on smilodon, it should show up in the feed of anybody who's following them; this doesn't work right now
and i haven't learnt how to write them
default to meow; if post is all caps change button to ROAR
IMHO, requirements.txt
should only be what you directly depend on. If you want more extensive version pinning (freezing, locking), something like a constraints file should be used.
(pipfile/pipenv can also be used, but I've found deploying with pipenv to be challenging in the past.)
More information:
posts from smilodon need to show up on mastodon and currently they don't
implement a database controller file so that it's easier to switch between databases if you want to
(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 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.
it's def got some libraries on it that aren't used by smilodon, that i tried out at one point or another
users should be managed by the API, because the API defines the instance, and can be accessed by any frontend
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.