Skip to content

ibqn/lead-manager-django

Repository files navigation

Getting started

Start server by running the following command in the virtual environment

python manage.py runserver localhost:4000

Create http post and get requests

http :4000/api/leads/ 'name=Jane Williams' 'email=jane@gmail.com' 'message=Please contact Jane'
http :4000/api/leads/ 'name=Sam Smith' 'email=sam@gmail.com' 'message=Please contact Sam'
http :4000/api/leads/ 'name=John Doe' 'email=jdoe@gmail.com' 'message=Please contact John'

List all data entries from the Lead table

http :4000/api/leads/

Delete leads

For example, if you want to remove lead with the id 3, do the following

http DELETE :4000/api/leads/3/

Fixtures

You can restore model data from fixtures by running the following command

python manage.py loaddata leads

To dumpdate in yaml format install pyyaml

pip install pyyaml

Fixtures for the Lead table in yaml format were created with

python manage.py dumpdata --format yaml leads.lead > ./leads/fixtures/leads.yaml

Test auth routes

After successful login user route can be teste with

 http :4000/api/auth/user Authorization:'Token 62fadfdafe0ba53104905fa1beee83144955549e8a7f453ae2771429c1bdc235'

Releases

No releases published

Packages

No packages published