Data dodania Pytanie
2017-10-01 13:10 Datafile not found, datafile generation failed in confusable_homoglyphs/categories.py »
I'm setting up a django project on an apache server. It is running fine on my PC under using manage.py runsslserver. When I load onto the apache ser...
(1) odpowiedzi
2017-09-30 14:09 Using pdb with supervisor »
I am running my django app using docker compose. Ngninx and gunicorn are run via supervisor. However I can't seem to figure out how to debug using p...
(1) odpowiedzi
2017-09-30 01:09 duplicate key value violates unique constraint "auth_user_username_key"DETAIL: Key (username)=(None) already exists »
I want to register a user using a custom register model but I keep getting the following error : duplicate key value violates unique constraint "...
(1) odpowiedzi
2017-09-30 01:09 Django - Migration foreign key field type not matching current type »
I am working with MSSQL database and I have some tables that were already created before Django enters the show, so with inspectdb I got the models wi...
(0) odpowiedzi
2017-09-29 16:09 Django Rest Framework - Envelope for response »
I'm wanting to convert an API from flask to Django Rest Framework. Currently, the requirements are that the responses are put inside of a basic json ...
(2) odpowiedzi
2017-09-29 13:09 How can I get my params in QueryDict? »
I use the ajax pass the data to views.py: var params = {'nood_id':'f55dbe56-7fa8-4d13-8e1e-2dc67499b6ac'} $.ajax({ type:'post', url:'/api/noo...
(1) odpowiedzi
2017-09-29 04:09 How to find User queryset matching self.request.user »
How do we find User queryset matching self.request.user? logged_in_user = User.objects.filter(id=self.request.user.id) I wish there is much efficie...
(2) odpowiedzi
2017-09-28 16:09 How to escape single quote for a prop? »
I have a Django context variable which is a jsonified list of strings but some of those strings might have a single quote ' import json list_of_strin...
(1) odpowiedzi
2017-09-28 13:09 How to add not null unique value to existing Django Model with default attribute »
I need to add slug field to django model, and i thing it's better when it not null. So i'm trying to add slug to model slug = models.SlugField( '...
(1) odpowiedzi
2017-09-28 12:09 Django ORM Group By ID »
I am trying to get some information from my table; total price, total trip etc between two dates. Here is my query start_date = Utils.subtract_day(da...
(2) odpowiedzi
2017-09-27 19:09 How to speed up Django when doing new changes to the views.py and urls.py? »
Currently we have our production Django web app hosted in IIS and we have noticed that when we add new changes into the views.py or, specially, the ur...
(1) odpowiedzi
2017-09-27 14:09 ImportError : no module named 'models' »
The following code gives this error ImportError : no module named 'models' I don't know why. I am trying to customize my own registration form i...
(1) odpowiedzi
2017-09-27 11:09 How to import models from one app to another app in Django? »
I am trying to reference a model (Person) from one app, in the views-file of another app. Unfortunately, I get an "unresolved reference"-error. Is it ...
(4) odpowiedzi
2017-09-26 14:09 Django: Basic Auth for one view (avoid middleware) »
I need to provide http-basic-auth for one view. I want to avoid to modify the middleware settings. Background: this is a view which gets filled in b...
(1) odpowiedzi
2017-09-26 14:09 Django custom for complex Func (sql function) »
In the process of finding a solution for Django ORM order by exact, I created a custom django Func: from django.db.models import Func class Position...
(2) odpowiedzi
2017-09-26 11:09 How to display instances from two different django models on the same template, inside the same table? »
In a django app I've created different models and everything looks okay until I try using data from two different models inside the same table. To sum...
(2) odpowiedzi
2017-09-25 15:09 Django Pagination with other variables in the GET request in a Function Based View »
I've tried to implement the following solution from here: How to paginate Django with other get variables? I added this to my views.py from urllib.p...
(1) odpowiedzi
2017-09-25 14:09 Create a django superuser but never let it login »
from django.contrib.auth.models import User from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Create defau...
(2) odpowiedzi
2017-09-25 10:09 Everything related to everything »
I'm trying to put together a system where certain models are all related to each other, and can be modified in each others change form within the admi...
(0) odpowiedzi
2017-09-24 16:09 Relation does not exist error in Django »
I know there are many questions about this problem, I looked through the solutions and unfortunately none of them worked for me. I created a new app...
(0) odpowiedzi
2017-09-24 09:09 Django CORS Access-Control-Allow-Origin missing »
I'm trying to implement google oauth2 authentication in my django app. I have followed all the steps as per the docs. On the browser address bar,if I...
(0) odpowiedzi
2017-09-24 05:09 Why is create_or_update generating manager attribute error? »
I receiving an error AttributeError: 'Manager' object has no attribute 'create_or_update' in my views.py upon using create_or_update below. My code is...
(1) odpowiedzi
2017-09-23 20:09 In Django, why do view functions require a request parameter? »
Example from Django documentation: def index(request): return HttpResponse('<h1>hellworld!</h1>') def detail(request, question_id): ...
(3) odpowiedzi
2017-09-23 19:09 Django optional parameter is not readed from url »
I was reading the thread Django optional url parameters And following the steps to generate a URL with a single optional parameter. Well, my URL shou...
(2) odpowiedzi
2017-09-23 17:09 DJANGO static images dont show in template »
I am trying to use static images in my template using the DJANGO framework, but the images don't display on my page. I have followed the manuals com...
(1) odpowiedzi
2017-09-22 23:09 Avoiding multiple AJAX calls on jQuery sortable( ) »
I am new to jQuery. Basically I have a table which I can sort the rows. I want to save the new order in the backend, which I am able to do. However, I...
(1) odpowiedzi
2017-09-22 23:09 Passing a cv2 frame from view to template »
Basically, my django app needs to create an image in a view, and pass that to a template. This is easy for a string, but I can't find a way to do it w...
(1) odpowiedzi
2017-09-22 09:09 Globally getting context in Wagtail site »
I am working on a Wagtail project consisting of a few semi-static pages (homepage, about, etc.) and a blog. In the homepage, I wanted to list the late...
(1) odpowiedzi
2017-09-21 16:09 Django: Do I really need apps.py inside an app? »
When creating an app with python manage.py startapp myapp, it automatically creates an apps.py file. from django.apps import AppConfig class MyappC...
(1) odpowiedzi
2017-09-21 11:09 Can you optimize this code? (Django, python) »
I'm adding 'added' field to check which categories User's Post(Outfit) is added to. It sounds horrible, so let's dive in to the code. I want to optim...
(2) odpowiedzi
2017-09-21 08:09 Django; Querying the Database By Counts Of Related Objects »
I have a question model: class Question(models.Model): .... and an answer model related to it: class Answer(models.Model): user = models.Forei...
(1) odpowiedzi
2017-09-20 12:09 Spider not found: Django Scrapy integration »
I am trying to run a Scrapy spider inside my Django project's view. This is my project structure. ScrapyPro . ├── ScrapyPro │ ...
(0) odpowiedzi
2017-09-20 11:09 Django: Uploading multiple files. List of files needed in cleaned_data['file'] »
I followed the pattern of the docs, to upload several files with one forms.FileField: https://docs.djangoproject.com/en/1.11/topics/http/file-uploads...
(2) odpowiedzi
2017-09-20 03:09 How do I create and submit a form from a model inside a modal? »
In my app I have a page called products. In this page I display records form my database in a table. Every row of the table has two buttons, to add a...
(1) odpowiedzi
2017-09-19 18:09 Django - What is different {% static %} and /static/? »
I am studying Django. In my settings.py : STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') and when I try to add an image in ...
(1) odpowiedzi