Questions & Answers

45
votes
1
answers
1854
views

How to add HTTPS to Django with Nginx

I need to enable HTTPS for my Django site. How do I configure SSL?
devops_guru Gold asked 1 week, 2 days ago
31
votes
1
answers
1803
views

How to implement Django file uploads

I need users to upload files. How do I handle file uploads in Django?
web_developer Platinum asked 1 week, 2 days ago
34
votes
1
answers
72
views

How to add search functionality to Django

I want to add a search feature to find articles by title or content.
ahmed_tech Platinum asked 1 week, 2 days ago
47
votes
1
answers
842
views

How to implement Django user registration

I need to add user registration to my Django site. What is the best approach?
fatima_dev Silver asked 1 week, 2 days ago
6
votes
1
answers
911
views

How to serve Django static files in production

My static files work in development but not in production. How do I fix this?
ahmed_tech Platinum asked 1 week, 2 days ago
2
votes
1
answers
1536
views

How to create PostgreSQL database and user

I need to set up a new PostgreSQL database for my Django project.
ahmed_tech Platinum asked 1 week, 2 days ago
45
votes
1
answers
1478
views

How to configure Celery with Django

I need to run background tasks in Django. How do I set up Celery?
linux_expert Bronze asked 1 week, 2 days ago
31
votes
1
answers
1628
views

How to use Django signals

How can I run code automatically when a model is saved or deleted?
web_developer Platinum asked 1 week, 2 days ago
43
votes
1
answers
82
views

How to create Django forms

What is the difference between Form and ModelForm in Django?
noor_code Gold asked 1 week, 2 days ago
27
votes
1
answers
1587
views

How to create Django model relationships

How do I create ForeignKey, OneToOne, and ManyToMany relationships?
python_dev Platinum asked 1 week, 2 days ago
35
votes
1
answers
393
views

How to create REST API with Django REST Framework

I want to build a REST API for my Django models. How do I use Django REST Framework?
linux_expert Bronze asked 1 week, 2 days ago
41
votes
1
answers
1533
views

How to implement user authentication in Django

I need to add login, logout, and registration functionality to my Django app. What is the best approach?
fatima_dev Silver asked 1 week, 2 days ago
23
votes
1
answers
1256
views

How to send emails in Django

I need to send email notifications from my Django app. How do I configure and send emails?
db_admin Silver asked 1 week, 2 days ago
36
votes
1
answers
847
views

How to add pagination to Django views

I have a list view with hundreds of items. How do I add pagination to show only 10 items per page?
fatima_dev Silver asked 1 week, 2 days ago
12
votes
1
answers
823
views

How to create custom Django management commands

I need to create a custom command that I can run with manage.py. How do I create one?
python_dev Platinum asked 1 week, 2 days ago
39
votes
1
answers
1732
views

CORS errors in Django REST API - complete fix

I'm getting CORS errors when my frontend tries to access my Django REST API. "Access-Control-Allow-Origin" header is missing.
python_dev Platinum asked 1 week, 2 days ago
22
votes
1
answers
72
views

How to optimize Django ORM queries for better performance

My Django application is slow. Database queries are taking forever. How can I optimize my ORM queries?
omar_linux Platinum asked 1 week, 2 days ago
43
votes
1
answers
1516
views

PostgreSQL connection refused in Django - solutions

My Django app cannot connect to PostgreSQL. I get "connection refused" error. PostgreSQL is installed and running.
fatima_dev Silver asked 1 week, 2 days ago
1
votes
1
answers
774
views

502 Bad Gateway with Nginx and Gunicorn - how to fix

I'm getting 502 Bad Gateway error when accessing my Django site through Nginx. Gunicorn seems to be running. How do I fix this?
web_developer Platinum asked 1 week, 2 days ago
40
votes
1
answers
1637
views

Django migrations not applying - troubleshooting guide

I made changes to my models but migrations are not being applied. makemigrations shows "No changes detected". What's wrong?
python_dev Platinum asked 1 week, 2 days ago