I'm running a Django site on my computer and I want to access it from another device on the same Wi-Fi network (for example, from a phone or another laptop). I tried running python manage.py runserver, but I can only …
I have a Django project configured with PyCharm. I am using a conda env for packages installations. I have installed gdal. But when I run server, I see: django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal310", "gdal309", "gdal308", "gdal307", …
При вводе команды 'python manage.py collectstatic' в командную строку в Visual Studio 2022 выводится ошибка: 'You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.' Вроде как путь указан криво. А он указан вроде нормально, …
I have a selenium web scrapper, that runs well in my local development environment even in headless mode. However when i deploy it in production in a Linode Ubuntu VPS, somehow it fails with a Timeout exceeded message.Any help would …
Simple question here about django_stubs_ext. Shouldn't the monkey patching occur only during TYPE_CHECKING ? Something like this: # settings.py if TYPE_CHECKING: import django_stubs_ext django_stubs_ext.monkeypatch()
Something went wrong :-( Something went wrong while trying to load this site; please try again later. Debugging tips If this is your site, and you just reloaded it, then the problem might simply be that it hasn't loaded up …
I'm building a Visitor Management System (VMS), and I've been given a complete frontend to work with. My task is to build the API-based backend using Django and Django REST Framework, which I'm familiar with from smaller projects. However, I'm …
I'm running into an issue and would appreciate some pointers. I have a production Django app where I included Google Analytics using a context processor and conditionally render it in my base.html template like this: <!-- Google Analytics --> …
Can anyone tell me how I can deploy my Django React-based webapp in my shared hosting
I'm working on a Django project using GeoDjango for spatial models. I'm on Windows 10, using a Conda environment (moodspend). When I try to run the server with: python manage.py runserver I get this error: (moodspend) PS C:\Users\ngari\Desktop\Ngari's Projects\moodspend\backend> …
Доброго времени суток! Я в Джанго новичок. Возможно ли такое организовать? Необходимо вывести три поля на форму, сделать по ним отбор, затем выбрать какое-то значение и записать его в тот набор, который получился в результате отбора? По одному полю нужно …
Good day! I have a model table. And a form. I filter the query from the queryset model by certain criteria and send it to the code in views. From the filtered queryset I would like to take only one …
If I have, for example: from django.contrib.postgres.fields import JSONField class MyModel(models.Model): data = JSONField() GIVEN a model instance obj1, where data == ['apple', 'banana', 'orange'] GIVEN a model instance obj2, where data == ['banana', 'orange'] GIVEN a model instance …
I have a page where user creates an instance. An instance has a bunch of characteristics and foreign key to product (which has category and name itself) and all the fields are static - just stylized selects and inputs, but …
Good day! I have a table model. I plan to take one row from it - one set of elements. To place it in an object - a dictionary. How can I place the last or first or a specific …
I'm running a Django server which has API's I consume through a React Native and React applications. I want it to work for Google, Facebook, Instagram and Twitter. For this question I want to focus on the React Application and …
I created sitemap using django default sitemap from django.contrib.sitemaps.views import sitemap Here is the complete process #urls.py sitemaps = { 'static': StaticViewSitemap, 'blogpost_detail': BlogSitemap, 'portfolio-details': PortfolioSitemap, # Add others like 'posts': PostSitemap if needed } path( "sitemap.xml", sitemap, …
My project's admin site was working earlier with everything kept at default. But I'm building the site and after lots of coding I get an error where it is asking for a template that has the name of the project. …
If I'm not wrong, currently there are two ways to have connection pooling in Django: Native Connection Pooling (Django 5.x) Using PGBouncer I want to know that how connection pooling works behind the scene in Django. In FastAPI, …
I have two table models. I write data to one of them using a form. I also want to write data to the other model table using a form. But I'm trying to link these tables. Use the first one …
Anyone using Django + Gunicorn + Gevent + Opentelemetry in production? Would love to know how you got it to work. Seems like I can't seem to use BatchSpanProcessor or BatchLogRecordProcessor. I'm getting errors which seem to have many open …
I am implementing permission-roles in Django using DRF but not sure where i got stuck here Here are models: class User(): class Staff() user = models.ForeignKey( User, on_delete=models.CASCADE, related_name="staffs") business = models.ForeignKey( "Business", on_delete=models.CASCADE, related_name="staffs" ) role = models.PositiveSmallIntegerField (superadmin, …
I've been trying to make the final test pass. I seem to be getting a 403 error, nothing that I'm not authorized to make a post. Even though I gave the test user authorization to post tests. I don't understand …
I'm trying to prevent users from creating more than one Mining object within a 24-hour period in my Django project. I chose to use Django signals, specifically the pre_save signal, to enforce this rule globally—regardless of whether the object is …
I've been trying a basic string to Django backend from frontend using axios.post call. Connection is ensured and backend side detects the request but the data is empty. Frontend side: const axios = Axios.create({ baseURL: API_URL, headers: { 'Content-Type': 'application/json', …
I am using allauth in my Django project and I have set up a custom account adapter which I have specified in settings.py - ACCOUNT_ADAPTER. My issue is once the user logs in in at a URL like /accounts/login/?next=/checkout/, my …
Не работают ссылки, хотя вроде всё прописано верно. В файле urls.py: from django.urls import path from . import views urlpatterns = [ path ('', views.reg, name = 'Reg_page'), path ('about/', views.about, name = 'About') ] В файле views.py: def …
Here is my forms.py code: from .models import User class userRegistrationForm(forms.ModelForm): password = forms.CharField(widget = forms.PasswordInput()) confirm_password = forms.CharField(widget = forms.PasswordInput()) class Meta: model = User fields = ['first_name', 'last_name', 'username', 'email','password'] ``` Here is my views.py code: …
Никак не могу понять - с какой стороны подойти к такой задаче: В базу надо записывать данные с определенной периодичностью. Как в Джанго реализованы фоновые задачи, выполняемые по расписанию? В идеале было бы хорошо создать внутри скрипт и заполнять данными …
To give some context, i made a async function which works fine when testing manually but when I use Django's testcases, the query is not returning anything back inside the async block, if I try the same query outside, it …
I creating a website using django. I want to add extra functionality to model creation and changing pages in standard admin site, that is input text field and button. Idea is to paste a link to post on another website …
I'm building a marketplace app (think classified ads with negotiations) and trying to implement a personalized recommendation feed. I have a hybrid architecture question about the best way to handle this: Current Setup: Django backend with PostgreSQL for product …
I am new to django and currently learning and i have encountered a problem that i just cant seem to solve. from django.shortcuts import render, redirect from django.contrib import messages from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm from django.contrib.auth.decorators import login_required …
I'm building a Django web app where users can upload images to detect objects using a YOLO ensemble model saved as a .pt file. This model includes keys like 'model', 'names', 'stride', and 'ensemble_info'. So far, I can load the …
I’m implementing payments with Stripe and I’ve run into a flow I don’t know how to solve. I’d like to know the right or recommended way. Scenario First payment with UI: The user goes to my frontend, I use …
I have created a StreamField for some of the site's settings. This StreamField contains a collection of a custom StructBlock, named FacetBlock. FacetBlock contains a BooleanBlock, a CharBlock, an IntegerBlock and a ChoiceBlock. Now I need to make the CharBlock …
I have a model Table which gets a new entry every few seconds, so it's a quite big table. class Table(models.Model): id: int pk: int timestamp = models.PositiveBigIntegerField(db_index=True) Now what i am trying to do is get …
I've been trying to implement the paginator function for about two months now. I've tried many different approaches, but they always lead to new bugs. In views.py, I load the posts and send them to JavaScript. In loadPosts and loadProfile, …
We are seeing a ~6-second delay when a Celery task is triggered via the Django UI (e.g., my_task.delay()). Our stack runs on Kubernetes, and I'm wondering if this lag is due to resource constraints or something else. Key Services and …
I'm hosting a Django project on a shared server using cPanel, and I’ve been running into a frustrating issue lately. On several pages across the site, I get a 500 Internal Server Error. After checking Sentry, I consistently see this …