Setting the MEDIA_ROOT for Django Projects on ep.io sites
import os from bundle_config import config MEDIA_ROOT = os.path.join(config['core']['data_directory'], 'uploads')
import os from bundle_config import config MEDIA_ROOT = os.path.join(config['core']['data_directory'], 'uploads')
Bulbs is an open-source Python persistence framework for graph databases and the first piece of a larger Web-development toolkit that will be released in the upcoming weeks
Putting this in your postactivate script will install Ruby Gems in your Python virtualenv:
export GEM_HOME="$VIRTUAL_ENV/gems" export GEM_PATH=""
bpython is a Python shell similar to ipython. I've been playing around with it lately and prefer it to ipython. It's missing the ? and ?? functions but the inline syntax highlighting and the as-you-type autocompletion are very nice.
More infos on http://bpython-interpreter.org
Instead of pressing the * character on your keyboard and holding it down for a few seconds until it appears 80 times on the screen, try this:
print "*"*80
From http://nichol.as/benchmark-of-python-web-servers:
If you want to search the django docs via Alfred App, you can set up a custom search using django.me.
lxml’s tostring function has an “encoding” option, which you can use to specify an output encoding such as unicode:
from lxml.html import tostring print tostring(doc, encoding=unicode)
Pydoc can be used to search documentation of Python modules:
pydoc os.path
However, this won’t work in a virtual environment since the pydoc command uses the system library and won’t include the ve’s site-packages. To fix this, use the following cmd:
python -m pydoc BeautifulSoup
PS.: Pydoc can also serve documentation on a local webserver (python -m
pydoc -p 8000)