简体   繁体   中英

How to connect Salesforce database in Django? Perform API calls using Python?

How to connect Salesforce database in django? Perform API calls using Python?

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'salesforce_db',
    },
    'salesforce': {
        'ENGINE': 'salesforce.backend',
        "CONSUMER_KEY" : 'EDIT: your key you get.......................',
        "CONSUMER_SECRET" : 'EDIT secret you get',
        'USER': 'EDIT your@user.login.name',
        'PASSWORD': 'EDIT password + security_token',
        'HOST': 'https://login.salesforce.com',
    }
}

SALESFORCE_QUERY_TIMEOUT= (4, 15)

The System Administrator user can configure permissions for an application to use Salesforce API. Open Salesforce Lightning in a web browser, click Setup > Apps > App Manager > New Connected App (a button on the upper right corner).

You make a name of your application (or a name of a group of your applications that could be trusted/disabled together), fill some related required fields and click " Enable OAuth Settings " to see related settings. Select then the scope "Manage user data via APIs ( api )" in " Available OAuth Scopes " and click "Save". You will see a "Consumer Key" and "Consumer Secret" for your application or you can see it later if you click "View" in "App Manager" at the end of your line.

I think that other details are good described in the documentation of django-salesforce , but the upper right corner and Available OAuth Scopes are the most important details that will be added to this documentation so that the extensive documentation about Salesforce - OAuth 2 does not have to be read at all in the most simple case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM