Object 'user' has no atribute 'create' – Django


I have a question about an error that I am getting. I have a query that I am trying to send based on the Synapse Api for my project. I am currently trying to senda request taht creates a new user with the API. Every time I try to to send the request, I get a message that the User object doesnt have a create. Here is the error.

AttributeError at /setup_profile/
type object 'User' has no attribute 'create'
Request Method: POST
Request URL:
Django Version: 1.8.6
Exception Type: AttributeError
Exception Value:    
type object 'User' has no attribute 'create'
Exception Location: C:UsersOmarJandaliDesktopopentabopentabtabviews.py in createUserSynapse, line 1104

Here is the current code that I have which will create the request to create a new user.

def createUserSynapse(request):
    args = {
        'email': '[email protected]',
        'phone_number': '555-555-5555',
        'legal_name': 'Hello McHello',
        'note': ':)',  # optional
        'supp_id': '123abc',  # optional
        'is_business': True,
        'cip_tag': 1

    user = User.create(client, **args)

Now i do know that with a normal query set, I have the object in the following format

User.objects.create(client, **args)

but when i do that I get an error that says

two parameters are being passed and 1 is requires so I think there is to many variables being passed… I am not sure where the error is coming from…

here is the error that I get when I use the User.objects.create(client, ** args)

TypeError at /setup_profile/
create() takes 1 positional argument but 2 were given
Request Method: POST
Request URL:
Django Version: 1.8.6
Exception Type: TypeError
Exception Value:    
create() takes 1 positional argument but 2 were given
Exception Location: C:UsersOmarJandaliAppDataLocalProgramsPythonPython36libsite-packagesdjangodbmodelsmanager.py in manager_method, line 127


The client needs to be passed into the api call and it contains the following:

import os
from synapse_pay_rest import Client

args = {
    'client_id': 'client_id_...6YiBl',
    'client_secret': 'client_secret_...kC3IF',
    'fingerprint': '...dd48b',
    'ip_address': '',

client = Client(**args)

Also, here is a github link to the api samples that were created by the api developers.


the client has to be passed with the api call

Asked By: Omar Jandali



Create method has only key word arguments. Rewrite your code to this:

User.objects.create(client=client, **args)


I just figured out that you are using third party package. So you need to import User class like this from synapse_pay_rest import User as SynapseUser and use SynapseUser in your code: SynapseUser.create(clients, **argss)

Answered By: neverwalkaloner
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.