Skip to content

vinodpandey/mock-api-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mock API server setup

Pre-requisite

  • Python
  • virtualenv

Code setup

virtualenv --no-site-packages api-server
cd api-server
git clone git@github.com:vinodpandey/mock-api-server.git

source bin/activate
cd mock-api-server
pip install -r requirements.txt
python manage.py migrate

# create admin account
python manage.py createsuperuser
Username: 
Email address: 
Password: 
Password (again): 

Starting API server

cd api-server
source bin/activate
cd mock-api-server
python manage.py runserver

For adding API URLs

http://localhost:8000/admin/
# use admin account credentials created above

http://localhost:8000/admin/api/api/ > ADD API
Path: /v1/test/api
Method: GET
Status: 200
Response: {'data': 'content data'}
Is enabled: selected
Save

Access: http://localhost:8000/v1/test/api/
{'data': 'data'}

About

Mock REST API server in django

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages