Posts

Showing posts with the label web

Debug django webapps like react native

Image
Introduction Most websites/webapps are now mobile first. Internet browsers these days all have the mobile view that lets you see how the app looks on your phones. But this is not enough to judge the full mobile experience. So, it is better to debug it on an actual phone. To do this, we should either host the app on a server and open the URL on your phone. Or you can locally host it on your WiFi network. What happens in react native React native is a framework of javascript that allows you to build native mobile applications. Debugging in it is made beautifully. A server is started, this prints a QR code on the terminal itself. This QR code is then scanned through an app called Expo. This app automatically installs the app on your phone and runs it. This is the most convenient way I have ever done debugging. What happens in Django In Django, you have to run an HTTP server locally and either debug on your browser or connect your phone on the same network and access it on your...

Different tools for serving static files through HTTP

Image
Introduction Serving static files through HTTP is not a difficult task. Every little web developer is doing it. But not many people understand the real action that is happening underneath. HTTP protocol is very simple to understand and needs to be understood by everyone as it is one of the most used protocols in the world wide web. Working of HTTP The working of the protocol is very simple. It works on the basis of the request and response. A client (generally a user's browser) makes a request for a particular file and the server it. There are 4 basic types of requests: GET, POST, PUT and DELETE. GET is the most used type of request. When a URL is entered into the browser, the browser makes a GET request to the server. The server serves the required HTML file and the browser renders it. But for this, we need to have a server which is capable of accepting requests and processing them. There are several tools available to make a simple HTTP server. We are going to hav...