Changing Model of CreateView and form
Hi all, I'd like to be able to have one CreateView that can work for a handful of models I have. Based on this portion of the documentation:
"These generic views will automatically create a `ModelForm`, so long as they can work out which model class to use"
I believe if I pass the right model to a class inheriting CreateView, I'll get a form to use for that model. With this in mind, is it possible to change the model a view references when requested? According to the documentation, I should be able to use get_object() or get the queryset, but both of those take me to SingleObjectMixin, which I don't think is used in CreateView. Am I attempting something impossible, or am I missing a key detail?
/r/django
https://redd.it/1j3hnxi
Hi all, I'd like to be able to have one CreateView that can work for a handful of models I have. Based on this portion of the documentation:
"These generic views will automatically create a `ModelForm`, so long as they can work out which model class to use"
I believe if I pass the right model to a class inheriting CreateView, I'll get a form to use for that model. With this in mind, is it possible to change the model a view references when requested? According to the documentation, I should be able to use get_object() or get the queryset, but both of those take me to SingleObjectMixin, which I don't think is used in CreateView. Am I attempting something impossible, or am I missing a key detail?
/r/django
https://redd.it/1j3hnxi
Django Project
Creating forms from models | Django documentation
The web framework for perfectionists with deadlines.
5 Things You Wish You Knew Before Starting Django
https://preview.redd.it/lmb92qul68ve1.png?width=1280&format=png&auto=webp&s=ccaeeb6b1e2419a9c50744b0d5ad0930da71edc7
After 5 years as a backend developer, here's what I really wish someone told me when I started learning Django 👇
1️⃣ Django is NOT just the Admin panel
Many people think Django is only for quick CRUD apps because of its admin interface. But the real power lies in custom apps, APIs, signals, middleware, and reusable architecture.
2️⃣ Class-Based Views (CBVs) are powerful—but confusing at first
CBVs feel overwhelming initially, but once you master
3️⃣ Use Django REST Framework (DRF) early
If you're building APIs, DRF is your best friend. Master
4️⃣ Project structure matters
Splitting apps properly, separating
5️⃣ Signals and Middleware are game-changers
Want to trigger actions automatically or customize request/response flow? Learn signals and middleware to level up.
💡 Bonus Tip: Learn Django the right way. Don’t just follow CRUD tutorials—build real-world systems (accounting, HR, booking, dashboards, etc.)
🔥 I’m building a full real-world Django backend course (no repetitive clones, pure architecture + business logic).
Follow me if you're interested 💬
\#django #python
/r/django
https://redd.it/1k0oyxr
https://preview.redd.it/lmb92qul68ve1.png?width=1280&format=png&auto=webp&s=ccaeeb6b1e2419a9c50744b0d5ad0930da71edc7
After 5 years as a backend developer, here's what I really wish someone told me when I started learning Django 👇
1️⃣ Django is NOT just the Admin panel
Many people think Django is only for quick CRUD apps because of its admin interface. But the real power lies in custom apps, APIs, signals, middleware, and reusable architecture.
2️⃣ Class-Based Views (CBVs) are powerful—but confusing at first
CBVs feel overwhelming initially, but once you master
ListView, DetailView, and mixins, they save tons of code.3️⃣ Use Django REST Framework (DRF) early
If you're building APIs, DRF is your best friend. Master
Serializers, ViewSets, and Routers early. It’ll make you a 10x backend dev.4️⃣ Project structure matters
Splitting apps properly, separating
services, utils, and permissions, and planning for scale early saves massive refactoring pain later.5️⃣ Signals and Middleware are game-changers
Want to trigger actions automatically or customize request/response flow? Learn signals and middleware to level up.
💡 Bonus Tip: Learn Django the right way. Don’t just follow CRUD tutorials—build real-world systems (accounting, HR, booking, dashboards, etc.)
🔥 I’m building a full real-world Django backend course (no repetitive clones, pure architecture + business logic).
Follow me if you're interested 💬
\#django #python
/r/django
https://redd.it/1k0oyxr
Deploying Django on Cpanel
A friend of mine who's new to Django had a rough time trying to deploy his project on cPanel. After struggling for 4 days, he asked me for help. I walked him through the whole process — from setting up the Python app to handling static files in production.
To make it easier for others who might face the same issue, I recorded a step-by-step video
How to Deploy https://youtu.be/6\_HH5k76A2s?si=S4Mgp2OEU8pScMhj
How to serve static files https://youtu.be/qxtDxIJJIFw?si=H43VPtAgZqOLUGaI
Let me know what you think — and feel free to drop any suggestions or improvements!
/r/djangolearning
https://redd.it/1kuedkk
A friend of mine who's new to Django had a rough time trying to deploy his project on cPanel. After struggling for 4 days, he asked me for help. I walked him through the whole process — from setting up the Python app to handling static files in production.
To make it easier for others who might face the same issue, I recorded a step-by-step video
How to Deploy https://youtu.be/6\_HH5k76A2s?si=S4Mgp2OEU8pScMhj
How to serve static files https://youtu.be/qxtDxIJJIFw?si=H43VPtAgZqOLUGaI
Let me know what you think — and feel free to drop any suggestions or improvements!
/r/djangolearning
https://redd.it/1kuedkk
YouTube
How Host Django in Cpanel
This video will show you how to host your Django project on cPanel.
After deploying, you might notice that your styles (CSS and JS) from both the frontend and admin panel are missing when DEBUG is set to False.
Don’t worry — that’s expected in production.…
After deploying, you might notice that your styles (CSS and JS) from both the frontend and admin panel are missing when DEBUG is set to False.
Don’t worry — that’s expected in production.…
Simple Django Models Explanation for beginners
Hey Django folks!
I created a small post explaining Django Models in super simple Hinglish for beginners.
Feel free to check it out here 👇
https://www.reddit.com/r/django/comments/1lgpp1x/simple\_django\_models\_explanation/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button
\#django
/r/djangolearning
https://redd.it/1lgps31
Hey Django folks!
I created a small post explaining Django Models in super simple Hinglish for beginners.
Feel free to check it out here 👇
https://www.reddit.com/r/django/comments/1lgpp1x/simple\_django\_models\_explanation/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button
\#django
/r/djangolearning
https://redd.it/1lgps31
Reddit
From the django community on Reddit: Simple Django Models Explanation
Posted by Severe_Tangerine6706 - 4 votes and 3 comments
Python + Django + HID DigitalPersona 4500: Biometric Registration & MySQL Integration
https://youtu.be/fB23Sdu5n2c
/r/django
https://redd.it/1nl9zlq
https://youtu.be/fB23Sdu5n2c
/r/django
https://redd.it/1nl9zlq
YouTube
Python Django Biometric Registration with HID DigitalPersona 4500 | Save Fingerprints to MySQL DB
In this video, I demonstrate Biometric Registration in a Python Django Application using the HID DigitalPersona 4500 Fingerprint Scanner. You will see How to Capture Person Details, perform Fingerprint Enrollment and then Save both the Personal Data and Biometric…