Tagged Questions
0
votes
0answers
14 views
Adding Attributes to Django Queryset Using setattr
Not sure what the difference is but I have two snippets of code that i assume should behave the same.
This works:
channels = ...
0
votes
0answers
16 views
Django Admin: Default values in StackedInLine / TabularInLine
I'm creating a website and it needs support for internationalization. The default languages are Portuguese, English and Spanish. I'm using the django-i18nmodel and so far it works great.
When the ...
0
votes
0answers
14 views
Django debug toolbar SQL panel SUDDENLY stopped working
I used Django debug toolbar panel for month with no problems at all.
Suddenly I got error when I do manage.py runserver:
django.core.exceptions.ImproperlyConfigured: Error importing debug
panel ...
0
votes
1answer
18 views
Create a User Object with a Call to TastyPie API
I have a Tastypie resource for a model extended from django.contribut.auth's User model (just a few extra fields). Here's the resource code:
class CustomerResource(ModelResource):
locations = ...
0
votes
1answer
26 views
Django; Will not make the correct request
I am just beginning to learn how to use django. I have set up my views.py, urls.py, settings.py, and relative HTML pages. I am able to get the index page to come up but not the about page (only ...
0
votes
1answer
23 views
How to determine the count of distinct values in a Django model's field?
Suppose I have the following model:
from django.db import models
class Profile(models.Model):
'''
Represents information about a user
'''
# ...
age = ...
0
votes
0answers
12 views
Chain and group tasks methods with celery
(is that ok? xD)
Well, I have the following situation in a project with Celery. Let me put you all in context.
I had a lot of tasks that consume an API to make some configurations in a service we ...
1
vote
3answers
25 views
Django {% blocktrans %}: How to handle pluralization inside a for loop?
I have the following loop in my Django template:
{% for item in state.list %}
<div> HTML (CUSTOMERS BY STATE) </div>
<!-- print sum of customers at bottom of list -->
...
0
votes
1answer
33 views
Django “Cannot resolve keyword” error. Can someone explain this?
I am just begining to learn how to use django. I am comming up with this error in my CLI
File "C:\Python27\Lib\site-packages\django\db\models\sql\query.py", line 1337,
in setup_
"Choices ...
0
votes
0answers
25 views
django app: Cannot assign “''”: “ImageText.link” must be a “Link” instance
I'm building an app for my Django 1.5.1 and Django-cms installation.
The app meant to permit to upload an image linked to an URL.
My code :
cms_plugins.py
from cms.plugin_base import CMSPluginBase
...
-1
votes
1answer
32 views
Django + Sockets
Whats the best alternative to implement sockets with Django 1.5?
I'm willing to implement a chatroom and notification in my Django site.
I've already reviewed Socket.io and node.js but would like to ...
0
votes
0answers
44 views
django: Overriding save() method not working when creating object in admin site
I have model in my model.py and two fields with unique parameter set to True. When I try to create object (leaving these fields blank) in admin site, it ends up with error "Service with this Zmluva ...
0
votes
1answer
16 views
How Django signal receiver should handle errors?
Cite from docs:
...look at the **kwargs argument. All signals send keyword arguments,
and may change those keyword arguments at any time. In the case of
request_finished, it’s documented as ...
0
votes
0answers
9 views
django-ajax-selects raises Exception object not found for many to many admin inline
I am using django-ajax-selects to facilitate user input in Django admin; specifically in a many to many relation where the 'through' model is inlined:
models.py
class Part(models.Model):
...
0
votes
1answer
30 views
can i do this in django? admin with pages as models vs cms?
Today I was just in the train and had some spare time to think about django cms and admin.
Can I define pages as models like this:
class ArticlePage(models.Model):
slug = models.TextField()
...
0
votes
1answer
32 views
Post form values not showing up
This is my HTML form
<form method="post">{% csrf_token %}
<strong>Start</strong><br />
Lng: <input type="text" id="start_lng"><br />
Lat: <input ...
0
votes
2answers
36 views
Django: How to get count of ValuesQuerySet?
I am trying to get count to work on a ValuesQuerySet. According to Django documentation
values = Model.objects.values()
will return a ValuesQuerySet which is a subclass of QuerySet
Returns a ...
2
votes
2answers
41 views
django unique together does not work with none datetime
I am using django 1.5.5 and python 2.7 and MySQL
this is my model
class Foo(models.Model):
user = models.ForeignKey(User)
date = models.DateTimeField(null=True, blank=True,editable=True)
...
0
votes
0answers
25 views
How can I request POST and GET variables from a specific IP in a Celery Task?
I'm developing a project with Django and Celery and need some help with requesting POST/GET variables from a specific IP. I searched through all internet and didn't found exactly what I needed.
My ...
0
votes
2answers
21 views
How do I specify a KEY_FUNCTION for a specific @cache_page
I need to update cache for specific view in depends of what time is it. Not just 60mins long live of cached page, but it should become new in concrete time - when the new hour begins.
2
votes
1answer
39 views
south migration: “database backend does not accept 0 as a value for AutoField” (mysql)
I'm new to django and trying to have a Foreign key back to users for an assignee and reporter.
But when i'm trying to apply the change with South i get the error
ValueError: The database backend does ...
0
votes
0answers
34 views
Which is the best javascript framework to use for single page app with backend as django? [on hold]
I have to create a single page app and I am using django framework for backend. I want to know which javascript MVC framework will be best to implement a single page app. Using bootstrap for frontend. ...
1
vote
2answers
37 views
CSRF Django, ValueError
I follow the tutorial here but i get the following error
ValueError at /mapapp/
dictionary update sequence element #0 has length 1; 2 is required
These are all the files which has csrf related code ...
0
votes
0answers
16 views
Scrapy - How to pause on Connection loss and Resume when connection back on?
Does anybody have an idea on how to pause the Scrapy crawler when the Internet connection is lost, and resume the crawler when the connection is back on?
There is a middleware for this, and I'm ...
0
votes
1answer
48 views
Which database to use with Django and Python 3? [on hold]
I'm writing my first application with Django and Python 3.3.3. I've always used MySQL for others projects, but it seems to have some problems with Python 3.X and MySQL :
At the time of writing, ...
0
votes
0answers
21 views
Change/remove current file display in a ModelForm
I'm following the method described here: http://nemesisdesign.net/blog/coding/django-private-file-upload-and-serving/ to serve files outside of the doc root. Works fine, with one exception. I use a ...
2
votes
0answers
27 views
Cannot create Django Project in PyDev
I am running Eclipse Kepler 4.3 with PyDev 3.0 on Ubuntu 12.04 LTE. I have default Python 2.7 installed. I have installed Django with:
sudo pip install django
I have installed PyDev from update ...
-1
votes
1answer
26 views
how to retrive values form RawQuerySet in django?
my input query is
query =select * from tab1
left join tab2 on tab2.patient_id =tab1.patient_id ,tab3
left join tab4 on tab4.patient_id =tab3.patient_id
data =model_name.objects.raw(query)
...
0
votes
2answers
31 views
I need to overwrite an existing Python installation in ubuntu 12.04.3
and thanks ahead of time.
I am relatively new to Linux and am using Ubuntu 12.04.3. Basically, I've been messing around with some files trying to get Django to work. Well, I though I should do ...
0
votes
1answer
38 views
Django1.6, will transaction works for raw SQL?
Examples from offical document
from django.db import connection
def my_custom_sql(self):
cursor = connection.cursor()
cursor.execute("UPDATE bar SET foo = 1 WHERE baz = %s", [self.baz])
...
-4
votes
0answers
15 views
How do I integrate ogone with django [on hold]
I am looking for examples code in django of hipay or ogone integration for e-commerce.
Any example would be appreciate.
Regards
0
votes
1answer
33 views
How to create Views with less queries in django
Models.py
class Book(models.Model):
created_at = models.DateTimeField(auto_now_add=True, editable=False)
name = models.CharField(max_length=255, unique=True)
slug = ...
0
votes
0answers
38 views
Debugging Apache/Django/WSGI Bad Request (400) Error
My simple Django app worked fine in debug mode (manage.py runserver), and works under WSGI+Apache on my dev box, but when I pushed to EC2 I began receiving intermittent (10-80% of the time) errors of ...
0
votes
1answer
19 views
changing from django generic view to class based view
This is my blog/urls.py file and i am in Django 1.6, when i run my server it complains : Could not import django.views.generic.date_based.archive_index. Parent module django.views.generic.date_based ...
0
votes
1answer
43 views
Django: password reset ReverseMatch error
I'm having trouble getting password_reset_confirm to work. I have looked at numerous solutions, but none seem to be working for me.
urls.py: (in particular, the third line)
...
-3
votes
1answer
34 views
I did “hg update -C” and now nothing is working anymore [on hold]
I did hg update -C on prod server and nothing working anymore. TemplateDoesNotExist, Database Column Does Not exist and all possible error messages.. what did I do wrong?
0
votes
1answer
29 views
Django: URL Reverse for '/job/job_view/' with arguments '()' and keyword arguments not found. 0 pattern(s) tried: []
I just started out trying to user django reverse for URL lookups and ran into this issue. Everything I see looks like it should work. I'm passing it the view def to render the page, as well as the ...
0
votes
0answers
15 views
Escaping special characters in django-haystack query
I'm trying to use Solr specific syntax with some of my django-haytack queries. For example I'd like to search: "state:Georgia", but haystack sends it to Solr as "state\:Georgia", breaking the ...
0
votes
0answers
25 views
Tracking django sqlite3 locking
I'm developing a Web service using django (it's not the best framework and such, don't bother).
The main flow -
Post listener to add new objects.
post_save listener that adds to a queue.
Thread ...
1
vote
0answers
27 views
“init/djangoproject restart” results in “cannot import name six” error
I'm reformulating a previous question hopefully it's more clear: I'm working remotely via SSH. After upgrading virtualenv (successfully) I have to restart my project, I have no expertise but the ...
1
vote
1answer
41 views
TypeError: 'person' is an invalid keyword argument for this function
I have this model:
class EntryBook(models.Model):
status = models.IntegerField(max_length=2)
date = models.DateTimeField(auto_now_add=True, blank=True)
person = models.ForeignKey(Person)
...
0
votes
1answer
34 views
Django Python Database very beginner frustrations
I am at the very beginning stages of learning Django and I have come to a very frustrating halt.
When using the Django database, I set up my models file and sync the database with manage.py.
But how ...
0
votes
0answers
39 views
AttributeError: 'DatabaseWrapper' object has no attribute 'Database'
Version numbers are Django 1.6, Python 3.3.2 and Mac OS X 10.9
I create an app with this command
python3 manage.py startapp lists
Then in my lists/tests.py file I put this code
from django.test ...
1
vote
2answers
15 views
how to set DEBUG value automatically in django on Google App Engine
I think the question says it all..
I want to set DEBUG=False when running on Google App Engine but want to make it True on local machine..
(I am not using django-nonrel)
0
votes
0answers
17 views
Override save or signal - parse website from url field
class Website(models.Model):
title = models.CharField(max_length=199)
url = models.URLField()
uregent_content = models.CharField(max_length=199)
... #other data from website
I need ...
-1
votes
2answers
43 views
i can't take the “?” character in the URL of django url
I try to code to django a redirect fonction. I provide the url, and i want to redirect to the provided URL.
in my urls.py:
urlpatterns = patterns('',
url(r'^redirect/(?P<name>.*)$', ...
0
votes
1answer
18 views
Insert a new field in a specific admin view?
I'm trying to extend default Django's model with a new field.
In localsite/models.py I have the following code:
from django.db import models
from django.utils.translation import ugettext_lazy as _
...
-6
votes
0answers
37 views
Python/PHP sales commision scripts or logic for any kind of products [on hold]
Hi I am new to programming. I have worked with PHP and wordpress. Now I am looking forward to learning Python and Django.
These days we can see many marketplace and drop shipping sites like ...
0
votes
1answer
32 views
Django project on google app engine without django-nonrel
I am trying to build a simple static site using django. since, Google App Engine provides django's template engine I don't want to unnecessarily use django-nonrel as for now.
So, I created my django ...
0
votes
0answers
35 views
Django view return error with jQuery post
I have the following JavaScript jQuery AJAX call to a Django view:
$.post('/accounts/ajax/user_verification/', data)
.done( user_verification_cb )
.fail( console.log('user_verification POST ...