In this post we will create an api-rest with which you can elevate your imagination to create more professional things. As we have seen in previous posts, the first thing we have to do when we are working with python is to create a virtual environment to avoid conflicts with the modules that we are going to install.
$ python3 -m venv api-rest $ cd api-rest $ cd bin $ source activate $ cd .. $ cd ..
After activating our virtual environment we will install the latest version of django within the virtual apirest environment we have created.
$ pip install django
Now we will install django rest framework
$ pip install djangorestframework
The following two installations are in the django rest framework documentation.
$ pip install markdown
$ pip install django-filter
with the following command, we create our project named apirest
$ django-admin startproject apirest
If everything is correct we will have the following answer.
With the following command, we enter the project folder and create an application with which we are.
$ cd apirest $ django-admin startapp test1
If everything is correct we will have the following result.
Finally, we perform the migrations, create the migrations, superuser and turn on the server.
$ python manage.py makemigrations$ python manage.py migrate
$ python manage.py createsuperuser
$ python manage.py runserver
We already have our application running if we enter the next url with the username and password we have created, we have the following result.
This is the result after entering the user and password created previously.
We have our application ready, you just have to create the models, serializers, and views depending on the business model such as nmap, password cracking, sql injenctions, audio, video and image analysis etc…
I invite you to review this framework and also be aware of the second part where we will create several hacking applications from this project.