Introduction: MODERN VENDING MACHINE GUI USING RASPBERRY PI WITH DJANGO
Can we make modern GUI using web languages for vending machine ?
The following prerequisite are required :
- Raspberry pi With raspian OS installed in it
- A Touchscreen display compatible with raspberry pi
Step 1: Installing Django and Prerequisite for Project
Step 2: Setting Up Your Django Application
If You are comfortable with IDE on raspberry pi go for it.But I recommend to do Django application on PC.It's Better to use PyCharm or Visual Studio for Django Application Development.I'll Done with Pycharm. Go to Pycharm and create a New project under that Select Django. Give a new name for project and on Enable Template and create a name for your app and if you are working on databases enable Django admin and press start.It will Install necessary packages.After that follow these steps.
- Check server is running or not using command - python manage.py runserver on terminal
- If you Don't know about Django basics navigate to the site Polls app where you can easily understand about Django Basics.
Step 3: Creating a GUI and Linking With Backend
- For Creating a GUI I'll Done with Html 5 and CSS 3.You can create a number of pages as your wish and for Icons and pictures try to download and use if you are working with offline vending machine and for online use URL links. I've stored those .html files in Template Directory we just enabled.
- Use static folder for storing Images,Videos and CSS files respectively
- After that use urls.py in Django to link the Files with back end progress.
- clone or Download the repository in GitHub - Raspberry-pi-Gui-Django
Step 4: Replacing Files in Raspberry-pi and Configuring
Congratulations , If you Followed steps till Now its time to test GUI on raspberry pi.
- create a Django application with same name as used in your PC or Laptop
- Create Template and Static Folders on your Pi
- Replace the new Files with the actual Files you created For more details refer the Pictures.
- The next step is to create a Auto-start script to start server during boot up in Background
- The Final thing is to enable Kiosk Mode in raspberry pi for more Details Check out my Github Page anf if you want to show chromium in Fullscreen Mode
All the Best Guys ,let'sStart Make your Own
Participated in the
Raspberry Pi Contest 2020