You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
Please consider adding an empty init.py file to the project root. Here's why.
I'm using bloggart under a custom prefix ('/blog/'), with a buildout-based application. The easiest way for me to set it up is to use http://github.com/zerok/zerokspot.gitrecipe/ to grab the latest revision from github.
I don't change anything to the code, I just have a custom dict with my own settings and scripts that look like this (pseudocode):
# my_custom_static.py:
from somewhere import my_custom_settings
# mangle sys.path to insert bloggart's directory
# (which is actually a symlink as I use rod.recipe.appengine
# to put things together for me)
import config # this is bloggart config
[setattr(config, *item) for item in my_custom_settings.iteritems()]
# Then do the rest
from static import main # this is your static.py
if __name__ == '__main__':
main()
As you can see, it is quite frustrating and also it's hard not to make filename clashes. If you'd add an init.py to the root, that probably wouldn't change anything for your code if run stand-alone, but my code would be much cleaner as I could use your code like a package, without manging my sys.path.
The text was updated successfully, but these errors were encountered:
I'd be surprised if this is sufficient - I believe bloggart uses absolute imports in places. If you want to try this, and it works, however, send me a pull request and I'll approve it!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Please consider adding an empty init.py file to the project root. Here's why.
I'm using bloggart under a custom prefix ('/blog/'), with a buildout-based application. The easiest way for me to set it up is to use http://github.com/zerok/zerokspot.gitrecipe/ to grab the latest revision from github.
I don't change anything to the code, I just have a custom dict with my own settings and scripts that look like this (pseudocode):
As you can see, it is quite frustrating and also it's hard not to make filename clashes. If you'd add an init.py to the root, that probably wouldn't change anything for your code if run stand-alone, but my code would be much cleaner as I could use your code like a package, without manging my sys.path.
The text was updated successfully, but these errors were encountered: