Data dodania Pytanie
2017-11-26 22:11 django : how to use filter option in this case? »
I have one question here is my code view.py class testView(ListView): model = Photo template_name = 'photo/photo_detail.html' context_obj...
(1) odpowiedzi
2017-11-26 11:11 Django: why is ViewClass.as_view used with brackets in URLconf? »
If I have a view-class and I want to use it in URLconf, I will have to use its as_view()-method, since the view-class isn't a function, but a class. M...
(2) odpowiedzi
2017-11-25 15:11 django upload to image model with foreign key to user »
I'm using Django's Extended User Profile and instead of having many image fields I want to make a new Images class in my models that I can upload many...
(1) odpowiedzi
2017-11-25 06:11 Color the bars of Barchart differently in Google Charts »
I am trying to make a barchart using Google Charts and I want to color the bars differently. From the Documentation of google charts I am sending dat...
(1) odpowiedzi
2017-11-25 06:11 Django templates - Check if user already has created an object for another object »
I have 2 models called Valuation and Assessment. A valuation has many assessments (foreignkey relationship). Users can only create 1 assessment for ...
(1) odpowiedzi
2017-11-24 23:11 Searching in multiple fields respecting the row order »
I have a model like the following: class Foo(models.Model): fruit = models.CharField(max_length=10) stuff = models.CharField(max_length=10) ...
(5) odpowiedzi
2017-11-24 13:11 How can I turn an AngularJS template into a string? »
I want to pass my variables into that template, let it render, and then get the resulting HTML as a string. How can I do that in AngularJS? Is there ...
(2) odpowiedzi
2017-11-24 05:11 Does python2.7 support Chinese path? »
The python2.7 do not support Chinese path? File "/Users/denghaibing/Desktop/Test/TestPython/testDemo02/apps/用户首页/ordermanage/api/views.py", l...
(1) odpowiedzi
2017-11-23 15:11 Django - load statics »
I am trying to load static file into my html files. index.html extends base.html. However, files are not read(at least not shown on the screen, howeve...
(1) odpowiedzi
2017-11-23 09:11 unable to connect django and angular 2 »
I want to connect my angular 2 app to django but how can i connect because both have different servers. I also read about cors but didn't work. Please...
(3) odpowiedzi
2017-11-23 08:11 Django rest framework timefield input format »
After hours of searching, I found many posts that are related but wasn't able to help. What I want to do is input eg: 10:30 AM into the TimeField. ...
(2) odpowiedzi
2017-11-22 22:11 Django: render inherited (nested) values as a list in forms.ModelForm »
I'm trying to display a dropdown list in my form, from my model 'TipoDocumento' (I need to display the column 'nombre_corto' as a list). 1) My model...
(2) odpowiedzi
2017-11-22 12:11 How can I able to handle both GET and POST requests in views.py in python vue js? »
My views.py is def searchnew(request): if request.method == 'POST': name = request.POST.get('name') loc = request.POST.get('location') d ...
(1) odpowiedzi
2017-11-22 08:11 Running Django with sudo can't find installed homebrew packages »
I have a Django project that I want to run at port 80 with manage.py runserver. In my project I use the Wand library and I have installed freetype and...
(2) odpowiedzi
2017-11-21 22:11 How to count the number of resuts of an if on Django built in templates »
I have the following situation: {% for subject in subjects %} {% if subject.media < 60 %} {{ subjects|length }} {% endif %} {% en...
(2) odpowiedzi
2017-11-21 21:11 Creating django form with null and blank field »
I'm trying to create a form where both fields is optional however, i keep getting an error when setting null and blank. what am i doing wrong? Error ...
(2) odpowiedzi
2017-11-21 13:11 Python Logging: Change "WARN" to "INFO" »
If our Django web application returns a 404, we see this in the logs: 2017-11-21 12:48:26 django.request.get_response: WARNING Not Found: /foooooo ...
(3) odpowiedzi
2017-11-20 22:11 run migrations in parallel django? »
The current project has around 620 django models, which takes around 1 hour to migrate. . (uses only 12.x% of 8 core intel skylake with 1.2gigs of 30g...
(1) odpowiedzi
2017-11-20 10:11 Django admin list view show external url data in custom column »
we have a list view something like below Now lets say we want to add one more column in the view which doesn't exist in model. so we can do that by ...
(1) odpowiedzi
2017-11-20 03:11 django aws s3 image resize on upload and access to various resized image »
I would like to be able resize my uploaded image to various size categories: original medium (500kb) small (200kb) And save it to AWS S3. And late...
(1) odpowiedzi
2017-11-19 23:11 Using regular expressions in views.py Django? »
I have a form in my Django app where one field is called url. The user can add a youtube url. On submit, I want to save only the video id. My views.p...
(2) odpowiedzi
2017-11-19 19:11 Django - voting on multiple categories in the same page/form »
I recently completed Django intro tutorial, I want to create a polls app where one can vote on multiple categories on the same page/form. Everything w...
(2) odpowiedzi
2017-11-19 14:11 Unavailable to render JQuery Datatable with Django »
I have a problem trying to render a JQuery Datatable in my Django templates, but it returns nothing (its never entering my "tabla" view). Neverthele...
(1) odpowiedzi
2017-11-19 11:11 Django CreateView - Display only particular objects in foreignkey field »
I have a CreateView view that holds a bunch of fields that need to be filled by the user when creating a new contact. Now, I want the user to be able ...
(1) odpowiedzi
2017-11-18 21:11 Django add a relation between the user and the selected articles »
I have a simple model Article. The model is: class Article(models.Model): title = models.CharField() text = models.TextField() likes = mo...
(2) odpowiedzi
2017-11-18 20:11 Ubuntu 17: Can't install mysqlclient »
Trying to follow a Django tutorial but I cannot install mysqlclient. The tutorial claims that I can do so with the following command: pip install my...
(2) odpowiedzi
2017-11-18 19:11 How to avoid additional random number in DataTables ajax request »
Hi my datatables ajax call is as below, $(document).ready(function () { $('#example').DataTable({ "ajax": '/api/get_requests' ...
(1) odpowiedzi
2017-11-18 09:11 KeyError: 'locations' in Django app »
I'm working on a Django application which fetches JSON data from an API and stores it in PostgreSQL database. But while migrating the app I'm getting ...
(1) odpowiedzi
2017-11-17 15:11 disable ordering by default for django_tables2 Tables »
I use django_tables2 to render my tables. For one table, I only want to see the most recent 5 entries. Therefore, I need to order my queryset before p...
(3) odpowiedzi
2017-11-17 15:11 Django Admin conditional display inlines based on models property »
I've got marketplace models with fields: class VacationEvent(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) process_...
(1) odpowiedzi
2017-11-17 12:11 Django templates {% regroup %} : handle the case when grouper value is None »
Currently working on a e-commerce project (with django-oscar), I have an issue regarding products display on the basket template. I use the {% regrou...
(1) odpowiedzi
2017-11-16 23:11 Python Social Auth authenticating users to wrong accounts »
For some reason users while using Facebook to oath, the user will auth as random users. When I looked into the UserSocialAuth table there was one use...
(0) odpowiedzi
2017-11-16 14:11 Changing '?' to '&' in address bar »
For example, in my web-app I have a link with url www.example.com/profile?name=name. When I click to that link, I'm getting a page, where I can change...
(1) odpowiedzi
2017-11-16 13:11 Optimizing pattern of loading Django template filters in a for loop »
In a Django template, I use a for loop to display content. This content is of 3 types. Each type has its own set of conditions, HTML and CSS. I fe...
(0) odpowiedzi
2017-11-16 01:11 How to generate indexes for related fields on Django models? »
Say we're building a Django-based site that clones Medium.com's URL structure, where you have users and articles. We'd probably have this model: clas...
(1) odpowiedzi