Tagged Questions
0
votes
0answers
16 views
Django 'module' object has no attribute ALL_FIELDS
The same code base in production is giving me the following error in my server logs. The issue seems to be with the zinnia blog app that I use within my Django CMS. What is this error and how do I ...
0
votes
0answers
8 views
Django rest_framework relations
So I am looking at django rest_framework relatedfield and I came up with a question on serializing a model with the following architecture:
class FooBar(models.Model):
foo_flag = ...
0
votes
0answers
17 views
500 error when trying to post to user's feed at facebbok
We are using the Authomatic package in order to allow our users to sign in with their social accounts, and also share contents from our site on their social network profiles.
Lately, the Facebook ...
0
votes
0answers
17 views
How to run different code in django based on heroku deployment
I'm trying to setup a python/django project. I work locally in win7 and would like to push to heroku. Ideally I would work in a virtualized environment to match local and deployment environments but ...
-1
votes
1answer
27 views
How to retrieve information from a Django template
I have a django template that calls a python methods but I can't seem to find a way for the python method to retrieve information from the template such as user input. Could anybody tell me how to do ...
0
votes
1answer
21 views
Customizing / extending / monkey patching Django Auth Backend
I am using django-auth-ldap to connect to an LDAP server for authentication. django-auth-ldap provides the setting AUTH_LDAP_REQUIRE_GROUP, which can be used to allow access only for users placed in a ...
0
votes
0answers
21 views
Data binding from the django server in angular js application [on hold]
I want to bind the data coming from the Django server into an AngularJs application.
Any help is most welcome
0
votes
1answer
34 views
Optimal way of including test file dependencies in a Python package
I have a Django app which has the following structure:
app/
tests/
files/
image.jpg
...
setup.py
MANIFEST.in
...
If I create a package, by default, ...
0
votes
2answers
32 views
How to escape partially a template variable in Django
I'm trying to highlight some text in the validation message of a Django admin form.
The result is something like this
valid_part
<span ...
0
votes
0answers
18 views
Understand Login with google account
I'm developing a little Django project that uses Google APIs (Just for implement my skills and understand Google API. So I don't want use any packages like Django-social-auth or Django-allauth).
And ...
1
vote
2answers
19 views
Django cache stores different key on get params
I am using django cache with django-redis-cache as a backend.
with
@cache_page(60*60*24)
decorator on views.
Now the issue I am facing is every get request is being stored with a different key ...
0
votes
0answers
18 views
Python 3 “The _imagingft C module is not installed”
I want to use django-simple-captcha in my web site. I went through installation guide in official site but captcha image doesn't load in borrowser and this error appears in console: 500 (INTERNAL ...
1
vote
1answer
11 views
Django efficient way to operate on cache values using redist
English is not my mother tongue, sorry for my english!
I want to operate on cache values using Redis cache system. Redis has many good operations itself, but cache module in Django doesn't support ...
0
votes
1answer
16 views
'Permission' instance expected, got … Permission instance?
I try to write data migration code for custom user type but when I try to apply migration I get this:
TypeError: 'Permission' instance expected, got <Permission: my_app | Some Text | Can add ...
0
votes
0answers
15 views
Django beanstalk jobs are not working: function call
First of all, I'm a completely noob with this. Let's assume that I have no idea of what I'm doing. My python version is 2.6, Django 1.4. I expose my problem:
I want to use beanstalk client to ...
0
votes
1answer
32 views
How to call method save() in a Django model class using attr string name?
For example in my code:
class ClassName():
[...]
image_bigger = models.ImageField(upload_to='dir', max_length=500, blank=True, null=True)
image_big = models.ImageField(upload_to='dir', ...
1
vote
2answers
43 views
Error: Uncaught SyntaxError: Unexpected token &
I get an error when sending JSON data to JavaScript from the models. It looks like encoding is causing the error, but all the examples I have found work for other people. How can I properly send model ...
0
votes
1answer
27 views
serialize mongodb query object in django to parse it to template
I want to serialize mogodb object which is returned by django ORM to json so that I can pass it to template directly.
Here is my mongodb document :firm
{
"_id" : ...
0
votes
1answer
26 views
python django 1.4 how to set two WWW-Authenticate http headers
Im developing small intranet web service. I want authenticate users over kerberos in MS AD or with basic auth. For that reason i need to set two 'WWW-Authenticate' http headers in response 401. How ...
0
votes
0answers
27 views
Passing arguments to Django social-auth Facebook login
My Django social-auth Facebook login works fine, using the default url /login/facebook/. I'm also able to do stuff with the new user by overriding the update_user_details method. But I would like to ...
0
votes
1answer
36 views
Thumbnails are created on each model save()
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name="person")
image = models.ImageField(upload_to='site-media/media/userimages/', default = ...
0
votes
1answer
40 views
Strange django ORM behaviour with threading
I have something very strange happening with queryset results that I am trying to access in a thread started within a Django project.
The issue arising is that in the init of the thread everything ...
0
votes
1answer
13 views
ImageField and Django Wizard Form
I've created a wizard form that worked up until I added an ImageField.
When I got to submit the form with an image file chosen I get returned to the page saying the ImageField is required.
I've set ...
1
vote
1answer
39 views
How do I run a Django 1.6 project with multiple instances running off the same server, using the same db backend?
I have a Django 1.6 project (stored in a Bitbucket Git repo) that I wish to host on a VPS.
The idea is that when someone purchases a copy of the software I have written, I can type in a few simple ...
0
votes
0answers
9 views
How to change Pinax login template?
I'm using pinax Theme Bootstrap (Github link) for an app, but I would like to change the form, beucause it's all in english and I would like to turn into portuguese. So, I don't know how to change ...
0
votes
2answers
57 views
HTML Background image
I'm using django and I'm trying to add a background image to my base.html, thus applying it to the rest of the site, but I've been having trouble.
<!DOCTYPE html>
<html lang="en" ...
0
votes
1answer
24 views
Django as a service login and logout
I have a rest API in Django 1.6 but I'm not using any library like django-tastypie or other to do that. I just write my endpoints (urls.py) and return json data in my views.py. For authentication I'm ...
0
votes
0answers
22 views
Custom registration form for use with django-allauth
I am trying to make a custom registration form to collect additional information from users during registration. As registration app I use django-allauth.
My model is
from ...
0
votes
2answers
30 views
overview of migrating python from the command line to a webpage
My coding experience is solely scientific applications with python and c, always running from the command line on my laptop or a remote server cluster. I have a command line tool (which does some ...
0
votes
2answers
32 views
Authorise a non Django User
I need to authorise a user on my Django powered site, but...
The user is not part of the Django user system (user table). However, I would it to behave like they have an active session just like they ...
0
votes
1answer
25 views
Listing querysets in django template system
I have the following model:
class Student(models.Model):
name = models.CharField(max_length=50)
surname = models.CharField(max_length=50)
city = models.CharField(max_length=50)
...
0
votes
1answer
28 views
Django + Oracle + Order
I have some problems with ordering elements in QuerySet using Django ORM.
Here is my models:
Item:
class Item(models.Model):
def __str__(self):
return self.getName()
Attributes:
...
0
votes
0answers
21 views
Django + Oracle count
I have a questions about count using Django ORM.
Item:
class Item(models.Model):
member = models.ManyToManyField('self', through='Relationship', symmetrical=False, null=True, blank=True)
...
0
votes
1answer
19 views
Defining the name of a ManyToOne relationship in Django
I would like to define a django model which has many-to-one relationship with itself. It is a user profile, connected as a OneToOne field with the authentication user model. I would like to save which ...
0
votes
2answers
29 views
Box API access denied, permission issue when trying to create a folder
I don't know why it's not letting me create a file at Box. I tried to change the settings around, but I still can't find the solution. Here is the code inside my django's view file:
#from ...
0
votes
2answers
41 views
Django: ForeignKey needs a default specified,what's that?
I have met this problem in django models.py
first I import a model named "User"
than I use it as a ForeignKey of one of my model "Question"
class Question(models.Model):
q_user = ...
0
votes
1answer
28 views
How to update multiple objects and increment from 0 to first if filtered to last
How to update all existing objects of model sequentially.
For example, have object with customids 1, 2, 3, 4, 5.
Delete customid 3, I then need to revalue the rest.
increment = 0
for obj in ...
2
votes
1answer
21 views
Django model views | How to Update objects from id_parameter to last, and increment 1 to value?
Django model views | How to Update objects from id_parameter to last, and increment 1 to value ?
def view_update():
car.objects.filter(from id to last).update(field=+1) # or delete
how i can do ...
0
votes
1answer
23 views
How to save where the user left off in a video [on hold]
I am making a video lecture system such as www.udacity.com
When the user logs in, I have to save what courses they are registered in.
When the user also clicks and views a video and logs out, I have ...
0
votes
0answers
11 views
Configure Django logging for an async worker process to email admins
In Django, the django.request logger catches exceptions and by default, if you're not in DEBUG mode, emails admins the stack trace.
Basically I want to replicate this behavior for an asynchronous ...
0
votes
1answer
14 views
django socialregistration authentication errors
I am trying to integrate my website to facebook and started with django-socialregistration. All goes fine when i add
{% load facebook %}
{% facebook_button %}
Now when I click the facebook button ...
0
votes
0answers
15 views
Django allauth signup form empty
I'm trying allauth for the first time and having difficulty signing up for the first time. I am using the Facebook support and I connect to Facebook successfully, logging in and get to ...
0
votes
1answer
23 views
Python-social, Django-nonrel, and GAE fighting over files, python-tk
I'm trying to host a Django app on Google App Engine, so I'm using Django nonrel and following these instructions. Now, trying to get Python social auth working on it, I'm running into two problems.
...
1
vote
2answers
46 views
Querying multiple Django models
I'm looking for some advice on how to execute a query against multiple objects and then use them together in a detail view for their related object. Here is what I'm working with right now:
-- ...
0
votes
2answers
27 views
Accessing Foreign Key values from a foreign key referenced model in django
Models
class Ride(models.Model):
type = models.BooleanField(default=False)
ride_comment = models.TextField(null=True,max_length=140,blank=True)
def __unicode__(self):
return ...
0
votes
2answers
27 views
Accessing dictionary values in django templates
Please help me in displaying the values of dictionary in django templates. I tried google to find out, but could not get the solution.
Below is the Model
class Ride(models.Model):
type = ...
2
votes
3answers
30 views
Django forms - form field for each model
I am stuck with a problem - I want to add a simple form field to edit the objects that I am looping through in the template. Here's my model:
class Topic(BaseModel):
name = models.TextField()
...
0
votes
0answers
17 views
How to shutdown tasks when MainProcess receives SIGTERM
I'm on Heroku and therefore only have 10 seconds to shutdown all tasks when the SIGTERM signal is sent. Some of my tasks will create subprocesses that will run for minutes at a time. It is OK for ...
0
votes
2answers
30 views
Advance Django app
I am a little new to Django framework. I have pass the Django's tutorial and I would like to ask a very simple question. if I want to build an advance web app with database except of django ...
0
votes
0answers
23 views
How to running django 1.6 on apache2?
How to running two sites in apache2 that one of site is django 1.6 on port 8000 and another site on port 80?