Skip to content

Tag: django

Django differentiate between incorrect login information and inactive user on login

Currently I added in my site a method for email confirmation when registering. What I saw though, is that when the user is registered, but didn’t click in the confirmation link yet and tries to login, I can’t differentiate between wrong user/password and not confirmed user. This is my login function: The problem is that when running form.is_valid() the authenticate

Django dev server no longer reloads on save

I’m developing a simple Django app and things were going great until suddenly the dev server stopped reloading automatically on file change. Now I have to manually restart the server every time I change some Python file, which is pretty annoying. I’ve tried removing my virtual environment and reinstalling Django to no avail so I guess the problem is with

How to add data to Many-To-Many field in Django DRF

I’m new to Django DRF, trying to have a sports school project done. I have a model for coaches, classes and students. Here is a stripped version to keep it simple and easy: In order to list/add students to the class, I’m using the following serializer: Getting the data is working ok. Also, adding a coach is working fine, what

Error: __str__ returned non-string (type ModelName) in Django

I am attempting to create an issue tracker similar to github’s. I’m stuck on trying to implement the assigning feature, here’s what I have so far admin page I feel like I’m close, however when I try to use I get the error of Anyone ideas on how to fix this? Thank you. Answer ERROR DESCRIPTION str returned non-string (type