We have made a code for webpage made of flask, and access it locally by inputting the IP address of the raspberry pi e.g(192.168.0.1:5000) in the browser. In reference with (https://diyhacking.com/raspberry-pi-web-server/#comment-4651), can we proceed to setting up the static ip(STEP 4: Give your Raspberry Pi a static IP address, in the URL) and setup a dynamic ip without installing Apache?
If you can always reach your Pi on your local network by visiting 192.168.0.1:5000 then the Pi already has a static local IP address. If that IP address changes occasionally then the IP address is being assigned by Dynamic Host Configuration Protocol (DHCP), controlled by your router. You want to make sure the Pi's local IP address is static before continuing.
With regard to installing Apache, Flask's documentation currently states:
While lightweight and easy to use, Flask’s built-in server is not suitable for production as it doesn’t scale well and by default serves only one request at a time.
If you can live with only serving one request at a time and don't care too much about security you can press ahead and open your Pi up to the big bad world. I would recommend, in the strongest possible terms, that you don't do this and use a recognised server package such as Apache. It'll work better in the long run and should give you much more control over what's happening with your site(s). The deployment documentation has a list of viable options and accompanying instructions.