-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python 3 support #17
Comments
I haven't tried, but good call. |
I've started work on a Python 3 port. First thing I notice is that virtualenv 1.6.4 and Aspen 0.24.3 are very old, so I've updated the project to use the latest virtualenv and Aspen (e8a1f4c). When I do, the server now runs, but gets this error on a request for
Can you point me in the right direction as to what needs to be done to account for this error? |
Nice! :-)
Our efforts to port Aspen itself to Python 3 (AspenWeb/pando.py#524) have resulted in a significant change of direction for that project. We are working on reducing Aspen's scope from a web framework, to a simplates router to be used with other frameworks: AspenWeb/pando.py#526. We're planning to rename the project to Simplates to reflect the more modest scope.
Off the top of my head: it's probably using (rightly or wrongly) the |
Fwiw, I've started contracting for an organization that uses Mongo (actually, TokuMX), so I may get a chance to work on Mongs after all. :-) |
I've made some progress. The issue with the render was that Mongs necessarily uses the Jinja renderer for loops and other logic in the templates. Now that I've worked through some issues there, including syntax that's changed in Jinja, I'm now up against another Aspen issue - seems the syntax in this simplate is no longer valid. Can you recommend a technique that achieves the same need in the latest aspen? |
Error message is this:
|
Interesting. That file is supposed to be a symlink, and the target appears to be well-formed (the error you're seeing usually means one needs to add |
It's at request time - http://localhost:29017/localhost/translations/config.languages/%7B%7D/1/ is the URL. I'll experiment with adding sections. |
Okay. If the symlink proves to be too fragile, we might look at a shim in the one simplate to delegate the request to the other simplate. |
The symlink renders as plaintext, so the error is gone, but now the response is simply a rendering of the symlink itself. |
The branch I'm working on is here - https://github.com/yougov/mongs/tree/python3 It's easy to bootstrap, but you need a MongoDB instance (with a document in a collection) to test it. |
Aha! Thanks to the help of Changaco in IRC, I see that the file is actually intended to be a file-system level symlink, and it only appears as a plaintext reference to the file because the code was originally checked out long ago, probably on a Windows system, and synced to this OS X system via Dropbox, so somewhere in that chain the link was broken. Making a clean checkout of the repo results in a working instance. |
Fixed in #27. |
I was mistaken about Python 3 support. Aspen still doesn't support Python 3. |
We're getting there! :-) Porting Aspen to Python 3 should be much easier after AspenWeb/pando.py#527 lands. |
@Changaco I'm looking into this again... but I'm getting stuck on a fairly basic hitch - how does one with pando 0.46 (aspen 1.0rc3) configure the WWW_ROOT? I tried PANDO_WWW_ROOT and ASPEN_WWW_ROOT and WWW_ROOT, but none seemed to have any effect (it continues to serve from '.'). Do you know if it's possible to set the root? Can you advise on how to do that? Also, as an aside - I notice that aspen 1.0rc4 is quite a bit newer and includes a major refactor. Are there plans for pando to follow those updates? |
@jaraco Pando and Aspen have been moving away from using environment variables for configuration (AspenWeb/pando.py#568), instead you should use keyword arguments when creating the website = Website(
changes_reload=env.aspen_changes_reload,
project_root=env.aspen_project_root,
show_tracebacks=env.aspen_show_tracebacks,
www_root=env.aspen_www_root,
) However it seems I haven't completed the transition yet and the boolean arguments like Sorry it's still a bit of a mess.
Yes, but I don't know when I'll get around to it. |
On the bright side, I can confirm that Pando and Aspen do work under Python 3 now (Liberapay has been running under Python 3.6 in production for a month). |
I've made some progress in this branch. The home page renders, but on the first page with a parameter, the page render fails with this error:
|
I think I fixed that issue in yougov/mongs@e91fce5 |
Next I've got an issue with |
Can someone help with how to write this line on aspen 1.0rc3? |
|
Can mongs be deployed on Python 3? If would be nice to deploy on Python 3 if for no other reason than it will remove all of those ugly 'u' prefixes on the unicode literals in the UI.
The text was updated successfully, but these errors were encountered: