Tagged Questions
1
vote
1answer
23 views
“object got multiple values for keyword argument” when writing database using dictionary
I have a django model with fields: city, country_name and country_code.
I have a dictionary which has more than 8 key-value pairs; I want use only 3 and write into database.
But I am getting an ...
0
votes
1answer
15 views
ImportError :no module named app_name
I am new to python and I have seen similar questions on SO but not able to figure out whats wrong with my Django app.
In settings.py I have added my app in dotted module form :
INSTALLED_APPS = (
...
0
votes
0answers
16 views
Online Employee Coaching and Review Form [on hold]
My company is starting a project to put everything online (it's really a directive of one of our biggest clients to be paperless). This means even Employee Review forms, Appraisal, coaching logs and ...
0
votes
0answers
17 views
Unresolved Reference “widget_tweaks”
I am quite new to Django.
I have installed the django-widget-tweaks in my project.
And I have also included "widget_tweaks" in the INSTALLED_APPS.
However, pycharm shows the unresolved reference error ...
0
votes
1answer
20 views
Static files served by django in development and apache in production. Why not use same folder?
This question is not because I have a problem that needs to be solved, but my belief is that a django convention is redundant, and if this is not the case, my understanding is wrong.
When I develop ...
0
votes
0answers
18 views
django-eav: getting a user-created attribute by name
If I have a model class registered to the eav model, then later some users create their desired attributes (or fields), how do I go about setting that value to the registered model?
e.g.
this part ...
0
votes
1answer
33 views
Getting a 'got multiple values for keyword argument' error
So I'm generating a two-week expired-domains report. It gets emailed off daily. I've been plugging away at one particular issue I'm running into for a few days and can't for the life of me figure ...
0
votes
1answer
23 views
How to create tables for flask app using peewee orm without double quotes in postgresql
I'm new to peewee orm.
Peewee uses double quotes when creating tables making it unnecessarily difficult to do select statements through psql shell. This goes for django's orm as well.
What I really ...
0
votes
1answer
20 views
Class based views query: get objects referenced by another model
this question extends
Django Pass Multiple Models to one Template
In that I want to produce 1 template, that is my profile index page, so it will list all the objects created by the user specified in ...
0
votes
1answer
26 views
How do I install psycopg2 for Python 3.x?
Just started Python a few days ago and I'm using PyCharm to develop a web application with Django. I have libpq-dev python-dev packages already installed, but it's still throwing me the same error:
...
0
votes
1answer
21 views
In Powershell django-install.py not recognized. Already added Scripts directory to PATH
This happened to me on multiple machines already... typing django-admin.py startproject test yields the The term 'django-admin.py' is not recognized as the name of a cmdlet.... error, while trying to ...
1
vote
2answers
27 views
Django Installation Error (No Module Named Django)
I am using Mac OS X Mavericks.
I have an error with installing Django. Using the "pip install" command I installed Django. It is in the directory below.
Requirement already satisfied (use --upgrade ...
2
votes
1answer
11 views
Pyodbc Query Failing on Model Without ID
I'm having difficulty understanding why one of my queries is failing.
I'm using pyodbc to connect to a SQL Server database on a Django application. All my other queries are working fine, except for ...
-1
votes
1answer
19 views
Error when reading an Excel-generated CSV file in Django
I have problems reading a CSV file generated by Excel. The code reading the file is very simple and it works ok with CSV files generated by hand:
file = request.FILES['organisations']
data = ...
-1
votes
0answers
21 views
How to get a field info from a response django
I need to access to one of the fields in the response "y" so I can make and other filter, but I don't know how to access to the field. the question is how to access to the field that I need to access, ...
0
votes
1answer
26 views
Having trouble downloading oracle sql
I run on OS X 10.5.8 and am trying to download Django IDE. Before I download Django i tried to download Oracle SQL workbench which requires the latest version of JDK 7. My os does not meet the ...
0
votes
0answers
22 views
Django Haystack and Elasticsearch Error Using rebuild_index
I want to use elasticsearch engine for django-haystack. I was able to install every modules and packages successfully.
I run this command
sudo service elasticsearch start
, below is the ...
0
votes
1answer
25 views
Keeping original request link between redirects in Django?
I do use the default django.core.context_processors.request template context processor so I can access request instance of HttpRequest in my Django templates.
One use is to retrieve original sender ...
0
votes
1answer
34 views
Django Multiple Views for index/dashboard template
So im trying to use my django installation to create a dashboard a combination of all the data from the 4 other models and views. For our use of django we mainly use it for stats so it's generally ...
0
votes
0answers
15 views
Django CalledProcessError, returned non-zero exit status 1
I've been trying to fix this issue for days but when I run my project I get this error message: Command 'pdftk /home/jnm/Dropbox/Project/site/media/documents/example.pdf fill_form /tmp/tmpWVDEaW ...
0
votes
1answer
20 views
Filter iexact error Model matching query does not exist
I'm trying to verify if a value exists in my database with:
q = model.objects.filter(field__iexact='1')
But this makes an error in Django, which returns this message:
DoesNotExist at ...
0
votes
1answer
30 views
Unable to configure views, urls.py SyntaxError: invalid syntax
I'm having issue while configuring views and I am following django 1.5 official tutorial.
Here is my Code for polls/urls.py.
from django.conf.urls import patterns, url
from polls import views
...
0
votes
2answers
47 views
Which datatype in Django model to be used to save HTML5 type “month” in database
I have a HTML form with field which takes input as month
<input type='month' name="last_appraisal" id='txtLastAppraisal' value='2013-12' />
In my Django model this field is defined as
...
0
votes
0answers
13 views
Using a “non resource” object with a tastypie api
I have a tastypie based api, and I would like to use some api endpooint which do not match a resource like behaviour
eg. forgot password
I would still like it to be within the tastypie universe so ...
0
votes
1answer
34 views
is it possible recive form value witten in pure html in django views file
I am New to Django. I have html form file & want pass only two integer which will work in a view function. I need to get value in view function of django framework. I read form and Widgets but its ...
1
vote
1answer
17 views
Error while setting up geoip for my site “GeoIP path must be a valid file or directory”
For my django app I am trying to store log of login location by amdin.
I created a middleware and trying use from "django.contrib.gis.utils import GeoIP" to get the latitude and longitude values of ...
1
vote
0answers
17 views
“quoted printable” or “7/8 bit” as transfer-encoding when send email
My app needs to send email to users. The backend is Django 1.4, which uses "7/8 bit" when send email. Recently I found the delivery rate is low. One thing I've noticed is that Facebook uses ...
0
votes
1answer
29 views
django simple captcha keeps saying `invalid CAPTCHA`
I have followed the steps given by the docs,
firstly , it works well ,but ,i don't know anythings wrong ,it makes
an invalid Captcha.
i run the manage.py test captcha,
it says like this :
...
0
votes
0answers
41 views
Django FormView Not Saving
My form isn't saving the models that I need it to. My form:
class RewardForm(forms.Form):
quantity = forms.IntegerField(max_value=10, min_value=1, label=_('quantity'), initial=1)
reward = ...
-3
votes
1answer
32 views
How to replace specific string in Django Template Language? [on hold]
I am working on Djingo template language.I am working on Forms and table which is taking some data from database and showing it in tables.
Now i want that if there is some value coming from database ...
0
votes
0answers
23 views
django rest framework - custom renderer
I'm trying to tweak the existing XMLRenderer to create a custom one -
class CustomRenderer(renderers.BaseRenderer):
"""
Renderer which serializes to CustomXML.
"""
media_type = ...
1
vote
3answers
48 views
django - next higest number in a list
My users can save their settings for access to their pages as a comma seperated integer list. Users will have a different list value depending on the settings they save. For example:
User 1: ...
0
votes
0answers
20 views
Django ManyToManyField FieldError in second app - Cannot resolve keyword 'xxxx into field
I'm trying to write an application where users can submit photos. Part of this involves voting for photos. So in my models.py I have:
photos/models.py
class Photo(models.Model):
votes = ...
0
votes
1answer
19 views
Subclassing User to differentiate between an admin and an App with an API key?
This is my first API, so please forgive/correct me if I make any wrong claims.
I have an app that has an API. I would only like external apps (mobile clients etc.) with a valid API key to have access ...
1
vote
0answers
11 views
Django Tastypie 'All_WITH_RELATIONS' is not defined
I'm trying to use resource filtering in Django Tastypie however I get an error when I try to import 'ALL_WITH_RELATIONS'. Below is the full error:
api/resources.py", line 309, in Meta
'receipt' : ...
0
votes
2answers
34 views
using HttpResponseRedirect
In one of my view function, under certain condition I want to redirect to another URL.
So I am doing
return HttpResponseRedirect(reverse(next_view, kwargs={'name': name1}))
Now I have another view ...
0
votes
1answer
23 views
Python Fabric - read environment variables in virtualenv's postactivate
I have a number of environment variables on my server. Currently they are in .bashrc and also in my virtualenv's postactivate file - also in my various supervisor config files.
I'm wondering if it is ...
0
votes
1answer
28 views
Python/Django Extract and append only new links
I am putting together a project using Python 2.7 Django 1.5 on Windows 7.
I have the following view:
views.py:
def foo():
site = "http://www.foo.com/portal/jobs"
hdr = {'User-Agent' : ...
0
votes
0answers
15 views
django-shop need success to be different for product add vs cart update
When using django-shop, there seems to be two basic ways to add items to the cart: through the product detail view and via changing a quantity in the cart view and posting an "update cart". ...
1
vote
1answer
27 views
Tastypie 'Search' Only Returns Resource Name
I'm trying to create a function that filters objects by a ForeingKey field (or rather the object being referenced in the field). I wrote the function which I have included below, which is based off ...
0
votes
2answers
38 views
“pop expected at least 1 argument” error [duplicate]
I am getting
pop expected at least 1 arguments, got 0 without any clue why I get it.
models.py
class preset_list(models.Model):
VIEWS = (
('1', 'X'),
('2', 'Y'),
)
...
1
vote
1answer
21 views
Missing dependencies for Django on Google App Engine
I'm trying to deploy the Google App Engine Django example from https://developers.google.com/appengine/. While trying to run the local development server (./manage.py runserver) I've been working ...
0
votes
1answer
25 views
serving dynamically generated static img file in template django 1.6 dev server
I am trying to serve a static img file in a template that I have just had Django generate. The template code looks like this.
<img src="{% static {{ output }} %}" height="50px" width="50px" ...
1
vote
1answer
30 views
pandas dataframe as field in django
I want to add pandas dataframe (or a numpy array) as a field in django model. Each model instance in django has a large size 2D array associated with it so I want to store it as numpy array or pandas ...
0
votes
0answers
17 views
Django model with self referencing method not saving as expected
I've got a model for activating accounts via email confirmation as part of my signup process.
What should happen is a user gets created, then pulled, and referenced in a registry object which gets ...
0
votes
2answers
12 views
django LBForum TemplateSyntaxError
i use virtualenv, django 1.3.1 and LBForum (0.9.22) cms
I need help how to correct the mistake?
Thanks in advance
Template error
In template ...
0
votes
2answers
33 views
Django : Two Models from Separate Databases
I am new to Django; I have a legacy database I do not control with some information regarding a user and a database on my server with data pertaining to something that user is doing. I want to take ...
0
votes
1answer
12 views
Django Models when to use a GenericForeignKey
I have the following models:
class Dog(AbstractAnimals):
pass
class Meta:
app_label = 'animals'
class Cat(AbstractAnimals):
pass
class Meta:
app_label = 'animals'
...
0
votes
1answer
21 views
error importing a model in different django app
wishhing you a happy and a productive year. I have the following django project.
geoedu/
├── geoedu
│ ├── __init__.py
│ ├── __init__.pyc
│ ├── settings.py
│ ├── settings.pyc
│ ├── urls.py
...
0
votes
0answers
17 views
Django Compressor UncompressableFileError
I'm getting an error when using Django Compressor and Django Storages (with AWS):
'https://myapp-assets.s3.amazonaws.com/myapp/stylesheets/company_list.css' isn't accessible via COMPRESS_URL ...