![]() |
VOOZH | about |
Django is a Python-based web framework that allows you to quickly create efficient web applications. If you are new to Django then you can refer to Django Introduction and Installation. Here we are going to learn How to create a Django project using Firebase as Database .
Step 1: Firstly, We are going to Create a project on Firebase to connect our static web page. Visit Firebase Page For Configuring Your Project - https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fconsole.firebase.google.com%2Fu%2F0%2F%3Fpli%3D1&followup=https%3A%2F%2Fconsole.firebase.google.com%2Fu%2F0%2F%3Fpli%3D1&ifkv=AdBytiPUyACWEV61Cgyh-P11gJytqwuH7XuMwpopdwyQzXTxDZrH9w0IDilaUGB-2EUp82iGDx62lA&osid=1&passive=1209600&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S1862608153%3A1753258092808562
Click On Add Project Button.
👁 ImageStep 2: Give a Name To your Project and Click On Continue Button.
👁 ImageStep 3: Now Click On Continue Button.
👁 ImageStep 4: Now Choose Default Account For Firebase and Click On Create Project.
👁 ImageStep 5: Now Your Project is created. You are Good to Go. Click on Continue .
👁 ImageStep 6: Now Click On 3rd icon that's Web Button(</>).
👁 ImageStep 7: Give a nickname to your Web Project and Click On Register App
👁 ImageStep 8: Now you will see the configuration of your App like this. Copy this Code somewhere .You will need it later.
👁 ImageStep 9 : Click On The Realtime Database button As Shown In Figure.
👁 ImageStep 10: Now Click On Create Database.
👁 ImageStep 11: Now Click On Test Mode and then Click On Enable.
👁 ImageNow, We will Add Some Data and will try to Retrieve that using our Website
👁 ImageNow, I hope that you have already create a project in Django. If not then Refer to How to Create a Basic Project using MVT in Django ? Since we are using firebase as Database , We need to install pyrebase . For this Type the following Command in terminal
$pip install pyrebase4
Create a views.py file in your project directly. The Structure should be like this .
👁 ImageUrls.py file
Views.py
Home.html
Now move to your project directory and run our project using the given command :
python manage.py runserver
Project Output will be as Follow -
👁 Image