NoReverseMatch at /accounts/register/

I am following the getting started guide for Django registration and I am getting the following error when I visit http://localhost:8080/accounts/register/ : NoReverseMatch at...

Django REST framework object level permissions

I am using Django REST Framework to access a resource 'user'. As user information is personal, I do not want a GET request to list every user on the system, UNLESS they are an admin. If the user...

Django Model Save created by and modified by

I am running django 1.8, I am trying to save the current logged in user in the created by and modified by fields in my database. I have tried many different combination of getting this to work,...

Django 1.9.2 AssertionError: database connection isn't set to UTC

I have setup 3 servers now with PostgreSQL and have so far not seen this issue. I am now setting up the first server which is not running on a danish server, and i start getting errors when...

Django Form Error: 'QueryDict' object has no attribute 'method' when POST assigned

I'm having trouble with a specific form that is not permitting me to post data to a function I've defined. I'm very confused as to why this is giving me errors because I use an almost identical...

Authentication with Kong

I'm looking at Kong to replace my current hand-rolled NodeJS API gateway. Currently I have a user service that handles authentication (written in Django) by providing a JWT back upon login, which...

Django Allauth Error: NoReverseMatch at /accounts/facebook/login/token/

When trying to login using the fb js_sdk I receive the below error. However using oauth2 works fine when I switch back to using it. Am I missing some configuration somewhere? Internal Server...

How can I return user ID with token in Django?

I generate tokens using default view in Django: url(r'^login/', rest_auth_views.obtain_auth_token), I have a problem because my front-end doesn't know what is the currently logged in user...

django.core.exceptions.ValidationError: ["'' is not a valid UUID."]

In an attempt to write object level permissions in Django with the Django Rest Framework, I have bumped into this error (full error log at bottom) django.core.exceptions.ValidationError: ["'' is...

Django Error : hasattr(): attribute name must be string

I'm getting a Django/Pythonic error and I don't have any idea How I can solve it. I tried lot of things but the error still there up to now. My error is : hasattr(): attribute name must be...

POST method of FormView in Django?

Edit: just used a new listing for when user submits the user to search on though I am not sure how to get what user was submitted still in my QueryUser class (the id of 24 is just a test, oh and I...

Django IntegrityError - NOT NULL constraint failed: learning_logs_topic.owner_id

The Problem Hi, I'm making a project called "learning_log", where you can make new topics and add entries associated with that specific topic. I have a problem; when I try to add a new topic, an...

Django - How to make the topics, that you create public? Learning Log Project

The Problem I'm trying to make a project, where you can make topics, that can be private or public to unauthenticated users. In every topic, you can then make several entries, applying to that...

How to authorize django-rest-knox login path without 401 error?

I'm trying to put an authentication api on my django app so I can start using a Vue+Node frontend. I've read over the knox documentation, but I don't seem to see anything suggesting what the...

My django blog isn't detecting the HTML/CSS files i added

Edit 1: I am building a blog with django and i recently added some html/css files to a template folder but its not loading. These are my html codes base.html: {% load static %} <!DOCTYPE...

Django, Apache2 on Google Kubernetes Engine writing Opencensus Traces to Stackdriver Trace

I have a Django web app served from Apache2 with mod_wsgi in docker containers running on a Kubernetes cluster in Google Cloud Platform, protected by Identity-Aware Proxy. Everything is working...

Django request.user becomes anonymous after redirect. Using custom user model and authentication

I am using django 2.1.7 and python 3.6.5 version, extending the django user model with 'AbstractUser' and overwritting django authenticate method. Everything seems to work fine until login, but...

NGINX 502 bad gateway gunicorn timeout

502 bad gateway error pops up on saving data to the db. Once the user logs into the django app (OLE 7). Data is pulled regarding that user from ldap server and saved in my local db(postgres). It...

Django sessions: How to include session ID in every log record?

I would like to include session ID (at least portion of it) in every log entry in Django. This would help me group together logs for each user session in case several users are interacting with my...

With Django @csrf_exempt, request.session is always empty

I am stuck in django and would really appreciate it if someone could help me. I need to have an entry point for a 3rd party API. So I created a view and decorated it with @csrf_exempt Now the...

How to correctly serialize API response in Django view

I am calling the Giphy API using another wrapper API which returns a list of dictionaries. I am having hard times to serialize the data to return it to AJAX. The data is returned as...

How to implement single sign-on django auth in azure ad?

I have a django-based web application, a client requested that we integrate the login with Azure AD, following the documents I managed to integrate with the following flow. In django the user...

I got 400 bad request on blacklist when I logout

I'm trying to blacklist the user when the logout function called using django-rest-framework-simplejwt. I can logout from the page but I keep getting 400 bad request in terminal. I believe that...

Django 3.0.8 Test Cases Failing

I'm trying to follow a Simple is Better than Complex tutorial. Specifically, I just completed Part 4. I encounter the following 4 failures when I run tests: $ python manage.py test Creating test...

Setting up OIDC for a backend API + frontend SPA

I’ve got a project using a Django backend, with Django Rest Framework to serve an API, and a Vue.js frontend SPA to consume the API. I’m running into some kind of CORS issue during...

How to access user infos from consumer.py django?

I am building a social media app with react.js and django, django-rest-framework, djoser, django-channels==3.0.2.. well the problem is i want to make a notification system on friend request and on...

How to pass data from a template to the Django side

I just started to code Python Django. I just wanted to make a basic login project. I tried to pass login variables from the HTML side to file views.py. Here is my HTML code: <form action="/index"...

Vue.js component specific delimiters with Django and Vue-loader

I am creating a Django + Vue.js v3 app, and found it very useful to use vue3-sfc-loader, as I can use Django to render .vue files easily, and get the best of both worlds. This setup works and...

Server Error (500) arised on django project

My Project is a website is 'learning_log' same as in the book Python Crash Course. Learning Log works fine in local machine but when I go out of local machine it shows Server Error (500). I used...

how to add otp authentication in django login page

Firstly, the login.html should ask for 'Enter OTP' once the email(username) is entered and submitted. This username is checked with user table if the user exists. If user exists , it should send...