![]() The framework based on PHP and you can add the UnitTest(using PHPUnit) to work with the API as well. In this post, I gonna share how to create the REST API with the fast and lightweight framework called Slim. ![]() So you can provide this special API for this Europe tour company only.Īs I am a web developer, I mostly work with Web APIs or often called RESTful (representational state transfer). For example, you agree to sell Thailand package tours with a spacial price for the Europe tour company. The partner API, it is used by the specific parties who make an agreement with. The public API, it is published outside the company such as the tour packages information. Mostly it is used for the development purpose for developers. In short, the private API is used as the internal API in the company. They are the private API, public API, and partner API. For example, you have your own custom application or custom website and you want to exchange your data with the Facebook app or mobile application or other applications, you can create your own API and allow those platforms to access your data that you want them to access.įor the business standpoint, API can open up new opportunities for new business partnerships with related service providers such as Travel business, Spa, Tour, Hotel and restaurant.ĪPIs can categorize in three basic types. It lets your product or service communicate with other platforms. API stands for an application programming interface. Navigate to models.py file where we will be creating our models from.API, you may hear about it often nowadays. Is the command we will use to create the app. We will create an articles app where we will house everything related to an article. Having set up the project, it is time to start creating an app for our project. With this, we are ready for the next step. Open your settings.py and in the installed apps add rest_framework in quotes. With this, we now have a Django project where we can integrate our Django rest framework. ![]() Next we apply the database migrations by running python mange.py migrateĪnd finally, run the server to ensure everything is intact Do this by running python manage.py runserver For this, we run the command django-admin startproject yourprojectname We need to create a Django project to work with. Now we are ready to create our first DRF API. Since we will be using Django Rest Framework ( DRF) for creating the API, go ahead and install it into your virtual environment the same way we did it above. You should be having these files now in your folder. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |