311,427 questions
4
votes
0
answers
33
views
Django static files settings
In my app I combine Django and FastAPI.
So I start my Django server this way:
from fastapi import FastAPI
from django.core.asgi import get_asgi_application
app = FastAPI()
app.mount("/dj", ...
0
votes
2
answers
48
views
How do I create a Django ListView with FormMixin?
I have a working ListView with template. I want to filter the list based on the contents of a form, something like:
class SampleListView(FormMixin, ListView):
model = Sample
paginate_by = 15
...
0
votes
0
answers
58
views
For files uploaded via Django, how can I use them with libraries that require a hard file path to the file?
I am currently working on a text extraction component of my Django backend, which intends to extract text from urls (working), pure text (working), and files (.pdf, .doc, .ppt, .md, .txt, .html).
My ...
-3
votes
0
answers
58
views
Should a single API call handle everything to make life of frontend easy, or there be as many apis as needed [closed]
So I face this issue often. Apart from being a backend python dev, I also have to handle a team consisting of frontend guys as well.
We are into SPAs, and a single page of ours sometime contain a lot ...
Advice
3
votes
7
replies
106
views
Is django backend a good choice to learn now?
I have some experience with Python, and I’m interested in backend development.
Is Django still a good choice to learn in the current job market?
I’m particularly interested in its relevance for modern ...
1
vote
1
answer
65
views
DRF unable to find existing model item in API
I am creating an API with Django Rest Framework and I keep encoutering an issue where i am unable to pull a single item from my django model on the browser.
I have two endpoints one that gets the ...
0
votes
1
answer
40
views
Django-axes seems to ignore ipware settings behind Nginx
Edit.: Ok, so this was something rather stupid on my end. I assumed that since the docs said 'Axes makes use of django-ipware package to detect the IP address of the client and uses some conservative ...
1
vote
0
answers
59
views
Django: exception in get_catalog()
I have a limited set of LANGUAGES:
LANGUAGE_CODE='sl' # It's for locals first of all
LANGUAGES=[
('sl', _('Slovene')), # First is default
('en', _('English')),
('it', _('Italian')),
('...
1
vote
1
answer
59
views
Why won't Django render its select widget with this code
I am trying to use Django's default select widget to render an html dropdown and I just can't seem to figure out what I am doing wrong...
here is my models.py
class VehicleYear(TimeStampedModel):
...
Advice
0
votes
5
replies
35
views
How to migrate data for email field
So i have a char field which i was using to store emails. Now there are some rule/validation and processes for email fields like email validation and email normalization etc. I have to add the ...
Advice
0
votes
2
replies
14
views
Disable add, edit and delete views and widgets for a custom Wagtail ViewSet index page
I have this Django model:
class Player(models.Model):
class Meta:
verbose_name = _("Player")
verbose_name_plural = _("Players")
first_name = models....
1
vote
2
answers
100
views
Django archive user if clicked for detail page view an error appears
I have this user model and in admin.py which of course is used by my client as admin page view and recently my client requested that the user/s who has been archived should not show in the active list ...
0
votes
2
answers
60
views
How can I set up a new comment string in PyCharm for fragment of DTL code in .html file?
In PyCharm we have a convinient way to turn off selected part of a code by pressing Ctrl+/. Later we can turn it on back by pressing the same key combination.
However if I am inside the HTML code the ...
-1
votes
1
answer
63
views
Designing a flexible relationships model in Django
I'm designing a small Django app, and writing some code snippets to go with the design. I have some simple models in the design, like Person and Book:
from django.db import models
class Book(models....
2
votes
1
answer
61
views
Mocked Redis counter does not increment between requests for different users
I am testing a Django view that increments recipe view counters using Redis.
The logic is:
each user can increment recipe views only once
different users should increment the counter
Redis is ...