-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
This doesn't show the URL and the port when run (AspenWeb/pando.py#440)
There is no |
I don't use localhost, because I am running this on remote node
|
Looks like Website accepts command line argument as parameters. Very unusual. |
@techtonik That's legacy behavior from when we used to provide a server; see AspenWeb/pando.py#374. |
Have you tried |
This is AspenWeb/pando.py#436 and I need help here, because I don't know how it supposed to work before and how it should look like now.
|
Per the signatures you linked at AspenWeb/pando.py#436 (comment), try changing: def get_simplate_context(website, fs):
request = Request()
request.fs = fs
request.website = website
resource = resources.get(request)
return {} if isinstance(resource, StaticResource) else resource.pages[0] to: def get_simplate_context(website, fs):
resource = resources.get(website, fs)
return {} if isinstance(resource, StaticResource) else resource.pages[0] |
I tried
Yes, I saw. Tried that with |
Actually: def get_simplate_context(website, fs):
resource = resources.get(website, fs)
return {} if isinstance(resource, StaticResource) else resource.pages[0] (No need to instantiate a |
What does this function do? Without a docstring I don't really get it. For standard template (like Jinja2), the context is a dict of template variables - http://jinja.pocoo.org/docs/dev/api/#jinja2.runtime.Context And what is the |
It gets a simplate context, which is an empty dictionary in the case of a static file, or the zeroth page within the simplate otherwise. |
"All simplate pages are cached in a compiled state," and for |
Next traceback:
|
What's |
Python is 2.7.6. Is Aspen based on from future? |
|
See, |
Yes! :-) We use |
Although this doesn't explain what directory should be CWD for simplates. |
@techtonik Well, it's looking for os.listdir(os.path.join(website.www_root, 'howto')) |
@whit537 this looks like a place for some API to get files from the www/ filesystem. Or it is just the perfectionist in me complaining.. |
@whit537 this is ready for review. I am trying to add Travis tests, but these are not critical. |
@whit537 take a look. |
@@ -2,6 +2,16 @@ | |||
|
|||
[![Build Status](https://travis-ci.org/gratipay/inside.gratipay.com.svg)](https://travis-ci.org/gratipay/inside.gratipay.com) | |||
|
|||
**NOTE**: The quickstart may not work until vendorized | |||
`virtualenv` + `pip` are not upgraded to latest versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/not//
, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed.
@whit537 addressed review comments and cleaned up. Please take a look. |
./$(env_bin)/honcho -e defaults.env,local.env run ./env/bin/aspen \ | ||
--network_address :8536 --www_root=./www/ --project_root=./ | ||
./$(env_bin)/honcho -e defaults.env,local.env run ./env/bin/python \ | ||
./startapp.py --port=8537 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the port from 8536
to 8537
. Was that intentional? I had chosen 8536
so it could be run simultaneously with gratipay.com
, which runs on 8537
by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not intentional. Thought that 8537 is like default for all GP sites. Fixed now.
Force pushed last commit to fix Travis test as well. |
@whit537 looks like it can finally be merged. |
Here goes nothin'! :-) |
Appears to be working, @techtonik. Great work! 💃 !m @techtonik |
Awesome! Thanks for review. =) |
https://github.com/gratipay/aspen-python/blob/master/Changelog.md
Scenario:
[ ] find a way howaspen
can discover it automatically (python -m aspen doesn't work correctly on windows AspenWeb/pando.py#440)Current issues:
The startapp.py can be patched to show it, but that would complicate every Aspen app with such custom code. It is better to expose Website.run() method that can also get the host/port setting from site configuration.
[ ] whenpython -m aspen
is run, it shows port, but not hostAlso here - AspenWeb/pando.py#440