I\'m trying to create a new User in a Django project by the following code, but the highlighted line fires an exception.
def createUser(request): userNam
The correct way to create a user in Django is to use the create_user function. This will handle the hashing of the password, etc..
from django.contrib.auth.models import User user = User.objects.create_user(username='john', email='jlennon@beatles.com', password='glass onion')