There is nothing exceptional about exceptions in Python. McDonc does a
good job at explaining how to think about exceptions as less than
exceptional:
http://plope.com/Members/chrism/exceptions_arent_errors/view
The only arguably exceptional part is that ideally the ORM would raise
a plain KeyErro
>
> I think it is a path problem, since the /polls/ part of the running site
> can't find views and the /admin part can't find views.
>
> I'm looking into why buildout would leave the pythonpath incomplete
> and think it is just a buildout.cfg problem. The same site structure worked
> in a non-bu
This is what I use for PostgreSQL and psycopg2 installation with
Buildout:
First, adjust the eggs to pull-in a custom-built psycopg2 egg:
eggs = ${psycopg2:egg}
${buildout:eggs}
Then for psycopg2 do:
[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs = ${postgresql:loca
The keyring library provides an easy way of using passwords stored
securely in your Keychain|Wallet|Keyring. I use it and it works Very
Nicely(TM):
http://pypi.python.org/pypi/keyring
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
With patching Python code, there is always the option of dynamically
modifying the code at run-time ... aka doing it monkey style. You can
do this in a bit more orderly fashion by using something like the
'monkey' package, which lets you use a signature on the function being
packaged, so that you b
This isn't Django-specific, but to simplify things, you may want to go
for:
mysite.com/blog
mysite.com/forums
mysite.com/custom
Since browsers send authentication based on the domain, if you use
different sub-domains for each app in a web site, it will be necessary
to login (albiet using the sam
On Oct 6, 12:02 pm, Carlos Gustavo wrote:
> Thanks Kevin,
>
> I would give it a shot. Doesn't sound as easy as I had hoped. :-)
>
To make things even harder, keep in mind that any data gotten from the
HTTP request which is passed on to a shell call as an argument must
first be checked and/or c
Use the os.subprocess module in the python standard library to invoke
the bash script from your django view code:
http://docs.python.org/library/subprocess.html
Although in my experience, when there is a bash script wrapping a
number of calls to other programs, I tend to find it easier to work
w
On Oct 5, 3:53 pm, nbv4 wrote:
> Also, once I do find a designer, how are they going to submit their
> work? The django template was designed to be ultra simple and designer
> friendly, but that whole philosophy is underminded by the fact that in
> order to get the system up and running, you h
On Oct 5, 6:45 am, Johan wrote:
> Actually the TEMPLATE_DIRS does nothing. In order to get my apps to
> work outside of the project directory I edited the manage.py file and
> added :
>
> import sys
> sys.path.append('..\\..\\..\\django-apps\\trunk')
>
> This allows me to reference my applicati
On Sep 25, 9:59 am, dijxtra wrote:
> Hi everybody,
>
> Django applications, as I understood them should be pluginable on
> project basis. That is, I should be able to install them to my
> *project*, not to my django installation. So I downloaded django-
> tagging and run the python setup.py ins
imports don't usually take up too much memory. I'd guess that even
importing a very large number of modules isn't going to grow your
process size by more than 10 MB.
imports are only evaluated once. So if you nest the import into a
view, your process will be smaller until the first time that view
Yes, how many times have you followed the practice of:
1. write some new code
2. (re)start dev server and/or update dev database
3. tab over to your browser and click away
4. tab back to terminal to see the traceback when you hit an error
With a functional test suite, it becomes sooo much
Presumably you already have all of the data required to generate a
chart on the server? If so, then store the chart data in a model, and
just reference it by id. e.g.
(or w/ a pretty URL: )
And create a Chart object and store it before sending out the HTML
response. Then update your chart view
__dict__ is an attribute of every Python object. It's typically only
an internal detail, and generally not accessed directly. One area
where __dict__ modification would differ from attribute access is with
an attribute that's a property. Modifying the __dict__ would ignore
the property getter/sett
On Jun 10, 9:27 am, Paolo Corti wrote:
> Hi
> is it possible to update an object with a dictionary?
>
> I tried something like this:
> myobject.save(force_update=True, **my_dict)
>
> getting an error, though:
> TypeError at ...
> save() got an unexpected keyword argument 'myfieldname'
>
> I wou
To answer the question in terms of Python packaging (typically
consuming Django apps isn't going to differ from consuming any other
python package) ...
On Apr 21, 11:44 am, Bryan Wheelock wrote:
> I have a question about using Pluggable apps with Django.
>
> My question is about best practices.
On Mar 4, 12:21 pm, ruffeo wrote:
> Does anyone know how to develop a complex django project in a 3 tiered
> network environment, still using the MCV architecture?
>
> I.E. Web Server (view and control code), App Server (model code), and
> Database Server
You have to distinguish between "archi
The __file__ attribute of a module can be used as a starting point for
getting at data files within a python package. However, packages can
be installed in zipped format, so if you need to account for this you
can use the pkg_resources module in setuptools:
http://peak.telecommunity.com/DevCenter
On Feb 25, 3:33 pm, Horst Gutmann wrote:
> Or you could leave the versioning to dedicated tools like bzr and git
> and use django-rcsfield :-)
>
> http://code.google.com/p/django-rcsfield/
>
I'm not sure what you gain from using a VCS for storing versions?
They're designed for a pretty differe
I think there are two issues at play here:
1. Separate your site or application into multiple Python projects to
promote re-usability, maintainability, extensibility.
2. Place your packages within a top-level package to prevent
namespace collisions to increase re-usability.
Note there is a di
On Sep 12, 10:06 am, "Matt Conrad" <[EMAIL PROTECTED]> wrote:
> On Fri, Sep 12, 2008 at 11:15 AM, Jeff Anderson
>
> <[EMAIL PROTECTED]> wrote:
> > You can influence what this list is, by setting the PYTHONPATH
> > environmental variable. All you need to do is set your PYTHONPATH
> > appropriatel
There is a list of all Python-based build tools on the python.org
wiki:
http://wiki.python.org/moin/ConfigurationAndBuildTools
I haven't used any of them with Django, but for managing Zope, Plone
and Grok based web apps, zc.buildout is the current preferred tool.
It's a configuration-based build
Milan Andric wrote:
>
> Furthermore I just did
>
> import sys
> sys.stderr.write(os.system(cmd))
> sys.stderr.flush()
>
> to see what the error message from the command is in the production
> server log.
>
>
Try using the subprocess module (Python 2.4+) to call your program instead
of os.
24 matches
Mail list logo