Blog

Page 114 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for How do I reference a Django settings variable in my models.py?

How do I reference a Django settings variable in my models.py?

Published on September 2, 2023

# How to Reference a Django Settings Variable in your models.py So, you're building a Django project and you want to reference a variable from your settings.py file in your models.py file. You may have tried a few things already, like `settings.PRIVATE_DI

Cover Image for How to pull a random record using Django"s ORM?
python

How to pull a random record using Django"s ORM?

Published on September 2, 2023

šŸŽØ How to Pull a Random Record using Django's ORM šŸŽØ šŸ‘‹ Hey there fellow Django enthusiasts! Are you struggling with pulling a random record from your Django model? We've got you covered! In this guide, we'll explore different easy solutions to help you a

Cover Image for How to get a favicon to show up in my django app?
python

How to get a favicon to show up in my django app?

Published on September 2, 2023

# How to get a favicon to show up in my Django app? So, you want your favicon to show up in your app, huh? Well, you've come to the right place! In this blog post, I'll walk you through the process of getting that favicon displayed in your Django app. 🌟�

Cover Image for Reload django object from database
python

Reload django object from database

Published on September 2, 2023

## **Refreshing Django Objects from the Database: A Complete Guide** šŸ•‘ Estimated reading time: 5 minutes šŸ”§ Technical level: Beginner/Intermediate šŸ’¬ Share this post: [Twitter](https://twitter.com/share?url=url_encoded_blog_post_link&text=Refreshing%20Dj

Cover Image for How to access the local Django webserver from outside world
python

How to access the local Django webserver from outside world

Published on September 2, 2023

# 🌐 How to Access the Local Django Web Server from the Outside World So you've successfully set up the Django web server using the built-in `runserver` command, and it's working like a charm when accessed locally. But now, you want to take it a step furt

Cover Image for How can I enable CORS on Django REST Framework
corspython

How can I enable CORS on Django REST Framework

Published on September 2, 2023

## Angular is not Django's Brother.. but they can be Friends! šŸ¤ So, you're working on your Django project and want to take advantage of the Django REST Framework to build a powerful API. But, uh-oh! You're running into that pesky pesky CORS (Cr

Cover Image for How to get Request.User in Django-Rest-Framework serializer?

How to get Request.User in Django-Rest-Framework serializer?

Published on September 2, 2023

šŸ“ Title: "Unlocking the Power of Request.User in Django-Rest-Framework Serializer šŸš€" Introduction: Hey there, tech enthusiasts šŸ‘‹! If you're diving into the Django Rest Framework and finding yourself scratching your head over how to access the Request.U

Cover Image for Django - How to rename a model field using South?
python

Django - How to rename a model field using South?

Published on September 2, 2023

# šŸ’» Django - How to Rename a Model Field using South? šŸ’ŖšŸ”€ Have you ever found yourself in a situation where you needed to rename a field in your Django model? It can be quite a challenging task, especially if you are not familiar with the South migratio

Cover Image for Should I be adding the Django migration files in the .gitignore file?
python

Should I be adding the Django migration files in the .gitignore file?

Published on September 2, 2023

# Should I be adding the Django migration files in the .gitignore file? šŸ¤” So, you've been experiencing git issues because of migration conflicts in your Django project? Well, fret not! We've got you covered with a simple solution: adding the migration fi

Cover Image for Does SQLAlchemy have an equivalent of Django"s get_or_create?
python

Does SQLAlchemy have an equivalent of Django"s get_or_create?

Published on September 2, 2023

# SQLAlchemy vs Django: Get or Create šŸ“ **Introduction** When it comes to dealing with databases in Python, both SQLAlchemy and Django offer powerful features to simplify the process. One common requirement is retrieving an object from the database if i