From the course: Secure Coding in Python
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Challenge: Secure the endpoint - Python Tutorial
From the course: Secure Coding in Python
Challenge: Secure the endpoint
It's time for a challenge. And in this one, we're going to secure an API endpoint. We'll make sure we secure this endpoint so that it should not be affected if our application runs in optimized mode. So let's go ahead and navigate to our exercise files. And for this one, I'll be using Django, which is very popular for Python web development. However, these principles should apply whether you're using Django or something like FastAPI or Flask. And here we have our application in 02_04. It's called asserto. And we'll head over to our terminal. We'll feed in to 02_04/asserto, clear our terminal, and we'll run this by typing in pipenv run python manage.py runserver. And we have the option to open this in our browser. If you're running this locally, you can go to localhost port 8000 or whichever port your application is running on, and we see that success equals false. So let's have a look at injection and how the Python documentation can help us figure out the best practices we can use to…