bendog / she-codes-crowdfunding-api-project-bendog-1

she-codes-crowdfunding-api-project-bendog-1 created by GitHub Classroom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

{{ my project title }}

{{ a paragraph detailing the purpose and target audience }}

Features

User Accounts

  • Username
  • Email Address
  • Password

Project

  • Create a project
    • Title
    • Owner (a user)
    • Description
    • Image
    • Target Amount to Fundraise
    • Open/Close (Accepting new supporters)
    • When was the project created
  • Ability to pledge to a project
    • An amount
    • The project the pledge is for
    • The supporter
    • Whether the pledge is anonymous
    • A comment to go with the pledge

Implement suitable update delete

Note: Not all of these may be required for your project, if you have not included one of these please justify why.

  • Project
    • Create
    • Retrieve
    • Update
    • Destroy
  • Pledge
    • Create
    • Retrieve
    • Update
    • Destroy
  • User
    • Create
    • Retrieve
    • Update
    • Destroy

Implement suitable permissions

Note: Not all of these may be required for your project, if you have not included one of these please justify why.

  • Project
    • Limit who can create
    • Limit who can retrieve
    • Limit who can update
    • Limit who can delete
  • Pledge
    • Limit who can create
    • Limit who can retrieve
    • Limit who can update
    • Limit who can delete
  • Pledge
    • Limit who can retrieve
    • Limit who can update
    • Limit who can delete

Implement relevant status codes

  • Get returns 200
  • Create returns 201
  • Not found returns 404

Handle failed requests gracefully

  • 404 response returns JSON rather than text

Use token authentication

  • impliment /api-token-auth/

Additional features

  • {Title Feature 1}

{{ description of feature 1 }}

  • {Title Feature 2}

{{ description of feature 2 }}

  • {Title Feature 3}

{{ description of feature 3 }}

External libraries used

  • django-filter

Part A Submission

  • A link to the deployed project.
  • A screenshot of Insomnia, demonstrating a successful GET method for any endpoint.
  • A screenshot of Insomnia, demonstrating a successful POST method for any endpoint.
  • A screenshot of Insomnia, demonstrating a token being returned.
  • Your refined API specification and Database Schema.

Step by step instructions for how to register a new user and create a new project (i.e. endpoints and body data).

  1. Create User
curl --request POST \
  --url http://127.0.0.1:8000/users/ \
  --header 'Content-Type: application/json' \
  --data '{
	"username": "testuser",
	"email": "not@myemail.com",
	"password": "not-my-password"
}'
  1. Sign in User
curl --request POST \
  --url http://127.0.0.1:8000/api-token-auth/ \
  --header 'Content-Type: application/json' \
  --data '{
	"username": "testuser",
	"password": "not-my-password"
}'
  1. Create Project
curl --request POST \
  --url http://127.0.0.1:8000/projects/ \
  --header 'Authorization: Token 5b8c82ec35c8e8cb1fac24f8eb6d480a367f322a' \
  --header 'Content-Type: application/json' \
  --data '{
	"title": "Donate a cat",
	"description": "Please help, we need a cat for she codes plus, our class lacks meows.",
	"goal": 1,
	"image": "https://upload.wikimedia.org/wikipedia/commons/c/c1/Dollar_bill_and_small_change.jpg",
	"is_open": true,
	"date_created": "2023-01-28T05:53:46.113Z"
}'

About

she-codes-crowdfunding-api-project-bendog-1 created by GitHub Classroom


Languages

Language:Python 97.3%Language:Dockerfile 2.1%Language:Shell 0.6%