django

How do to access a solr field from django

Hi, I added a field to my solr schema.xml file. How would I access this field in django. Thanks, David ...

Python, Django, using Import from inside of a class, can't seem to figure this out

I want to use imports inside a class that is then inherited by another class so that I don't have to manually define my imports in each file. I am trying it like this but its not working, any advice is appreciated: class Djangoimports (): def __init__(self): from django.template import Context print Context class I...

Disable caching for a view or url in django

In django, I wrote a view that simply returns a file, and now I am having problems because memcache is trying to cache that view, and in it's words, "TypeError: can't pickle file objects". Since I actually do need to return files with this view (I've essentially made a file-based cache for this view), what I need to do is somehow make i...

can a django application be run using paster?

can a django application be run using paster? Or is it pylons specific? ...

Lighttpd + fastcgi + django: truncated response sent to client due to unexpected EOF

I'm trying to get my Django based webapp into a working deployment configuration, and after spending a bunch of time trying to get it working under lighttpd / fastcgi, can't get past this problem. When a client logs in for the first time, they receive a large data dump from the server, which is broken into several ~1MB size chunks that ...

Why is Django so Slow to Refresh Compared to a PHP Site?

This is a nagging issue that I've had with Django. Compared to a typical PHP site, it takes forever to refresh and see any changes I've made. During development I have Apache set to MaxRequestsPerChild 1 - this is fairly slow but is necessary because you end up viewing 'stale' code without it. Running the development server is far worse...

Password field in Django model

I'm trying to create a model where I can store usernames and passwords for other applications. How can I set a password field in Django so that it is not in plain text in admin? Thanks in advance. ...

django-paypal ExpressCheckout second step ???

Hi! i've been implementing django-paypal but when it return token and payerID where can i handle this? i put the confirm.html template but it doesn't show anything... By the way, im Using PayPal Payments Pro any idea ??? ...

Creating a list on the fly in a Django template

I don't know whether it's possible, but I'd like to be able to write something like the following: {% with var1 var2 var3 as some_list %} {{ some_list|maximum }} {% endwith %} Creating a list on the fly from an arbitrary number of template variables and/or literals seems useful, so I'm hopeful that I've overlooked something simple...

UnicodeEncodeError: 'ascii' codec can't encode character

When uploading files with non-ASCII characters I get UnicodeEncodeError: Exception Type: UnicodeEncodeError at /admin/studio/newsitem/add/ Exception Value: 'ascii' codec can't encode character u'\xf8' in position 78: ordinal not in range(128) See full stack trace. I run Django 1.2 with MySQL and nginx and FastCGI. This is a problem...

simple document/knowledge management system, based on django

Hi, I'm looking for a simple document management system (preferably based on django). Doing a quick internet research I found these two apps: http://github.com/philippbosch/django-dms/tree/master/documents/ http://code.google.com/p/django-documents/ Has anyone ever tried one of this solutions, and can recommend one? Can anyone reco...

Pyfacebook- not getting my Facebook details sucessfully?

Hi, I've followed the Pyfacebook tutorial here: http://uswaretech.com/blog/2009/02/how-to-build-a-facebook-app-in-django/ However, it never seems to get my user id (and thus user details). The "request.facebook" object is sucessfully created but it's mostly full of null data- eg request.facebook.uid=None in my Views. I've hunted thro...

Django Models: preserve object identity over foreign-key following.

Django's ORM (version 1.2.3) does not preserve identity when following foreign keys back and forth. This is best explained with an example: class Parent(models.Model): pass class Child(models.Model): parent = models.ForeignKey(Parent) parent = Parents.objects.get(id=1) for child in parent.child_set.all(): print id(child.pa...

Django template filter - one line

I'm looking for a Django template filter that turns a multi-line construction into one big line. Has anyone implemented it? The reason is - I have a form, {{form.as_p}} creates a multi-line html fragment, I want to create a javascript variable which is an html fragment, but when I do like this: var new_div_text = '{{form.as_p}}'; ...

Django. You don't have permission to edit anything.

I created a little app a while ago. I created admin.py and used admin.site.register(MenuEntry) to add the class to admin console. It showed the items of that class just fine. Then I began working on another app and created everything as before. But now it says: You don't have permission to edit anything. I compared files from that and f...

Django: Model Design & Best Practice

I need to create an app that fetches the choices for some of the fields from a web service. Those fields are things like Country (single value), State (single value), Interests (Ecology, Biology, Chemistry, etc.) (multiple values), etc. The web service returns for Country looks like: { 'USA':'United States of America', 'GER':'G...

What features does Django have that Pylons doesn't?

From what I understand, Pylons is more of a 'bare bones' framework (where you can choose your ORM and template engine), and Django is a little more rich in nature. What exactly are the features/frameworky elements that Django has that Pylons doesn't? (other than its own ORM, and its auto-admin page generation) ...

Pinax vs. Plone -- Dev time, flexibility, security?

Trying to evaluate Pinax vs. Plone as platforms for developing a social network with some RIA capabilities and a solid permissions setup allowing the user to make content visible on a per item/group basis. Would I be better off hacking Plone (and having to learn Zope, etc) or adding on/modifying Pinax with existing/new Django? Trying to...

Recommended .gitignore file for Python projects?

I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects, but I don't see many recommendations for Python and related tools (PyGTK, Django). So far, I have... *.pyc *.pyo ...for the compiled ...

django feedparser limit the result

Hi guys, im doing something with feedparser: i have a templatetag for display "news" in my home page, but , how ill limit the feedparser result? inclusion tag from django.template import Template, Library import feedparser register = Library() @register.inclusion_tag('rss_render.html') def rss_render(object): #RSS URL "object" rss...