Tagged Questions
0
votes
0answers
6 views
Is there any APIs or tools for python to make a webscraper that gathers statistics on twitter #s?
As the title explains,
im wondering if there is there any APIs or tools for python to make a webscraper that gathers statistics on twitter #s?
For instance, if i have a predetirmined set of hashtags ...
1
vote
0answers
25 views
How to move a model between two Django apps (Django 1.7)
So about a year ago I started a project and like all new developers I didn't really focus to much on the structure, however now I am further along with Django it has started to appear that my project ...
0
votes
0answers
10 views
Upgrading to Django 1.7. Getting error: Cannot serialize: <storages.backends.s3boto.S3BotoStorage object
I am trying to upgrade a django app from django 1.6.6 to 1.7 and am using python 2.7.8. When I run python manage.py makemigrations, I get the following error:
ValueError: Cannot serialize: ...
1
vote
1answer
13 views
Model Manager in Django - No reference to model class?
I'm having a hard time understanding how works a modelManager in Django 1.6.
I don't understand where is the magic that makes this code work.
In the get_queryset(self) method there is no reference ...
0
votes
0answers
14 views
How to filter one ForeignKey field based on another ForeignKey field in Django Admin?
I am trying to enter data in User model in django admin panel. I want to be able to filter the cities in the django admin panel when I select a country. The following is my code. I think I have to ...
1
vote
2answers
22 views
change url title if id changes - django
I have
def newsprofile(request, newstitle, newsid):
newsobj = get_object_or_404(NewsModel, pk=int(newsid))
return render(request, 'newsprofile.html', {'newsobj': newsobj})
but now, if I ...
1
vote
0answers
14 views
Celery and signals
I used to have a function like this
def calculate(self, input):
result = input * 2
if result > 4:
result_higher_then_four.send(result)
return result
Where ...
4
votes
2answers
27 views
Is it possible to modify Django Q() objects after construction?
Is it possible to modify Django Q() objects after construction? I create a Q() object like so:
q = Q(foo=1)
is it possible to later change q to be the same as if I had constructed:
q2 = Q(foo=1, ...
0
votes
2answers
17 views
Django: distinct on a foreign key, then ordering
I have two models, Track and Pair. Each Pair has a track1, track2 and popularity. I'm trying to get an ordered list by popularity (descending) of pairs, with no two pairs having the same track1. ...
0
votes
0answers
11 views
Django custom RelatedManager with ManyToManyField for multi-record inheritance
I have the following object structure:
class Car(models.Model):
name = models.CharField(max_length=16)
class Person(models.Model):
name = models.CharField(max_length=32)
cars = ...
0
votes
1answer
28 views
Django 1.7 - migrations from South
I have a project based on Django 1.6 with South. I wonder is it possible to upgrade my project to Django 1.7 with new built-in database migration system and save possibility to downgrade database to ...
0
votes
0answers
7 views
Celery Flower Is Able To Shutdown Worker But Unable To Restart It
I have installed Celery, Django-Celery, Kombu & Flower.
Celery Flower is monitoring fine. It is able to shutdown worker(s) but unable to restart them.
Flower responses:
[I 140903 15:49:12 ...
1
vote
2answers
22 views
Connect to python development django server from a non-local network machine
I am able to run my django dev server on my machine and make it accessible to the local network by running:
sudo python manage.py runserver IP:80
OR
sudo python manage.py runserver 0.0.0.0:8000
...
0
votes
0answers
9 views
'decoder jpeg not available' with PIL installed on mac 10.9.4 [duplicate]
I'm working with Django and on a subpage I got this Error:
IOError
decoder jpeg not available
So I googled this problem and I installed PIL, after this I tried Pillow. Still not working
0
votes
0answers
13 views
Django allauth error - ImproperlyConfigured - “No module named messagesallauth.account.context_processors”
I get the following error after the first steps of django-allauth installation.
ImproperlyConfigured at /admin/
Error importing module ...
0
votes
2answers
12 views
Django database field overwritten by property?
I would like to have a private field in my Model, and use it only under certain circumstances. But on the outside i would like to use it in a common way. For example my model is like this:
class ...
1
vote
1answer
42 views
django raise the exception somewhere
SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.associate_by_email',
)
by using the above code in settings.py i can avoid...
(1062, "Duplicate entry '[email protected]' for key ...
1
vote
1answer
27 views
Django, how to iterate over one to many fields of different lengths
I pretty new to Django and I am trying to create an app to display tennis match results. So far, beyond my belief I have managed to hack together some code that is working.
However, I now have a ...
1
vote
0answers
22 views
How to debug ImportError (with sys.path being correct)
I serve django pages via CherryPy. Everything works when CherryPy is started in the foreground. When I daemonize CherryPy with
Daemonizer(cherrypy.engine).subscribe()
I get an ImportError.
sys.path ...
1
vote
0answers
8 views
How can I optimize my Travis CI matrix for Django and Python versions?
I have a .travis.yml file that looks like this:
https://gist.github.com/dyve/d79e5cd4f81bb2675181
(original: https://github.com/dyve/django-bootstrap3/blob/develop/.travis.yml)
I have to type ...
0
votes
0answers
23 views
Django. Default template. Widget in all views [duplicate]
I am learning Django and I have a problem to write app with basic template who contains window with another content. Ok, my other templates are importing basic template, but how can I make function in ...
0
votes
0answers
18 views
django record the change of model
I have a requirement that record the change of some models and save in one table.
I think I can not use https://www.djangopackages.com/packages/p/django-reversion/
Because each type of record have a ...
0
votes
1answer
20 views
Cannot convert string to float inside Django Model
I've got a Django Model that has a field that saves as a string but has floating point values.
Ex: "0.123,0.221" is the string stored in the Location column. On saving, I want to save these values ...
1
vote
0answers
32 views
How to expose model methods to django-rest-framework
I have a model WeddingInvite which has a method for declining and accepting the invite like this:
class WeddingInvite(models.Model):
...
1
vote
1answer
17 views
Django custom aggregation
I am building a website for mentorship purpose. Wherein, there are logs coming in from the mentors about how did the meeting with his mentee(s) go. As part of dashboard I am ...
1
vote
1answer
30 views
Workflow when building django project with git/github
I am developing a django project with several others. When I create the project, I have the virtualenv, requirements.txt and my django project in my directory. I commit the entire directory and upload ...
1
vote
0answers
14 views
Show images on Django Non Rel Templates using Google App Engine
I'm doing an app with Django Non Rel on GAE, and i want to show the Profile Image of the user in the template but i can't here is the model:
from django.db import models
from ...
1
vote
0answers
40 views
How to get foreign key value in Django?
I have these three models namely:
ButuanMaps, Owner, LandProperty
class ButuanMaps(gismodel.Model):
class Meta:
verbose_name = u'Butuan Map'
verbose_name_plural = u'Butuan Maps'
...
1
vote
2answers
35 views
Django Registration 'str' object is not callable
I am using Django-registration-email in my Django project. In there documentation (Django-Registration-Email), I am instructed to add REGISTRATION_EMAIL_REGISTER_SUCCESS_URL in the settings.py. ...
0
votes
1answer
33 views
Django html redirects but doesn't load page
I am creating a Django web application and have come across the following problem.
I have created a new html page called teamList.html, which when clicking a href hyperlink on the main page, should ...
1
vote
0answers
35 views
Fill fields of a form on Django 1.5.7
I'm trying to do fill a form on Django==1.5.7, atm I have these codes:
models.py:
class UsuarioFidetel(models.Model):
"""
Modelo de usuario fidetel
"""
usuario = models.CharField(max_length=30)
...
0
votes
0answers
23 views
TypeError: __init__() got an unexpected keyword argument 'namedtuple_as_object'
Not really sure what is going on here. I got an error during template rendering.
This is a snippet of the html files code:
{% load jsonify %}
{% for geofence in geofences.all %}
...
0
votes
1answer
11 views
redirect not working on form submit django 1.6
I am trying to get a responding function to redirect to another page, however, all it seems to do is set the url of the browser and nothing else. I think the login page just reloads too. The page does ...
0
votes
1answer
14 views
Issue: object has no attribute '__getitem___' on django 1.5.7
I'm facing this issue on Django==1.5.7 I already tried what is specified on this SO question:
Object has no attribute getitem
With no luck, idk what could be possibly wrong, here's my model.py:
...
0
votes
1answer
45 views
Django Views - How does it work?
I'm a little bit confused on how Django's views work. I thought it worked this way:
User pressed a button on a html page
The action is linked to a view, so it goes to the function as defined in the ...
0
votes
1answer
9 views
list of all selected items from django select2 plugin
How can i pull out the list of all selected items in django select2 plugin?
So, I select 5 options in a select2 field and i want to use javascript and pass the list of selected options using an ajax ...
0
votes
1answer
25 views
How do I capture the href id of my index.html page into my views.py file and use it to render my 2nd html page in Django
my HTML code
<html>
{% for d in name %}
<li><a id = {{d}} alt={{d|slugify }} href ="/hindi_guitarchords/{{d}}"
class = "click">{{d}}</a> </li>
{% endfor %}
...
0
votes
2answers
18 views
How to modularize templates in django?
base.html
<!DOCTYPE html>
<html>
<head>
{% block head %}
{% endblock %}
</head>
<body>
{% block body %}
{% endblock %}
...
0
votes
0answers
8 views
Is there some way to use Lenskit as recommender engine and call him from Django/Python?
So my question is how will I be able to integrate it into Web, especialy a Django site? I know that there is PredictionIO (http://prediction.io/) that includes a Python SDK. Is there something like ...
0
votes
2answers
42 views
How can I switch my Django project's database engine from Sqlite to MySQL?
I need help switching my database engine from sqlite to mysql. manage.py datadump is returning the same error that pops up when I try to do anything else with manage.py : ImproperlyConfigured: Error ...
0
votes
1answer
36 views
Conditional Field/Form Validation using Django
I am trying to create a conditional field using django. "Approved" is a checkbox and "Date_of_approval" is a date field. "Member" is the class in-which the "clean" method is defined.
I want the date ...
-1
votes
0answers
27 views
Developing Blog app using Django Web Framwork
I am newbie to Django. Struggling with Django web framework. I have been trying to develop small blog app using Django Web framework.I am using MongoDb as backend
Followed tutorial at ...
0
votes
1answer
19 views
Django rest_framework.views how to skip database connection for simple rest API
Is there a way to disable default behaviour of django rest framework so that it don't lookup backend database? In my project I have few simple API's which don't need database. But behind the scene ...
1
vote
0answers
9 views
django-import-export allowing foreign key fields to be imported
I'm writing a tool for a user to import data on the site rather than in the admin and I've got some foreign key fields which usually are selected using a queryset in a form.
The model is fairly ...
0
votes
1answer
14 views
Get all models related to this model in django(via ForeignKey, ManyToMay)
I have to get all the models related to my current model. The relations can be by ForeignKey, ManyToManyField or OneToONeField, from this model or to this model.
For eg:
I have a model:
class ...
0
votes
2answers
28 views
Django is printing month name in english even when LANGUAGE_CODE is 'es-CO'
I've a Django project where I'm trying to render the month name inside a template with the date template tag.
In my settings.py I've the following because this app runs in Colombia (should be in ...
0
votes
0answers
13 views
Error when trying to post/insert moment in google+ with python
I'm trying to post/insert moment with python code in Google+.
But I'm really confused as it throws "oauth2client.client.AccessTokenCredentialsError: The access_token is expired or invalid and can't ...
0
votes
1answer
24 views
Widget error with TinyMCE in Django
I'm getting this error with TinyMCE in django:
TypeError: init() got an unexpected keyword argument 'widget'
I have followed the instructions as I found them, and don't know why the error is there. ...
1
vote
1answer
30 views
Django URL regex “is not a valid regular expression” error
I'm having a bit of trouble configuring the following url. I want it to be able to match a pages which start off with a category and then finish with a slug, examples:
/category1/post1/
...
0
votes
1answer
16 views
Running total with annotated querysets in Django
I have a running total template tag which looks like
from django.template import Library
register = Library()
@register.filter
def running_total(list, var_name):
return sum(getattr(obj, ...