Django is an open source Web 2.0 application framework, written in Python. Its primary goal is to ease the creation of complex database-driven websites.

learn more… | top users | synonyms | django jobs

0
votes
1answer
11 views

How do I test Django QuerySets are equal?

I am trying to test my Django views. This view passes a QuerySet to the template: def merchant_home(request, slug): merchant = Merchant.objects.get(slug=slug) product_list = ...
0
votes
0answers
23 views

trying to make a checkbox cause a redirect using javascript

I have a Django app in which I'm trying to have some checkboxes in one of my pages redirect to a view that does some operations in my databse (toggling the boolean column that corresponds to the ...
0
votes
0answers
7 views

Django easy friends: tuple indices must be integers, not unicode

I am using django-easy-friends to import contacts from facebook. But when I click on the link facebook on 'import contacts' page I am getting the following. Please help on this. Thanks. [17/Jul/2013 ...
0
votes
0answers
9 views

Store Json data to sqlite3 database in django

I am a newbie to django + python, so please pardon my simple question. I am doing a https POST from a client which sends json data to the django server. I want to store this json in the sqlite ...
0
votes
1answer
17 views

Find objects into a list using Django and mongodb

I have used django but I'm a newbie with mongodb. I have the follow model: class Conversation(models.Model): date = models.DateTimeField(auto_now_add=True, db_index=True) users = ...
0
votes
1answer
18 views

django: Pass specific form data through JQuery

How to pass any specific form value for processing, through Jquery in Django? I want to pass the value of label 'machine' in my form to views.py by JQuery. Here is my code: template.py: <head> ...
0
votes
0answers
8 views

Where is libmysqlclient.16.dylib

I've been following advice from StackOverflow posts and I've been asked for MySQLdb to verify that I have libmysqlclient.16.dylib on my compute. Where do I find this in OS X 10.8?
0
votes
0answers
13 views

Django with a daemon process

This question involves a lot of technologies, but I will try to keep it simple. If, at some point, I'm doing something wrong, please advice me. I have a Django project, provided by Nginx for static ...
0
votes
0answers
12 views

Database error: Error in migration

I'm trying to make a site where I can add courses and inside the course a video tutorial along with a text post where I can say whatever I want my model.py is like this from django.db import models ...
0
votes
1answer
8 views

Webserver security wordpress, django and question2answer

I have a website where I have three scripts, django, wordpress and question2answer installed in different subdirectories, uses different databases. All authentication is handled by django and django ...
0
votes
1answer
14 views

Want to make sure object not in queryset before adding it

My "Event" object has a "Name" field. There is the possibility that the name is wrong, so a user may suggest a new name. That name gets put into the event's "suggestedN" list. However, I don't want ...
3
votes
2answers
20 views

Change Django Template Inheritance Dynamically?

I have a template with the following: {% extends "main/main-template.html" %} I also want a template with the exact same thing, only instead it {% extends "main/main-template-quick.html" %} It seems ...
0
votes
0answers
15 views

MySQL Syncdb image not found

I'm having trouble with mysql. I also have some related questions on another stackoverflow post. Python: MySQLdb and "Library not loaded: libmysqlclient.16.dylib" In the answer to this ...
0
votes
1answer
21 views

How to filter a django model with latitude and longitude coordinates that fall within a certain radius

I have the following model. class Location(models.Model): name = models.CharField(max_length = 128, blank = True) address =models.CharField(max_length = 200, blank= True) ...
0
votes
0answers
14 views

Debugging a custom django management command

I can't find how to debug custom management commands. When errors happen, they just say something like : IndexError: list index out of range How to get more debugging info ?
0
votes
2answers
20 views

Django filter related data

I need to make a queryset on django and I want to filter both a model and its related model. Like I need to get all PartRequest's that are created by a seller and I want to retrieve only his bid ...
0
votes
0answers
24 views

How can I filter data in this way?

models.py: class InjuredLocation(models.Model): reportperson = models.ForeignKey(ReportPerson) mark1 = models.BooleanField('Mark1', default=False) mark2 = models.BooleanField('Mark2', ...
0
votes
0answers
17 views

PyCharm - some breakpoints not working in a Django project

I'm seeing some bizarre behaviour in PyCharm. I have a Django project where breakpoints stopped working in some files but not others. For example, all the breakpoints in my app's views.py work fine, ...
0
votes
0answers
6 views

Django Admin database Query or Models error: DoesNotExist at /admin/

I am getting a database Query: DoesNotExist at /admin/ even those I know that data I am querying is in database. I could be Models error. Ok I can't give the code but here is example layout in my ...
0
votes
0answers
8 views

Selenose - django, selenium

So I'm tryig to use this tool: - http://selenose.readthedocs.org/en/latest/ No go. Still my driver is connecting wrong server. Except that documentation is incomplete or maybe even erroneous, that's ...
1
vote
0answers
15 views

Django-Userena: Overriding profile editing form

This is my first time working with Userena, and I'm trying to override the profile edit form so it won't show mugshots or privacy settings. Here is my attempt so far (from this page ...
0
votes
0answers
9 views

Excessive auth challenges using basic auth and Piston

I have a django app running a normal site and using django-piston to provide an API. I'm using basic auth to authenticate my iOS app, but while running the app, I'm getting an authentication challenge ...
0
votes
0answers
23 views

Django login fails silently

I can only login to my application after four or five attempts... using the same user and password (I am sure). The weird is that at every try, a new session is logged to DB. What I am doing wrong? ...
0
votes
2answers
33 views

how to view class variables from an inner class in python

I have the following class with inner class and class variable: class MyForm(forms.ModelForm): type_constant = 'type' class Meta: model = Customer fields = ('type') I ...
0
votes
0answers
19 views

Django save parent before child and set child fk from parent pk

I'm trying to figured this out but i can't. I have this models model.py class Client(models.Model) clientid = models.AutoField(unique=True, primary_key=True) # Some information class ...
0
votes
1answer
20 views

How do you get values from html and set them in the view for example if you wanted to create a new table row in Django?

This is my current Html i would like to grab the rootname and the currentplatform from my root table and create a new row on my log table using the root name. <div id="container"> ...
0
votes
0answers
11 views

Django formset.empty_forms adding forms dynamically

I'm using django-dynamic-formset to dynamically add forms to a formset. This works fine, as long as I have extra=1 while creating the formset. What I would love to do though, is have no form shown ...
1
vote
1answer
18 views

How to add a cancel button to DeleteView in django

What's the best way to add a "cancel" button to a generic class-based view in Django? In the example below, I would like the cancel button to take you to success_url without deleting the object. I ...
1
vote
1answer
16 views

'UpdateView with a ModelForm as form_class'-issue

The code I would like to get is for a page that has a simple form of one field to change a user's email address using an UpdateView. Sounds simple, but the difficulty is that I want the URL mapping ...
0
votes
0answers
20 views

refresh() got an unexpected keyword argument 'index'

I'm currently working on a django project that uses Haystack/elasticsearch. I've had much trouble installing elasticsearch on windows, finally using this setup: ...
0
votes
2answers
22 views

How to cast Django form to dict where keys are field id in template and values are initial values?

I have a huge django form and I need to create dict where keys are field id in template and values are initial values? Something like this: {'field1_id_in_template': value1, ...} Does somebody ...
0
votes
3answers
25 views

ORDERBY query on 2 django models collectively

I have 2 models namely A and B. Both have a common field, say timestamp. X = A.objects.all() Y = A.objects.all() results = chain(X,Y) # Union Now I want to apply ORDERBY query on ...
-1
votes
1answer
24 views

separate items with comma in template

template.html {% if leftbar.where_tab.0.location.title or leftbar.report.other_location or leftbar.report.location_description%} {%with ...
0
votes
1answer
20 views

Abort save in m2m_changed phase with Django

I need to save a django many-to-many field to a third-party server when saving a model. However, the third party server might be unavailable, in which case I need to abort the whole save operation. ...
0
votes
0answers
14 views

Django Raw SQL - Left Outer Join efficiency and better method?

I am attempting outer joins for 3 tables and was wondering if my method is correct and efficient? Models: class GuestCategory(models.Model): profile = models.ForeignKey(UserProfile) category ...
-2
votes
1answer
23 views

How to use django-redis package? [on hold]

I am new to redis(No-SQL). I am using django-redis package in my project. How to configure database settings in my django project. Is there any need to use other databases like MySql etc. If any one ...
0
votes
1answer
19 views

MultipleObjectsReturned and ContentType

There is a function: def Add_tag(request): if request.user.is_authenticated(): if request.method == 'POST': form = TagsForm(request.POST) if form.is_valid(): ...
0
votes
1answer
24 views

Django test can't initialize db but I can

The title isn't clear, I know that. I want to unit test my application so I wrote a little test that I wanted to execute. I launched python manage.py test but there was an error in the DB : The error ...
-1
votes
1answer
14 views

Display AutoField(primary_key) as read only in Django admin

My models.py has the following class: class TodoList(models.Model): id = models.AutoField(primary_key=True) def __unicode__(self): return self.id admin.py contains the following ...
0
votes
2answers
29 views

Store list of images in django model

I am building a Django data model and I want want to be able to store an array of ImageFields. It is possible? mainimage = models.ImageField(upload_to='img', null = True) images = models.?? Thanks. ...
0
votes
0answers
24 views

django - session lifetime variable

For example, after a user login, I need to create a socket object that connect to a server and this socket object will be used in following operations of this user(I don't want to make a new ...
1
vote
1answer
33 views

Django random value for Model field

So I am able to generate a random id using uuid So far so good But when I try to database i get same value def f(): d = uuid4() str = d.hex return str[0:16] class Q(models.Model): ...
-1
votes
1answer
29 views

Join all dataset

Have table in that I wanna show every B and C that has the same A. If C has a B it should show it both on a row. If C don't have a B, just show C. If B don't have a C, just show B. Is there any ...
0
votes
1answer
21 views

best practice: storing django models (db) in repository

I have some django models which are take quite long to create and I would like to know what is the best way of storing them in a repository such as git. One way would be just to serialize them and ...
2
votes
1answer
10 views

Django - how to wire urls correctly? url(), include(), ImportError

I try to structure my project by putting applications under an "apps" folder, like so: ├── manage.py ├── mysite │   ├── apps │   │   ├── __init__.py │   │   ├── myapp1 │   │   │   ├── __init__.py │   ...
0
votes
0answers
10 views

Django Tastypie: “error_message”: “'bool' object has no attribute 'read'”

I am using Backbone.js + Tastypie + Django and am trying to save a model using patch = true to update the points on a model, like this.save({ points: newPoints }, { patch: true }); This issues ...
0
votes
1answer
13 views

django 'LIKE' statement in Model.objects.raw()

I have problem in django using query statement "like %s%" with Model.objects.raw(). I guess the problem is on '%' character but i don't know where is it. Here's my model's code: def listInRange(self, ...
0
votes
0answers
5 views

Pisa html to pdf not parsing white spaces

I am utilising the Django framework and am trying to convert html to pdf pages but pisa is ... PITA example [pdf] generated from pisa: http://27.54.41.139:8000/reports/7/pdf/ actual [html]: ...
0
votes
1answer
36 views

Django int() argument must be a string or a number

I have a view which displays a form and saves the same form. When first showing the view I have no errors. However, when saving (POSTing) to the view I get the following error: TypeError at ...
1
vote
2answers
46 views

post_save called from admin but m2m doesn't get saved

I got a model which emits a custom signal in some cases when it gets saved. Running this "post_save" works fine when I'm not updating my items from the Django admin, but when I change them using the ...

1 2 3 4 5 1103