0
votes
0answers
12 views

Uploading excel data into django without saving the file

I am a newbie to django and i'm desperate for help uploading and reading excel data without actually saving the data on the machine. I have written some code and taken some from the research i've done ...
0
votes
0answers
5 views

Filter the dropdown list in django admin for Foreign Key

class reviews(models.Model): uuid=models.ForeignKey('index_list') description=models.CharField(max_length=100) def __unicode__(self): return unicode(self.uuid) class ...
0
votes
0answers
8 views

Basis for an application using Django, a RaspberryPI, and calling some probes

We need to build an application based on Django as a standalone on a RaspberryPI. The Django server serves the application on localhost. The application is a serie of tests from probes that are ...
0
votes
0answers
11 views

Using Postgresql with Django - Can't use Psycopg2

Because of license issues, I'm not allowed to use Psycopg2 as my database connector. PyGresql is fine though, but it doesn't contain a django connector. I don't need to use Django ORM, just simple ...
0
votes
0answers
15 views

condition to check if the value present in the list or not.?

I asked similar question yesterday inside-for-loop-if-condition-not-working-in-django but now i have checkbox to work {% for items in store %} <div class="col-xs-6"><input type="checkbox" ...
0
votes
0answers
7 views

Filtering against a DateTimeField over a django/tastypie REST API doesn't work for any comparison other than '='

I have a REST API functioning (mostly) using tastypie in django-1.6. The relevant entities are TestSubjects and Observations. I would like to find all observations that happened within 5 minutes of a ...
0
votes
0answers
18 views

Django create superuser issue fail to log in admin page

While trying to create a superuser in Django project this message always shows up: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: cannot import ...
0
votes
0answers
7 views

django turkish characters converted to html escaped string

I have a django form model, that represents a text field. class foo(models.Model): bar = models.CharField(widget=models.Textarea(), required = False) when user types some turkish chars like ...
0
votes
0answers
25 views

how to check the field “select”?

please help check field 'select'. model: class Message(models.Model): reciever = models.ForeignKey( User, related_name='recipient', blank=False, ...
0
votes
1answer
14 views

Django - Confirmation on first visit

In my new django project, I want the visitors to confirm the terms and condition before visiting a specific site, but this should only happen on the first time they visit the site. They don't have to ...
-1
votes
1answer
20 views

Django Tutorial - Models explaination

In the url: https://docs.djangoproject.com/en/dev/intro/tutorial01/#playing-with-the-api I'm unable to understand this line: # Display any choices from the related object set -- none so far. ...
0
votes
0answers
11 views

Django Inline Admin delete missing

Here is my admin.py class BooksInlineAdmin(admin.TabularInline): model = Book extra = 2 max_num = 4 def has_delete_permission(self, request, obj): return True class ...
0
votes
0answers
11 views

Django Rest Framework File Upload TypeError: __init__() got an unexpected keyword argument 'image'

Views.py def put(self, request, uuid, format='multipart'): ''' Upload New Image ''' serialiser = PictureSerialiser(business=uuid, image=request.FILES) if ...
0
votes
0answers
15 views

Serialize a ForeignKey field

I have a issue with a foreignkey field by AJAX: This is my model: class PersonManager(models.Manager): def get_by_natural_key(self, name): return self.get(name=name,) class ...
0
votes
0answers
10 views

Django should log into gunicorn's logfile

I've got a django-app which runs on a server. It starts with the gunicorn. I want that django put it's log output into the logfile of gunicorn. But when I look into the file there is no ...
5
votes
1answer
14 views

twitter API for python with modifying favorites and other features

I want to make a python program which has functionality like all possible twitter operations mainly creating and deleting favorites . There are many packages like tweepy , python-twitter ,TweetPony ...
0
votes
0answers
9 views

How can I use variables in crontab command

I am trying to pass a variable as a command to crontab file through a python script with the help of os.system(). selvalue = postedinfo['selvalue'] hours = postedinfo['hours'] minutes = ...
0
votes
1answer
20 views

Trying to query a database by current user, but Django stops at template if statement

This is my first post on Stack Overflow, so I apologize in advance if I am somehow not abiding by the question asking etiquette. Currently trying to query the database represented by this model, ...
0
votes
0answers
18 views

Instagram API doubts

i'm using the instagram API for python, i'm using django. I'm trying to use the "user_recent_media" that in theory returns "The most recent media published by a user." but when i use this var = ...
1
vote
2answers
28 views

Comment other comments in Django

I have a model for comments which uses GenericForeignKey and a model for posts. class Comment(models.Model): content_type = models.ForeignKey(ContentType) object_id = ...
0
votes
0answers
13 views

Django admin filter reverse foreign key based on selection from list model

I have a django model as follows: class M1(models.Model): code = models.CharField(max_length=25) title = models.CharField(max_length=500) description = models.CharField(max_length=1000, ...
0
votes
2answers
19 views

MultiValueDictKeyError when you transmit data from the form to the model

My model: class MyNote(models.Model): text = models.CharField(max_length=140) pub_date = models.DateTimeField('date published') My form: class Note(forms.Form): note = ...
0
votes
1answer
18 views

How to handle nested template variables?

I currently have an embedded <iframe> that has a hard wired static url: <iframe src="{% static 'docs/ver600/technical-reference-guide/_build/html/index.html' %}" frameborder="0" ...
0
votes
0answers
11 views

Create a LineString of a certain length perpendicular to another LineString

I'm trying to create a list of lines of a certain length (in metres) that are perpendicular to a list of django.contrib.gis.geos.LineStrings. Each LineString contains only two points, and so is always ...
0
votes
1answer
16 views

Django issue with passing PK in urlconf

Im working on a blog, i'm trying to create a comments link from each blog post, which will go a page where the individual post with comments can be seen. In my "list.html", where all the blog posts ...
1
vote
0answers
11 views

Authorizing your own google account in django using oauth2

I am trying to set up a django app which needs access to my own (not a user's) google calendar. I'd rather not have to go through the whole oauth process just to do this, so I set up my authentication ...
0
votes
1answer
25 views

How to check if object value in manytomany field?

How to check if value is in manytomany field? I am trying to do something like this: if value in object1.followers: #BLA BLA BLA But 'ManyRelatedManager' is not iterable. So what is correct way ...
0
votes
1answer
7 views

Getting corrupt zips using Python ZipStream in Django

I am a little new to Django so please bear with me. I'm using zipstream from here and have a Django view that returns a zip file of all file attachments which are all hosted on Amazon S3. But the zip ...
0
votes
1answer
20 views

AssertionError when serialize Object in Django

In Django I want to serialize (through Rest) a Lecteur object wich looks like this : from django.db import models from django.contrib.auth.models import User class Lecteur(User): bibliotheque = ...
-2
votes
1answer
33 views

Calculate cities with radius of zipcode

I have user's in my system, each of whom is associated with a zipcode. They are going to be searching my database for tickets, each of which is associated with a specific location. This location has a ...
1
vote
2answers
27 views

Can I configure Django runserver to reload when static files (e.g. javascript) is changed?

By default, Django's runserver command auto reloads the server when python or template files are changed. Is it possible to configure Django to extend its file monitoring for this purpose to other ...
0
votes
0answers
6 views

no form matching nr 0 while using fbconsole

I am currently trying to use fbconsole to automatically authenticate login to Facebook for my website. However when I try to implement the fbconsole.automatically_authenticate() method I keep getting ...
0
votes
0answers
31 views

Error: int() argument must be a string or a number, not 'NoneType' saving new records Django

I have some issues trying to save new records in the database, using model.Autofield models.py: class Proveedor(models.Model): id_proveedor = models.AutoField(primary_key=True, ...
2
votes
0answers
37 views

inside for loop if condition not working in django

http://localhost.com:8000/dashboard/track_info/13/ this page have the dropdown there user can select country. If user return to the same page.. here i want to display selected country in default. I ...
2
votes
0answers
16 views

Adding a custom placeholder to django-cms

I'm trying to create a custom placeholder to add an admin-editable section on a website. Django-cms' documentation is really generic about what's to be done to add it. The placeholder lives in a ...
0
votes
1answer
20 views

How to store a List in a Django model

Good morning, My question is how can I store a list of Livre for each User in my Django model.py, wich looks like : class Livre(models.Model): auteur = models.ForeignKey(Auteur) titre = ...
0
votes
0answers
14 views

AttributeError: 'module' object has no attribute 'pydebug' on dreamhost after server update

I have this error on a dreamhost shared server with a custom installation of python. I used this tutorial for the installation months ago: after the update of the servers of dreamhost (to ubuntu ...
0
votes
0answers
14 views

Python django direct_to_template [duplicate]

I have the old code: return direct_to_template(request, 'dynamic_models/model_list.html', {'data': 'data'}) How i can use this with last version ...
0
votes
1answer
31 views

How to login in a website using POST in Python?

I would like to automatically fill a form in my website using another website. I would like to get the content after this form below were processed. I read some topics (1, 2, 3) related to it, but I'm ...
0
votes
1answer
15 views

django menu - language chooser - show only existing languages

I am not sure if someone had this issue before: I have these pages in django cms's admin. these are the pages I created using django cms and languages come from LANGUAGES from settings.py and I ...
0
votes
0answers
51 views

NameError when name is defined

When using the python interpreter I try and use an imported class within a class, and get a NameError. However, when using it outside the class, I get no error. The code works fine in the file in ...
0
votes
1answer
17 views

mocking django settings: AttributeError: 'Settings' object has no attribute 'FOO'

Attributes on settings disapear after using this: .... here settings.FOO does exist. with mock.patch('django.conf.settings.FOO', 123, create=True): ... ... here settings.FOO is gone. Why does ...
0
votes
0answers
12 views

django celery - tasks thru django admin

I am trying to set up celery with django. all settings are set up and it is working if i start the task manuelly. (all happening in my local dev server) mytask.apply_async() then I tried to set up ...
0
votes
1answer
20 views

Best way to implement Multiple admins in django

I'm just starting Django and have easily created an admin site. However, my requirement is to have multiple admins and admin sites. For this, should I follow this ...
1
vote
1answer
18 views

Return image url in Django Rest Framework

I am using Django Rest Framework and have the following model: class Picture(models.Model): some_field = models.ForeignKey(some_model) image = models.ImageField() I would like to write a ...
0
votes
1answer
15 views

django get media url in view function

Serve Media File in view function View.py file_path = Tracks.objects.get(pk=event_id) name = file_path.file.name fullpath = os.path.abspath(name) When i perform above function, the fullpath is ...
0
votes
1answer
29 views

Resolving circular imports in celery and django

I have a Django app that uses Celery to offload some tasks. Mainly, it defers the computation of some fields in a database table. So, I have a tasks.py: from models import MyModel from celery import ...
0
votes
0answers
11 views

Django: Send HTML email via send_mass_mail()

It seems from the docs on email that HTML is supposed for send_mail() but not send_mass_mail(). Is my understanding correct, and if so is there a work-around to get the send_mass_mail() functionality ...
0
votes
1answer
26 views

django / python collections issue

I have some code that I can not get my head around. The more I look at it the more confused I become. There are two date values and a language code that is passed into a js function. Then there is a ...
0
votes
2answers
39 views

Scheduled task in django

I need explanation for scheduled task I need to run task in every end of the day automatically like cron I tried schedule app in my project import schedule import time def job(): ...