Questions & Answers

2
votes
1
answers
25
views

Encryption

What are the best types of symtric encryption right now?
ixict1 ixict1 Newbie asked 1 week, 1 day ago
30
votes
5
answers
569
views

How can I implement Django WebSocket support with Django Channels?

I'm working on a Django project and encountering an issue with Django models. Here's my current implementation: # models.py class Article(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(User, on_delete=models.CASCADE) def save(self, …
david_web Bronze asked 1 week, 4 days ago
43
votes
5
answers
606
views

Django + React: How to handle CSRF tokens in API requests?

I'm working on a Django project and encountering an issue with Django forms. Here's my current implementation: # models.py from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio …
admin Bronze asked 1 week, 4 days ago
25
votes
3
answers
502
views

How do I set up Django with PostgreSQL and optimize database performance?

I'm working on a Django project and encountering an issue with Django authentication. Here's my current implementation: # models.py from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio …
john_doe Bronze asked 1 week, 4 days ago
43
votes
3
answers
705
views

What's the best way to implement Django + Celery for background tasks?

I'm working on a Django project and encountering an issue with Django admin. Here's my current implementation: # models.py class Article(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(User, on_delete=models.CASCADE) def save(self, …
abdullah3 Bronze asked 1 week, 4 days ago
47
votes
2
answers
47
views

How can I deploy Django applications with Docker and Docker Compose?

I'm working on a Django project and encountering an issue with Django views. Here's my current implementation: # models.py from django.db import models class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) bio …
william Newbie asked 1 week, 4 days ago
52
votes
1
answers
40
views

How do I handle Python memory leaks and optimize garbage collection?

I'm working on a Python application and running into an issue with Python debugging. Here's the problematic code: # Current implementation def fibonacci(n): if n <= 1: return n return …
admin Bronze asked 1 week, 4 days ago
27
votes
2
answers
596
views

What's the difference between Python's copy.copy() and copy.deepcopy()?

I'm working on a Python application and running into an issue with Python debugging. Here's the problematic code: # Current implementation import threading import time def worker(): global counter for …
lisa_data Bronze asked 1 week, 4 days ago
60
votes
2
answers
368
views

Python: How to implement proper unit testing with mocking and fixtures?

I'm working on a Python application and running into an issue with Python performance. Here's the problematic code: # Current implementation import threading import time def worker(): global counter for …
william Newbie asked 1 week, 4 days ago
54
votes
1
answers
671
views

How can I use Python type hints effectively without breaking compatibility?

I'm working on a Python application and running into an issue with Python concurrency. Here's the problematic code: # Current implementation class DataProcessor: def __init__(self): self.data = [] def process_large_file(self, …
lisa_data Bronze asked 1 week, 4 days ago
43
votes
5
answers
1014
views

What's the best practice for Python logging configuration in applications?

I'm working on a Python application and running into an issue with Python debugging. Here's the problematic code: # Current implementation import threading import time def worker(): global counter for …
jane_smith Bronze asked 1 week, 4 days ago
54
votes
2
answers
483
views

Python: How to handle circular imports and organize module structure?

I'm working on a Python application and running into an issue with Python debugging. Here's the problematic code: # Current implementation import threading import time def worker(): global counter for …
lisa_data Bronze asked 1 week, 4 days ago
0
votes
1
answers
763
views

How do I implement Python context managers for resource management?

I'm working on a Python application and running into an issue with Python performance. Here's the problematic code: # Current implementation class DataProcessor: def __init__(self): self.data = [] def process_large_file(self, …
abdullah3 Bronze asked 1 week, 4 days ago
40
votes
1
answers
892
views

What's the difference between Python's threading and multiprocessing modules?

I'm working on a Python application and running into an issue with Python performance. Here's the problematic code: # Current implementation def fibonacci(n): if n <= 1: return n return …
david_web Bronze asked 1 week, 4 days ago
24
votes
2
answers
34
views

How can I properly manage Python virtual environments and dependencies?

I'm working on a Python application and running into an issue with Python concurrency. Here's the problematic code: # Current implementation def fibonacci(n): if n <= 1: return n return …
emma_programmer Newbie asked 1 week, 4 days ago
30
votes
2
answers
890
views

Python: When should I use generators vs list comprehensions for memory efficiency?

I'm working on a Python application and running into an issue with Python performance. Here's the problematic code: # Current implementation def fibonacci(n): if n <= 1: return n return …
abaditaye Newbie asked 1 week, 4 days ago
50
votes
4
answers
457
views

How do I implement Python decorators with arguments and preserve function metadata?

I'm working on a Python application and running into an issue with Python optimization. Here's the problematic code: # Current implementation def fibonacci(n): if n <= 1: return n return …
jane_smith Bronze asked 1 week, 4 days ago
16
votes
5
answers
521
views

What's the proper way to handle exceptions in Python without suppressing errors?

I'm working on a Python application and running into an issue with Python debugging. Here's the problematic code: # Current implementation class DataProcessor: def __init__(self): self.data = [] def process_large_file(self, …
lisa_data Bronze asked 1 week, 4 days ago
15
votes
1
answers
655
views

How can I optimize Python code performance using profiling tools?

I'm working on a Python application and running into an issue with Python concurrency. Here's the problematic code: # Current implementation class DataProcessor: def __init__(self): self.data = [] def process_large_file(self, …
azzani Bronze asked 1 week, 4 days ago
31
votes
5
answers
557
views

Python: What's the difference between __str__ and __repr__ methods?

I'm working on a Python application and running into an issue with Python optimization. Here's the problematic code: # Current implementation class DataProcessor: def __init__(self): self.data = [] def process_large_file(self, …
michael_code Newbie asked 1 week, 4 days ago