Azure Function successfully published but missing from Azure Portal - python

My Function app is not showing up in the Portal though it publishes successfully from local machine.
Example:
Success!:
Failure:
Tried:
Visiting https:myapp.azurewebsites.net
Visiting https://myapp.scm.azurewebsites.net/api/deployments
Last deployment looks good:
{
"id": "<redacted>",
"status": 4,
"status_text": "",
"author_email": "N/A",
"author": "<redacted>",
"deployer": "Push-Deployer",
"message": "Created via a push deployment",
"progress": "",
"received_time": "2020-10-23T20:38:47.1069702Z",
"start_time": "2020-10-23T20:38:47.3075338Z",
"end_time": "2020-10-23T20:39:19.3128742Z",
"last_success_end_time": "2020-10-23T20:39:19.3128742Z",
"complete": true,
"active": true,
"is_temp": false,
"is_readonly": true,
"url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f",
"log_url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log",
"site_name": "myapp"
}
Visiting https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log
Steps looks good:
[
{
"log_time": "2020-10-23T20:38:47.2134775Z",
"id": "a9bfd9e3-dee2-4bfc-9e82-9b003d3df991",
"message": "Updating submodules.",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:38:47.2820867Z",
"id": "e980bad8-ee6a-467f-98ea-c78135e29eeb",
"message": "Preparing deployment for commit id '5e446e26fc'.",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:38:47.4606839Z",
"id": "961ce7eb-2388-4a36-9646-32a7455fce10",
"message": "Repository path is /tmp/zipdeploy/extracted",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:38:47.5141536Z",
"id": "1f1ad9b0-d5bf-41f0-ad77-537c2da9a010",
"message": "Running oryx build...",
"type": 1,
"details_url": "https://myapp.scm.azurewebsites.net/api/deployments/5e446e26fc934a75b4ab7241ce589e9f/log/1f1ad9b0-d5bf-41f0-ad77-537c2da9a010"
},
{
"log_time": "2020-10-23T20:39:14.3176646Z",
"id": "45fc756f-4873-469c-8adf-7b8968ceec95",
"message": "Writing the artifacts to a Zip file",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:39:18.8047683Z",
"id": "3f9b3434-dcbc-496e-8480-d3bff123159e",
"message": "Running post deployment command(s)...",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:39:18.9330242Z",
"id": "11e6d453-3aa0-4afd-a20e-7edc6369d774",
"message": "Triggering recycle (preview mode disabled).",
"type": 0,
"details_url": null
},
{
"log_time": "2020-10-23T20:39:19.0915157Z",
"id": "43df8884-3066-434b-91ed-6b2bbfac6236",
"message": "Deployment successful.",
"type": 0,
"details_url": null
}
]
I even created a whole new Function App (in the same resource group, using the same App Service Plan) and tried publishing the Function to it... no go.
I have 6 or 7 python Functions in prod, this is not my first deployment.
Is this a known issue that is being worked on? How do I get the Function to be visible in Portal?

I was able to determine the issue. It was my fault.
SSH into Function app via https://myFunctionName.scm.azurewebsites.net/webssh/host
ls /home/site/wwwroot/myFunctionName
The main python filename had a space " " in the filename
Was: __init__ .py
Should have been: __init__.py
Fixed this and republished

Related

Is there a way to set public IP to delete when Azure VM is deleted using Python REST API?

I would like to Delete a VM with its attached resources including Network Interfaces, data disks, OS Disk and Public IP when a certain URL is called with a delete method:
http://servername.com/azr/vm_name/subscription_id/resource_group
However, I'm having some issues attaching the Public IP For deletion.
I'm doing this by:
Calling Azure GET VM API to get the VM and resource details and saving the response JSON into a variable "response_json"
{
"name": "TestAZR",
"id": "/subscriptions/xx-xxx-xx/resourceGroups/xxx-xxx-xx/providers/Microsoft.Compute/virtualMachines/TestAZR",
"type": "Microsoft.Compute/virtualMachines",
"location": "eastus",
"properties": {
"vmId": "xxx-xxx-xxx",
"hardwareProfile": {
"vmSize": "Standard_DS1_v2"
},
"storageProfile": {
"imageReference": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2016-datacenter-gensecond",
"version": "latest"
},
"osDisk": {
"osType": "Windows",
"name": "TestAZR_disk1",
"createOption": "FromImage",
"caching": "ReadWrite",
"managedDisk": {
"storageAccountType": "xx",
"id": "/subscriptions/xx-xxx/resourceGroups/xx=xxx=x/providers/Microsoft.Compute/disks/TestAZR_disk1
},
"deleteOption": "Detach",
"diskSizeGB": 127
},
"dataDisks": [
{
"lun": 0,
"name": "TestAZR_DataDisk_0",
"createOption": "Attach",
"caching": "ReadOnly",
"writeAcceleratorEnabled": false,
"managedDisk": {
"storageAccountType": "Premium_LRS",
"id": "/subscriptions/xx-xxx-/resourceGroups/xx-xxx-x/providers/Microsoft.Compute/disks/TestAZR_DataDisk_0"
},
"deleteOption": "Detach",
"diskSizeGB": 1024,
"toBeDetached": false
},
{
"lun": 1,
"name": "TestAZR_DataDisk_1",
"createOption": "Attach",
"caching": "ReadOnly",
"writeAcceleratorEnabled": false,
"managedDisk": {
"storageAccountType": "Premium_LRS",
"id": "/subscriptions/xx-xxx-x/resourceGroups/xx-xxx-xx/providers/Microsoft.Compute/disks/TestAZR_DataDisk_1"
},
"deleteOption": "Detach",
"diskSizeGB": 1024,
"toBeDetached": false
}
]
},
"osProfile": {
"computerName": "TestAZR",
"adminUsername": "AAAA",
"windowsConfiguration": {
"provisionVMAgent": true,
"enableAutomaticUpdates": true,
"patchSettings": {
"patchMode": "AutomaticByOS",
"assessmentMode": "ImageDefault",
"enableHotpatching": false
},
"enableVMAgentPlatformUpdates": false
},
"secrets": [],
"allowExtensionOperations": true,
"requireGuestProvisionSignal": true
},
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/xx-xxx-x/resourceGroups/xx-xxx-x/providers/Microsoft.Network/networkInterfaces/testazrexecute35_z1",
"properties": {
"deleteOption": "Detach"
}
}
]
},
"diagnosticsProfile": {
"bootDiagnostics": {
"enabled": true
}
},
"provisioningState": "Succeeded",
"timeCreated": "2022-09-15T19:04:13.2910488+00:00"
},
"zones": [
"1"
]
}
Modifying the response_json setting each "DeleteOption" with "Delete" so they get deleted with the VM
Sending the response_json in a PATCH API with the request.
Deleting VM with the DELETE VM API
This works for deleting VM along with Network Interface, Data Disks and OS Disk but Public IP doesn't seem to be deleted with Network Interface automatically.
So I tried this alternatively:
I use the GET Network interface API that contains the Public IP name inside:
{
"name": "testazr845_z1",
"id": "/subscriptions/xx-xxx-xx/resourceGroups/xx-xxx-xx/providers/Microsoft.Network/networkInterfaces/testazr845_z1",
"etag": "W/\"xx-xxx-xx\"",
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "xx-xxx-",
"ipConfigurations": [
{
"name": "ipconfig1",
"id": "/subscriptions/xxx-xxxx-xx/resourceGroups/xxx-xxx-xx/providers/Microsoft.Network/networkInterfaces/testazr845_z1/ipConfigurations/ipconfig1",
"etag": "W/\"xxx-xxx-xx\"",
"type": "Microsoft.Network/networkInterfaces/ipConfigurations",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "",
"privateIPAllocationMethod": "Dynamic",
"publicIPAddress": {
"name": "TestAZR-ip",
"id": "/subscriptions/xxx-xxx-x/resourceGroups/xx-xxx-xx/providers/Microsoft.Network/publicIPAddresses/TestAZR-ip",
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "xx-xxxx-xx",
"publicIPAddressVersion": "IPv4",
"publicIPAllocationMethod": "Dynamic",
"idleTimeoutInMinutes": 4,
"ipTags": [],
"ipConfiguration": {
"id": "/subscriptions/xxx-xxxx-x/resourceGroups/xx-xxx-xx/providers/Microsoft.Network/networkInterfaces/testazr845_z1/ipConfigurations/ipconfig1"
},
"deleteOption": "Detach"
},
"type": "Microsoft.Network/publicIPAddresses",
"sku": {
"name": "Basic",
"tier": "Regional"
}
},
"subnet": {
"id": "/subscriptions/xx-xxxx-xx/resourceGroups/VPCxAzrDev/providers/Microsoft.Network/virtualNetworks/xx-xx/subnets/alphatest_ase_subnet"
},
"primary": true,
"privateIPAddressVersion": "IPv4"
}
}
],
"dnsSettings": {
"dnsServers": [],
"appliedDnsServers": [],
"internalDomainNameSuffix": ""
},
"macAddress": "",
"enableAcceleratedNetworking":,
"vnetEncryptionSupported":,
"enableIPForwarding":,
"primary":,
"virtualMachine": {
"id": "/subscriptions/xx-xxx-xx/resourceGroups/xxx-xxx/providers/Microsoft.Compute/virtualMachines/TestAZR"
},
"hostedWorkloads": [],
"tapConfigurations": [],
"nicType": "Standard",
"allowPort25Out": true
},
"type": "Microsoft.Network/networkInterfaces",
"location": "eastus",
"kind": "Regular"
}
I save that response into a variable json "network_interface_json", and in it I modify it with {"DeleteOption" : "Delete"} for the Public IP
I send this json in the PATCH API that's listed for deleting resources with VM
https://learn.microsoft.com/en-us/azure/virtual-machines/delete?tabs=rest2%2Ccli3%2Cportal4%2Cportal5
However I'm getting the following error message when sending this request:
{
"error": {
"code": "LinkedAuthorizationFailed",
"message": "The client '123124-12312-xx' with object id '1231-xx-xx' has permission to perform action 'Microsoft.Network/networkInterfaces/write' on scope '/subscriptions/xxx-xx-xx/resourceGroups/xx-xx-x/providers/Microsoft.Network/networkInterfaces/AZRTEST; however, it does not have permission to perform action 'Microsoft.Network/virtualNetworks/subnets/join/action' on the linked scope(s) '/subscriptions/xx-xxx-x/resourceGroups/VPCxAzureDevelopment/providers/Microsoft.Network/virtualNetworks/VPCxAzureDevelopment-eastus/subnets/xxx-xxx-subnet' or the linked scope(s) are invalid."
}
}
So it seems to be a permissions issue? Or maybe the json I'm using isn't correct to send for PATCH API? I've tried removing the subnet part but this doesn't seem to work, open to any suggestions.

Json decoder error when loading a json file. While the File is validated as Json. in Python

so I am opening a Json file and when I try to load the file to a variable I get an errr because it can't read the file. While I have validated (online) that the Json file is valid. I am using this code:
with open("messagesTest2.json") as json_file:
data = json.load(json_file) <----- ERROR
for p in data['commits']:
print(p['message'])
And I get this error. While I have another json file that is also validated and this code works. But this file doesn't work. My guess is that somewhere in the file there is something that it cannot translate as json? Is the decoder's fault?
in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Do you have any idea how to fix it? Keep in mind that the json file is valid else I'll have to show the file but I'll have to hide some data :D
The Json file (The urls/passwards/logins/etc have been replaced but the format remains the same) :
{
"commits": [{
"sha": "asjdaskldjkalsk",
"node_id": "sakldjaskldjaskldjklas",
"commit": {
"author": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-09-07T22:06:51Z"
},
"committer": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-09-07T22:06:51Z"
},
"message": "Added LaTex template and instructions",
"tree": {
"sha": "askdljaskdlajsklda",
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915"
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comment_count": 0,
"verification": {
"verified": "False",
"reason": "unsigned",
"signature": "None",
"payload": "None"
}
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"html_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comments_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"author": {
"login": "korki",
"id": 999,
"node_id": "askljdklas==",
"type": "User",
"site_admin": "None"
},
"committer": {
"login": "korki",
"id": 999,
"node_id": "askljdklas==",
"type": "User",
"site_admin": "None"
},
"parents": [{
"sha": "asdaskldjasdklsjl",
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"html_url": "https://gits-15.ds.sd.se/04dd5b226dda1915"
}]
}, {
"sha": "kasdjklasdjklas",
"node_id": "sdklasjdklasjkl",
"commit": {
"author": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-08-31T10:45:24Z"
},
"committer": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-08-31T10:45:24Z"
},
"message": "Update README.md",
"tree": {
"sha": "askldjkasldjklas",
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915"
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comment_count": 0,
"verification": {
"verified": "None",
"reason": "unsigned",
"signature": "None",
"payload": "None"
}
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"html_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comments_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"author": {
"login": "korki",
"id": 999,
"node_id": "dkasdasdnas==",
"type": "User",
"site_admin": "None"
},
"committer": {
"login": "korki",
"id": 999,
"node_id": "askldaskldja==",
"type": "User",
"site_admin": "None"
},
"parents": [{
"sha": "dlkasdjklas;dlkjas;",
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"html_url": "https://gits-15.ds.sd.se/04dd5b226dda1915"
}]
}, {
"sha": "dsagadsgsgdsa",
"node_id": "sdagfsdgsd",
"commit": {
"author": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-08-31T10:44:42Z"
},
"committer": {
"name": "korki",
"email": "korki#kth.se",
"date": "2015-08-31T10:44:42Z"
},
"message": "Initial commit",
"tree": {
"sha": "asdasddasdas",
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915"
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comment_count": 0,
"verification": {
"verified": "None",
"reason": "unsigned",
"signature": "None",
"payload": "None"
}
},
"url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"html_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"comments_url": "https://gits-15.ds.sd.se/04dd5b226dda1915",
"author": {
"login": "korki",
"id": 999,
"node_id": "kjklklj==",
"type": "User",
"site_admin": "None"
},
"committer": {
"login": "korki",
"id": 999,
"node_id": "jhkjkj==",
"gravatar_id": "",
"type": "User",
"site_admin": "None"
},
"parents": []
}]
}
That error means it is reading a blank file. Make sure you are reading the file you think you are reading.
EDIT: Another possibility is that you have already read through all the lines of the file. If you read through all the lines and try to read the file, it will appear as a blank file.
I had the exact same issue. I used a powershell script to create a json file and I tried to read the file from another python script but I kept getting the same error as you, even though the JSON file was properly formatted. The issue was I was using a powershell command, "Out-File" Instead, I used Set-Content and it fixed the issue. I believe it was an encoding difference between the commands. Maybe look at how you created the JSON file and the encoding used. I know this is late but I'll share anyways just in case anyone else is having the same issue.

Display GitHub stats on a Flask website

I'm wondering if there is a way to display the number of commits/branches/etc made in a repository to a website. I'm using Flask to for the website with jinja2 on an apache2 server and instead of displaying the number through hard coding it I would like it to update the number automatically whenever new commits/branches are made.
You can use the GitHub API to do this.
For example, you can request the amount of commits a repository has by requesting (GET) /repos/:owner/:repo/commits.
An example of a response is as follows (from the API documentation):
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"html_url": "https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments",
"commit": {
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"author": {
"name": "Monalisa Octocat",
"email": "support#github.com",
"date": "2011-04-14T16:00:49Z"
},
"committer": {
"name": "Monalisa Octocat",
"email": "support#github.com",
"date": "2011-04-14T16:00:49Z"
},
"message": "Fix all the bugs",
"tree": {
"url": "https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
},
"comment_count": 0,
"verification": {
"verified": true,
"reason": "valid",
"signature": "-----BEGIN PGP MESSAGE-----\n...\n-----END PGP MESSAGE-----",
"payload": "tree 6dcb09b5b57875f334f61aebed695e2e4193db5e\n..."
}
},
"author": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"committer": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"parents": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
]
}
]
Since you're using an API, you can request it each time the page is loaded, in a sense, automatically updating it.

Trouble with ec2_vpc_subnet module

I'm trying to run the following play
- name: Create subnet for database servers
ec2_vpc_subnet:
state: present
region: "us-east-1"
vpc_id: "vpc-abcd1234"
cidr: "10.10.10.0/28"
resource_tags:
Name: "Subnet"
register: subnet
Every time I run the playbook the subnet recreates
Here is my -vvvv output
changed: [localhost] => {
"changed": true,
"invocation": {
"module_args": {
"aws_access_key": null,
"aws_secret_key": null,
"az": "us-east-1b",
"cidr": "10.0.10.0/28",
"ec2_url": null,
"profile": null,
"region": "us-east-1",
"resource_tags": {
"Name": "subnet"
},
"security_token": null,
"state": "present",
"tags": {
"Name": "subnet"
},
"validate_certs": true,
"vpc_id": "vpc-abcd1234"
},
"module_name": "ec2_vpc_subnet"
},
"subnet": {
"availability_zone": "us-east-1b",
"available_ip_address_count": 11,
"cidr_block": "10.0.10.0/28",
"default_for_az": "false",
"id": "subnet-cc399de1",
"map_public_ip_on_launch": "false",
"state": "available",
"tags": {
"Name": "subnet"
},
"vpc_id": "vpc-abcd1234"
}
}
Is anyone else having this issue? It would be great to build subnets outside of ec2_vpc module and have them be stable.
Thanks
I solved this issue myself. I had been using ec2_vpc module higher up the playbook to deploy AWS VPC, IGW, & subnets. I moved my Task to ec2_vpc and adjusted the downstream keys.
My ec2_vpc_subnet tasks no longer change after runs
Thanks

How to Convert Json Value of Http Post Parameter to Python Dict in Django?

I am using Django to receive and process push notifications from the foursquare real-time api. Each checkin is pushed as a POST request to my server containing a single parameter named checkin. I am trying to grab the value of the checkin parameter and convert it to a python dict. However, calling json.loads always results in the following error:
NameError: name 'true' is not defined
I know the json is valid, so I must be doing something wrong.
The code is:
import json
def push(request):
if request.is_secure():
checkin_json = request.POST['checkin']
checkin = json.load(request.POST)
The body of the post request is:
"checkin =
{
"id": "4e6fe1404b90c00032eeac34",
"createdAt": 1315955008,
"type": "checkin",
"timeZone": "America/New_York",
"user": {
"id": "1",
"firstName": "Jimmy",
"lastName": "Foursquare",
"photo": "https://foursquare.com/img/blank_boy.png",
"gender": "male",
"homeCity": "New York, NY",
"relationship": "self"
},
"venue": {
"id": "4ab7e57cf964a5205f7b20e3",
"name": "foursquare HQ",
"contact": {
"twitter": "foursquare"
},
"location": {
"address": "East Village",
"lat": 40.72809214560253,
"lng": -73.99112284183502,
"city": "New York",
"state": "NY",
"postalCode": "10003",
"country": "USA"
},
"categories": [
{
"id": "4bf58dd8d48988d125941735",
"name": "Tech Startup",
"pluralName": "Tech Startups",
"shortName": "Tech Startup",
"icon": "https://foursquare.com/img/categories/building/default.png",
"parents": [
"Professional & Other Places",
"Offices"
],
"primary": true
}
],
"verified": true,
"stats": {
"checkinsCount": 7313,
"usersCount": 565,
"tipCount": 128
},
"url": "http://foursquare.com"
}
}"
Try json.loads(checkin_json) instead of json.load(request.POST). Notice the extra 's'.
change checkin = json.load(request.POST) to checkin = json.loads(checkin_json)
On python, boolean values are Capitalized (first letter is uppercase): True/False.
Check this.
EDIT:
Pay attentiot at this lines:
"primary": true
}
],
"verified": true,
Both "true" values are lowercase and need to be capitalized

Categories

Resources