Welcome to Webmatrices Community

Welcome to Webmatrices Community

Our forum is here to help you fix your digital issues related to SEO, Digital Marketing, NFT development, Google Adsense, Blogging and more.

codie

Share your Django story, here's mine

Hey Devs.I started learning Django in COVID times. I was on my grade 12th ATM. I was into content writing and stuff. I had a site, and there was a tool named "Adsense Eligibility Checker" in my site, where user could fill the form, submit their site, and I'd check if there site is eligible or not. The requests were a lot, and task was tedious.I wanted to build something where my presence would not be required. So, I started searching for ways to make a tool/webapp. I was already into learning Python, so maybe fate wanted or something, I got to know about Django.I started learning it. It took me three weeks to nicely learn and 2-3 weeks to develop that tool. I was super happy, wanted to deploy on my cpanel-shared-hosting based server, I had to suffer a lot at that time. But does tons of searches, I deployed it. It got popular, I attached Google Ads on that platform, made a little good money, travelled to places in Nepal.My father's friend used to do Fiverr in Poland, and she suggested me to do so. I had some old Fiverr gigs added, but removed them (were primarily for Photoshop editing). Add a gig, "I'll deploy Django on cPanel", after 2 days of adding that gig, got an order from a Morroco-ian guy. Delivered it. And my journey boosted.I kept doing indie dev and freelancing. After 2 years, my revenue were not doing so well. Had to apply for a job, got the job, worked there for 5 and a half months, and US-based company named "Blogstorm.AI" offered me a job with comparatively good salary, started working there. It's been 1 and a half years working on blogstorm.Now, I am doing full-time job, indie dev and open source. There's a Django rest API framework, that I am working, called Djapy.IO . The journey is going good. I have migrated all my platforms code to Djapy.I hope to see some new guys in there. Life is good man, so is Django. Have a great day. For suggestions, believe on process.

Zaeemusmani replied a month ago
Noce good lovly
Published a month ago
3 likes 1488 watched 3 commented
codie

Django reCaptcha v3 – Install reCaptcha in Django site

Django Recaptcha v3 will be installed in your Django website soon, just follow my instructions. We will be using Google Recaptcha version 3 ( I am not a robot ) and a Python library django-recaptcha for this task.This is a repost of an old blog of ours.How to install, deploy or integrate Django recaptcha v3?Django recaptcha v3 installationFirst, install django-recaptcha in your virtual workspace.Visit the GitHub Repo of this task/project to get all the source codes.Install and configure django-recaptcha libpip install django-recaptchaNow, add captcha in the INSTALLED_APPS section in your settings.pycaptchaMust be similar to this:INSTALLED_APPS = [ 'captcha', # add this code 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', "your_app_name", # app name ]Recaptcha keys configurationAdd RECAPTCHA_PUBLIC_KEY and RECAPTCHA_PRIVATE_KEY at the last lines of your settings.pyRECAPTCHA_PUBLIC_KEY = 'MyRecaptchaKey123' RECAPTCHA_PRIVATE_KEY = 'MyRecaptchaPrivateKey456'Here, RECAPTCHA_PUBLIC_KEY means SITE KEY and RECAPTCHA_PRIVATE_KEY means SECRET KEY.Now, go to Google reCAPTCHA admin panel and register your site for reCAPTCHA and use those data in the upper code.Cpatcha Form configurationNow, create a file named my_captcha.py and inside it you need to write the following Python codes:from django import forms from captcha.fields import ReCaptchaField class FormWithCaptcha(forms.Form): captcha = ReCaptchaField()Django views configurationWrite a context with "captcha" variable name that with render the form we have coded in FormWithCaptcha which is inside the my_captcha.py .from django.shortcuts import render from .my_captcha import FormWithCaptcha # Create your views here. def home(request): context = { "captcha": FormWithCaptcha, } return render(request, "home.html", context)Rendering recaptcha v3Now, we are rendering recaptcha using the Jinja template method. Use {{captcha}} for rendering the captcha form.For now, have a look here:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <forms> {{captcha}} </forms> </body> </html>Getting data from recaptcha formTo get data from django recaptcha, you need to use g-recaptcha-response.get_recaptcha = request.POST.get("g-recaptcha-response")This will return true if the checkbox is checked, else false.

codie replied a month ago
You might also wanna check this video:https://youtu.be/8GNc4Pz4is4
Published a month ago
0 likes 442 watched 1 commented