Category "django"

how to use google login link to my login page using django-allauth?

I have created a project which is working nicely. I have a login page, signup page and profile page (as myspace). I just want to add an additional funtionality

request.FILES always empty on file upload

I am totally stumped on this, and must be doing something incredibly stupid. I am trying to simply upload a file on a Django project. The problem seems to be th

Running Django on Google Colab

I was trying to run the Django on Colab, by following the instruction here, however, after the !python manage.py runserver step, I tried to access the server

Setup Django Postgres database

I created the django app, I have it connected to my local server with pgAdmin3. I want to have the django app push to bitbucket. But the problem is: How do I s

When testing Django REST Framework, why can't I get APIClient.credentials() to authenticate using a token?

I'm writing a functional (not unit) test against a basic API, like so: from decouple import config from rest_framework.test import APIClient, APITestCase clas

How Django set path to files

In a django project, I want to open a file "file.png" (from images folder) in "worker.py". worker.py images file.png otherfile.png It works well using the te

Django 2.0: sqlite IntegrityError: FOREIGN KEY constraint failed

I'm working on adding Django 2.0 support to the django-pagetree library. During automated testing, using an sqlite in-memory database, I'm getting a bunch of er

LEAD and LAG window fucntions in Django orm, how to apply on single object?

Question is regarding Window functions usage in Django. I have a following model: class EntriesChangeLog(models.Model): content_type = models.ForeignKey(

ugettext and ugettext_lazy functions not recognized by makemessages in Python Django

I'm working with Django 1.5.1 and I'm experiencing some "strange behaviour" with translations. I'm using ugettext and ugettext_lazy in the same Python file. If

change datetime format using tempus_dominus DateTimePicker

I installed and imported DateTimePicker and used it as a widget to a Django DateTime Field When clicking on the field it shows me the date and time in format 07

I am making POST request from flutter app to Django-Rest user and getting null response

I'm a novice at this. I have been making POST requests from my flutter app to Django-Rest user and getting a null response on vendor name as copy pasted below.

django endpoint not returning all fields specified in serializer

This is Source Def: class SourceDefinition(models.Model): source = models.ForeignKey(Source, on_delete=models.DO_NOTHING) special_id = models.IntegerFie

Override Django cache settings in tests

I'm using Django DummyCache in my tests, however, there are a few tests which relay on real caching so using fake caching is not good here. Is there a clean w

NameError: name '_mysql' is not defined after setting change to mysql

I have a running Django blog with sqlite3 db at my local machine. What I want is to convert sqlite3 db to mysql db change Django settings.py file to serve MySQL

Getting email from LoggedIn user with Github

I have successfully setup Django with Django-allauth to register with Github but even if inside the scope on settings and asking for , it does not store the use

How to write setup.py to include a Git repository as a dependency

I am trying to write setup.py for my package. My package needs to specify a dependency on another Git repository. This is what I have so far: from setuptools im

How can I get my image to display using django?

I cannot get my images to display on my webpage while using Django. All I see is the images 'alt' text displayed, and a broken image icon next to it. I'm able t

The request's session was deleted before the request completed. The user may have logged out in a concurrent request, for example

I have a Python/Django app which sometimes has more than 100 users logged in. One day, I found this in Django error log: The request's session was deleted befo

(Django Allauth) 'CustomUser' object has no attribute 'username'

I'm trying to implement a CustomUser model in Django Allauth. When I used the allauth provided login template, I encountered this error My Customer User Model

Django: How to disable ordering in model

Let's say there is a model with default ordering described in Meta class class People(models.Model): first_name = models.CharField(max_length=100) las