Data dodania Pytanie
2017-02-28 16:02 How to update extended User Model using Django Forms? »
I am new to Django and need a help. I want to allow users to update their account data using form, but struggle with associating Django User model wi...
(1) odpowiedzi
2017-02-28 08:02 Display the object related set objects in the admin »
I have three models for Movie, NowShowing and UpComingMovie. NowShowing and UpComingMovie has foreignkey relationship with the Movie. class Movie(mod...
(1) odpowiedzi
2017-02-27 20:02 Trying to make a cart using django but in views I am passing product id rather than slug because I am adding product to cart directly from homepage »
Cart App views.py from django.shortcuts import render, HttpResponseRedirect from django.core.urlresolvers import reverse # Create your views here. ...
(2) odpowiedzi
2017-02-27 12:02 Django: method in models vs method in views »
I ask myself this question, what the difference and the more performant between a method in models.py and views.py ? Example 1: models.py: class Co...
(1) odpowiedzi
2017-02-27 10:02 Saving to database with one query »
I have standard django User model and I have an extended model Member. The Member model is connected to Subscription model. class Type(models.Model):...
(2) odpowiedzi
2017-02-26 22:02 CreateViews and assigning values to two OneToOneFields »
I am trying to set the value of two OneToOne fields on save in a CreateView. Here are the two models (each living in separate apps). CompanyProfile ...
(1) odpowiedzi
2017-02-26 01:02 Django counting one to many relationship »
So i have two tables, Post and Category Code: model.py class Category(models.Model): category = models.CharField(max_length=100) def __s...
(1) odpowiedzi
2017-02-26 00:02 How to serve static files to AWS when deploying Django app (`python manage.py collectstatic` didn't work)? »
Yesterday, I created this post: DjangoRestFramework browsable api looks different locally vs when deployed on server? Basically, when I did python ma...
(1) odpowiedzi
2017-02-25 23:02 How to install packages to docker's python? »
How to install packages to docker's python? For example, I need lmxl. Inside django application in docker I run pip install lxml and terminal respon...
(2) odpowiedzi
2017-02-25 15:02 What is the purpose of running a django application in a virtualenv inside a docker container? »
What is the purpose of virtualenv inside a docker django application? Python and other dependencies are already installed, but at the same time it's n...
(2) odpowiedzi
2017-02-25 01:02 Django CreateView show error not working »
How can I prevent the Repetition of renting a car for the same period the car was already rented or reserved for ex : 01/01/2017 to 01/03/2017 if i t...
(1) odpowiedzi
2017-02-24 03:02 Pass queryset data to another query django »
I have the following model. I am trying to select all from UserClasses where a specific class_id is specified. I then want to get the User data for ea...
(1) odpowiedzi
2017-02-24 02:02 django objects.filter(x__in = y) where y is repetitive QuerySet »
Customer.objects.filter(customer_id__in=contact_list_senders) contact_list_senders is a repetitive QuerySet that involves some customer_ids: {se...
(0) odpowiedzi
2017-02-24 01:02 Why Django doesn't find my template »
Can't understand why Django can't find the template. project/templates/blog/intro.html: <!DOCTYPE html> <html> <head> <title&gt...
(2) odpowiedzi
2017-02-23 20:02 How to exchange data between apps in Django using the database? »
I'm using Django to work on a web. I have created 2 apps: One for the clients to register, and add their data to the database, and a second app for us...
(1) odpowiedzi
2017-02-23 19:02 Django in an API like + reactjs. How to generate a csrf token »
I did something a bit silly while developing my project: I'm using django only for the admin and the views are used as urls for my front (reactjs) fo...
(1) odpowiedzi
2017-02-23 16:02 Why would you not want to create a backwards relation on a foreign key? »
I recently came across this paragraph in the Django docs on the related_name attribute of the ForeignKey field. If you’d prefer Django not to cr...
(1) odpowiedzi
2017-02-22 19:02 Django make_aware usage »
Django docs says: The pytz.NonExistentTimeError exception is raised if you try to make value aware during a DST transition such that the time ne...
(1) odpowiedzi
2017-02-22 18:02 Serializing a list of objects with django-rest-framework »
In DRF, I can serialize a native Python object like this: class Comment(object): def __init__(self, email, content, created=None): self.e...
(1) odpowiedzi
2017-02-22 15:02 Error with ordering Django 1.9 models how to fix this? »
Output from CMD: django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues: ERRORS: posts.Comments...
(2) odpowiedzi
2017-02-22 12:02 Remove blank "---------" from RadioSelect »
I don't find a way to remove the first line from my Choices_list which is displayed like -------. I already tried some things : blank=True, Blank=Fal...
(2) odpowiedzi
2017-02-21 20:02 Routing Django ORM Based on URL Parameter »
We have a scenario where we have 4 databases that are exact duplicates of each other in terms of structure and functionality. Each database represents...
(0) odpowiedzi
2017-02-21 06:02 Python - extract value from key-value pair »
lots of googling done but I'm stumped. I know this is simple but I can't seem to find the format to retrieve the value from a key/value pair when I s...
(3) odpowiedzi
2017-02-21 04:02 csrf failure using csrf and Request Context »
I have tried all I can gather from the forums, still need help: I keep getting the CSRF token missing or incorrect error when I submit a form. It use...
(2) odpowiedzi
2017-02-21 00:02 Receiving Checkbox Values Using Ajax »
I have the following checkbox definitions: {% for member in team_profile %} <div class="checkbox"> <label> <input type="ch...
(1) odpowiedzi
2017-02-20 14:02 relation "social_auth_usersocialauth" does not exist. Migrate does not create these tables »
I am using python-social-auth. But when I run makemigrations and migrate. The tables "social_auth-*" are not created. My settings.py looks like this ...
(2) odpowiedzi
2017-02-20 13:02 Django filter if an optional key in json exists »
I have a model X with a custom json fied data which may or may not have these keys: key1, key2, key3. I need a way to filter all instances with key1. ...
(1) odpowiedzi
2017-02-20 10:02 Django Query with conditional function When (?) »
I have a database of a diner: class Product(models.Model): name = models.CharField(max_length=250) sides = models.ManyToManyField(Sides, blan...
(1) odpowiedzi
2017-02-19 12:02 Retrieving RSS xml News data using Jquery/Ajax in Django »
I am trying to do the following: I need to download the headlines from BBC and CNN using Ajax and jquery in Django. I tried first to download the da...
(0) odpowiedzi
2017-02-19 09:02 Not working .add( ) function in ManyToMany Relation of Python3 Django »
now I'm designing data modeling with ManyToManyField in Django. I would like to make each sessions have various instruments, i.e) A have a ...
(1) odpowiedzi
2017-02-19 05:02 Django - global name error when authenticate with multiple database »
I have a basic app for login system, very very basic works ok, but now I'm trying to make it work with another database, at this it's not that easy as...
(1) odpowiedzi
2017-02-18 22:02 User dependent field as many to many relationship in Django Rest Framework »
In my application I have some products, and a logged in user should be able to mark these products as favorites. I modeled them as a many to many rel...
(1) odpowiedzi
2017-02-18 22:02 Django - the effect on page load speed of using include tag inside for loop »
The odds are that this question will be banned, because this forum seems to me a site for "why it doesn't work"-type of questions, rather than "is it ...
(0) odpowiedzi
2017-02-18 19:02 Dynamic length Django model field »
I have one Django model field definition like this: landMark = models.CharField(max_length=50, blank=True) Can I define the landMark field dynamical...
(2) odpowiedzi
2017-02-18 15:02 Django mocking storage on model with update() throws error »
I have a small project and I'm working on some tests. Recently I asked a question: django-test-mocked-imagefield-prevent-upload-or-clean-after-test. I...
(0) odpowiedzi