django

Getting Django debug information when using Ajax call?

Is there a good way to get the debug information that Django provides when using jQuery to make Ajax calls? Right now when I make a call, I just see a http/200 server error in the python runserver window, but because the call is made through javascript, I don't get a debug page with all the information. ...

How do I form a URL in Django for what I'm doing

Desperate, please help. Will work for food :) I want to be able to have pages at the following URLs, and I want to be able to look them up by their URL (ie, If somebody goes to a certain URL, I want to be able to check for a page there). mysite.com/somepage/somesubpage/somesubsubpage/ mysite.com/somepage/somesubpage/anothersubpage/ my...

Is there any way to make an asynchronous function call from Python [Django]?

Srry for my English. I am creating some Django application, that does various long computations with uploaded files. I don't want make user wait for the file to be handled - i just want to show him some page like 'file is being parsed'. So, how can i make an asynchronous function call from a view? Something that may look like that: d...

Optional get parameters in django?

Can someone please explain how you can write a url pattern and view that allows optional parameters? I've done this successfully, but I always break the url template tag. Here's what I have currently: Pattern (r'^so/(?P<required>\d+)/?(?P<optional>(.*))/?$', 'myapp.so') View def so(request, required, optional): If I use the url t...

Python+Django social network open source projects

Hey, I'm looking for some open source, free to change and use project written on Pyton+Django with following features: Blog (for site, not for users) Users Registration User Profiles Adding friends, watching what friends added Award system for active users (carma, rating) Content rating Comments Probably different users levels (for a...

Encrypted Django Model Fields

A client wants to ensure that I cannot read sensitive data from their site, which will still be administered by me. In practice, this means that I'll have database access, but it can't be possible for me to read the contents of certain Model Fields. Is there any way to make the data inaccessible to me, but still decrypted by the server t...

Django: How can you stop long queries from killing your database?

I'm using Django 1.1 with Mysql 5.* and MyISAM tables. Some of my queries can take a TON of time for outliers in my data set. These lock the tables and shut the site down. Other times it seems some users cancel the request before it is done and some queries will be stuck in the "Preparing" phase locking all other queries out. I'm going...

Django-like framework on Ruby?

Django as a framework is a neat little package. There are very few files (compared to Rails) and it's got a clean structure. The fact that you can plug and unplug apps between different projects is an extremely nifty feature. At the same time, Ruby's hacking ability is unparalleled. It's complete object-orientedness makes it more express...

Fixing mod_wsgi after upgrading to Snow Leopard.

After upgarding my MBP to 10.6, I get the following in my apache's error.log: [error] [client ::1] Premature end of script headers: django.wsgi WSGI FAQ suggests: If using daemon mode, this is a symptom of the mod_wsgi daemon process crashing when handling a request. You would probably also see the message 'segmentation fault'. See...

CRUD pattern for urls.py, passing object from URI to view

Can the object value be looked up and passed to the generic view? Would the generic views need to be moved to views.py in order to support the object lookup? urls.py urlpatterns = patterns('myapp.views', url(r'^mymodel/create/$', view='mymodel_create', name='mymodel_create'), ) urlpatterns += patterns('django.views.generic', ...

Django: When saving, how can you check if a field has changed?

In my model I have : class Alias(MyBaseModel): remote_image = models.URLField(max_length=500, null=True, help_text="A URL that is downloaded and cached for the image. Only used when the alias is made") image = models.ImageField(upload_to='alias', default='alias-default.png', help_text="An image representing the alias") de...

Latin letters with acute : DjangoUnicodeDecodeError

Hi, I have a problem reading a txt file to insert in the mysql db table, te sniped of this code: file contains the in first line: "aclaración" archivo = open('file.txt',"r") for line in archivo.readlines(): ....body = body + line model = MyModel(body=body) model.save() i get a DjangoUnicodeDecodeError: 'utf8' codec can't...

Help with disorganized ajax calls + django

I'm having some trouble trying to organize a bunch of ajax calls I have on my index page of a record submission application. This is what I'm trying to do: I have a list on my /index page that hold a list of items I have in a database. This list is generated by django when I send an ajax call to /show_list and then load it into the o...

Is there a stable integration procedure/pluggin for Django 1.1 and Google app engine?

What is the best procedure/plugging to use to integrate django and google app engine? I have read many articles in the internet and seen videos on how to go round this. Am still left wondering which is the best procedure to use. Is there an official procedure documented in django or google app engine. Examples and site references will ...

How do I reference the underlying model of a django model form object?

When creating a form, I wish to use one field on the model as a label to go with another field that I'm updating. I've overridden the BaseModelFormSet with a new _init__ method, like this: class BaseMyFormSet(BaseModelFormSet): def __init__(self, *args, **kwargs): super(BaseMyFormSet, self).__init__(*args, **kwargs) for ...

need help solving sorl-thumbnail error: "'thumbnail' is not a valid tag library:"

I've been pulling my hair out trying to solve this problem and I've tried everything and I have no ideas left. I keep seeing this error: Exception Value: 'thumbnail' is not a valid tag library: Could not load template library from django.templatetags.thumbnail, No module named sorl.thumbnail.main $DJANGO_PACKAGES/sorl/thumbnail/main.p...

django tutorial problem: no module named pysqlite2

hi, Im following the django tutorial from http://docs.djangoproject.com/en/dev/intro/tutorial01/ but I have a problem at step:python manage.py sql polls django.core.exceptions.ImproperlyConfiguraed:Error loading pysqlite2 module: No module named pysqlite2 My system is windows vista,and python version 2.5 django version 1.1 only thi...

Django : save a new value in a ManyToManyField

Hi, I gave details on my code : I don't know why my table is empty (it seems that it was empty out after calling save_model, but I'm not sure). class PostAdmin(admin.ModelAdmin): def save_model(self, request, post, form, change): post.save() # Authors must be saved after saving post print form.cleaned_data[...

HTTP push examples in Flex

I am trying to create a simple board game (a kind of checkers), where users will be able to play online with each other using flex application as a client. I am using django application to process the game on the server side. And I come across the problem, if one user made a move, I can send it to a server, but how do I let the opponent...

How to fetch the top two products for each product type?

Let's say I have two models looking like this: class ProductType(models.Model): product_type = models.CharField(max_length=100) class Product(models.Model): name = models.CharField(max_length=200) slug = models.SlugField() product_type = models.ForeignKey(ProductType) score = models.PositiveIntegerField(default=0...