Posts

JWT USING DJANGO REST FRAMEWORK - SIMPLEJWT

   JWT with djangorestframework-simplejwt What changes compared with the PyJWT version Before (PyJWT) Now (simplejwt) jwt_utils.py : you wrote create/decode by hand Deleted. simplejwt builds and verifies tokens authentication.py : you parsed the header, handled expiry and errors A short subclass that only says how to find your User One access token Access token and refresh token , with a ready-made expiry system Manual expiry setting SIMPLE_JWT settings dict Roles, permissions, serializers and ViewSets stay almost the same. Why a subclass is needed: simplejwt assumes Django’s user model ( AUTH_USER_MODEL ). Your User is a separate table (UserId, Username, Password, RoleId), and your project already has migrations and an admin superuser, so switching AUTH_USER_MODEL now would break migrations. The subclass keeps your model and still uses simplejwt for everything else. Step 0: Install bash pip install djangorestframework-simplejwt You can remove PyJWT usage. simplejwt i...

WEBSITE SCRAPING IN C# : WEB-CRAWLING CONCEPTS

  What are we building? A C# console application that: Starts at https://www.faithinfotechacademy.com/ Finds internal links. Visits all allowed pages. Excludes: Testimonials Gallery Placements Blog Contacts Extracts page text. Performs basic sanitization. Splits text into individual lines/items. Removes duplicates. Saves the result as JSON. Later, the same list can be posted to the ASP.NET Core API. So the architecture becomes: Faith Infotech Website │ ▼ C# Web Scraper │ │ HttpClient │ HtmlAgility │ Pack └─────┬─────┘ │ ▼ Extract HTML │ ▼ Remove unwanted HTML elements │ ▼ Sanitize text │ ▼ Split into lines │ ▼ Remove duplicates │ ▼ List<ScrapedData> │ ├──────────────► JSON │ └──────────────► AS...