Data dodania Pytanie
2017-03-18 23:03 celery not getting tasks from Django Admin Periodic Tasks »
Using celery 3.1.25 with Django 1.10 I can get celery to run tasks by manually getting into the shell and manually launching the tasks. However when ...
(0) odpowiedzi
2017-03-18 04:03 'UpdateView' object has no attribute 'object' »
So I've been trying to add a cancel button to my UpdateView that I've been using. Here's my code for it: views.py: class CountryEditView(generic.edi...
(1) odpowiedzi
2017-03-18 00:03 regex email validation django »
Working on a project for school I know how to do this in flask but learning django. I am trying to make sure that a valid email is entered before it p...
(1) odpowiedzi
2017-03-17 19:03 Django ValueError: could not convert string to float »
Even though I put this line in my settings.py : LANGUAGE_CODE = 'pt-br' TIME_ZONE = 'America/Sao_Paulo' USE_I18N = True USE_L10N = True USE_TZ = ...
(2) odpowiedzi
2017-03-17 19:03 Handling single page application url and django url »
I have a single page application created in Vue.js that utilizes the HTML5 History Mode for routing, and the html file is served with Django. The url...
(1) odpowiedzi
2017-03-17 15:03 Django website giving trouble serving static files »
I am working on a multi-app website. And I have bunch of noob questions. My dir structure looks like as below: /var/www/html/portal src/ ...
(3) odpowiedzi
2017-03-16 13:03 Placing div's with float »
I have one big list of dictionaries in django view as follows: 'description': [ { 'name': 'Onderdelen', 'good': ['Mot...
(1) odpowiedzi
2017-03-16 09:03 Django cannot delete single object after rewriting model.Manager method »
I am trying to rewrite get_by_natural_key method on django manager (models.Manager). After adding model (NexchangeModel) I can delete all() objects bu...
(2) odpowiedzi
2017-03-16 05:03 Wow does six.with_metaclass() work? »
Hi Stackoverflow community I have been trying to understand how Django (and Wagtail's Stream-field) work under the hood. Doing that I learned about m...
(1) odpowiedzi
2017-03-15 21:03 In Django how to pass JSON data to use for Ajax / jQuery? »
I'm trying to use JSON data in Django to provide user option to search and select. I can load and extend data to html but not sure how to use it in jQ...
(3) odpowiedzi
2017-03-15 18:03 Counting occurrences of a foreign key in a related queryset »
I have a model Visit, which has a ForeignKey to a model Store. I have a filtered queryset of Visits, and I need to get the count of how many Stores oc...
(1) odpowiedzi
2017-03-15 17:03 FieldError: Cannot resolve 'publish_year' into field »
I am new to Django and I am currently using django by example by I am getting this error FieldError: Cannot resolve 'publish_year' into field Here is...
(1) odpowiedzi
2017-03-14 22:03 Filter list of objects by self.request.user in Django »
I cannot get this to work: class MyView(generic.ListView): context_object_name = 'my-model-list' template_name = 'my_models.html' def ge...
(2) odpowiedzi
2017-03-14 17:03 use django's reverse function in req.path »
I was stumbling on invitation feature to understand how it works. I found the blog post on http://www.pythondiary.com/tutorials/create-invite-only-web...
(1) odpowiedzi
2017-03-14 14:03 How to register Django models that are only used in tests »
I'm writing an app that has a custom model field. I want to test that field, using a model that is only used within tests, but I'm struggling to get t...
(1) odpowiedzi
2017-03-13 21:03 Upload Image File to server »
Have a little problem with uploar file image to server That is JS code for ajax send file to server /** * * Init Crope Image * *...
(1) odpowiedzi
2017-03-13 20:03 Django sort records by calculated field »
I have a model: class Person(models.Model): score1 = models.FloatField(default=0) score2 = models.FloatField(default=0) score3 = models.F...
(1) odpowiedzi
2017-03-13 11:03 Django view not updating after changes in model »
I am running into a problem with a Django project I am currently working on. I have a view in which I create a model instance via a POST request: cl...
(1) odpowiedzi
2017-03-13 07:03 Invalid block tag - bootstrap-form, expected endblock »
I am working on a django project, but for some reason the template I am using brings up an invalid block tag error. I have looked at some other simila...
(2) odpowiedzi
2017-03-12 22:03 query is not returning kwargs results django »
The kwargs are getting passed into my query but the values are not showing in my drop down box, no values are being displayed in the drop down box. ...
(1) odpowiedzi
2017-03-12 16:03 FATAL: password authentication failed for user "root" postgresql »
I use PostgreSQL and Django (format Heroku) and have error FATAL: password authentication failed for user "root" Traceback (most recent call las...
(1) odpowiedzi
2017-03-12 07:03 could not connect to server:PostgreSQL -Heroku »
I deployed a Django app in Heroku. Initially, it was run on SQLite3 database and later I upgraded to PostgreSQL. App is working perfect with local set...
(1) odpowiedzi
2017-03-12 05:03 How to Change CharField Choice List Behaviour »
As you can see below, I have model with CharField. The user can choose one of the value inside ROLE_CHOICE. Question: How can I make some values una...
(1) odpowiedzi
2017-03-11 10:03 DJANGO - Change text color based on value (HTML & JS) »
I'm creating a table displayed in HTML with Django. I want to change the number's color to red when the number is negative, and to green when the numb...
(4) odpowiedzi
2017-03-11 09:03 Updating selection of objects, each with a different value in bulk (Django) »
Imagine I have a python dictionary where keys are existing user ids, and values are scores to be added to those users' existing scores. For example:...
(2) odpowiedzi
2017-03-11 07:03 (Django) Does MySQL foreign key cascade delete parent or children first »
Currently, I am using Django with a MySQL backend database. Let us having the following database schema class Parent(models.Model): parent_id ...
(1) odpowiedzi
2017-03-10 19:03 How in Django/Python can I ensure safety from WYSIWYG-entered HTML? »
I would like to remove vulnerabilities to XSS / JavaScript injection in a web application where users are allowed to use an editor like CKEditor which...
(1) odpowiedzi
2017-03-10 14:03 Test redirect using @user_passes_test decorator »
My view file has: def is_authorised(user): return user.groups.filter(name='bookkeepers').exists() @login_required def unauthorised(request): ...
(1) odpowiedzi
2017-03-10 13:03 Django CORS and CSRF, Embedding dynamic wizard on client website »
My website offers booking functionality. Each user is allowed to create his own reservation system and configure it to his needs(add services, categor...
(0) odpowiedzi
2017-03-10 12:03 TypeError at /app/profile/ , 'list' object is not callable handle_pageBegin args=() »
I want a button to create a PDF file (with Python 2.7, Django 1.8), but I have no clue how to express that to the machine. I started by reading some ...
(2) odpowiedzi
2017-03-09 20:03 Django logic and where to put it? »
I am new to Django, but I recently created my first application. I am wondering if I put my logic in the wrong places. From the Django book, I got tha...
(4) odpowiedzi
2017-03-09 14:03 Why is Unicorn/Gunicorn slow to serve static content? »
I have read here that the Unicorn/Gunicorn HTTP server is 'not very good at serving static files', and that Nginx is better at serving static content....
(1) odpowiedzi
2017-03-09 07:03 Django upload form, additional field causing error »
There is an issue I'm facing. I need to upload an excel of students containing their related data. I also need to have, as an user-input, the batch of...
(1) odpowiedzi
2017-03-08 23:03 Django Form Field not showing up »
I just started learning Django and for this project I'm following the "Tango with Django" tutorial book. I have a problem with the input field of a fo...
(1) odpowiedzi
2017-03-08 11:03 How can I get session in forms? »
I have a multistep form with checkboxes, after the user submit the first step form I save the objects he checked on his session, at the second step fo...
(1) odpowiedzi