I try to customize drf_social_oauth2 with drf simple-jwt I use core.models instead of standard social_oauth2 models, but got 500 status code, error "AttributeError: Manager isn't available; 'oauth2_provider.Application' has been swapped for 'core.Application'" My files: settings.py INSTALLED_APPS = [ ... 'oauth2_provider', …
I’m working on a Django nested formset where users can: Add multiple colors to a product. For each color, add multiple sizes dynamically using JavaScript. Each size should have its own size_name, stock, and price_increment field. …
The Problem Django's admin sidebar filters show all options without pagination, which becomes unwieldy when you have hundreds of related objects: By Study • All • Study-001: Genetic markers in mice • Study-002: Effects of caffeine ... • Study-999: Soil …
I have the style.css in the root static folder. When I browse the page or the css file directly in browser, it shows a 404 error. This the folder structure: …
I'm using Django Debug Toolbar in my development environment, and it's been very helpful for debugging. However, I want to disable it when rendering a specific template. Is there a way to conditionally disable the debug toolbar for certain views …
Problem Statement I am working on a Django formset where users can dynamically add/remove colors, sizes, and images when adding a product. The structure of my formset is as follows: A product can have multiple colors. Each color can …
This is my first time developing a multi-tenant SaaS application in Django, in this SaaS each company has its own PostgreSQL database, and these databases are created dynamically when a company registers. I cannot predefine all databases in settings.DATABASES, as …
I have a frontend app written in react I have a backend application which is a django server. On top of that I am working with a 3rd party True Layer (Open Banking API) The first thing I want to …
Does Django automatically recognize templates/registration/login.html as the login page? I'm working on a Django project and want to use Django's built-in authentication system for user login. I didn't set path to /login in urls.py but it's working on url/accounts/login/?next=/. My …
How can I run the ASGI and WSGI protocols separately in my Django project? This is my project structure. . ├── chat # <== my app name │ ├── apps.py │ ├── consumers.py │ ├── __init__.py │ ├── migrations │ …
I have this ajax call $.ajaxSetup({ data: {txtSearch: $('#txtSearch').val(), prefilter: $('#prefilter').val(),csrfmiddlewaretoken: '{{ csrf_token }}' },}); $.ajax({ type: "POST", url: "article-filter2/", success: function (data) { $("#div_tab_search_results_contact").html(data.html_table); // working $("#div_tab_search_results_company").html(data.html_table); // not working if I call it a second time } }); …
I have a Django Project with two different apps: contact_us and booking. both are forms on different sections of the site. when the form for booking request is being sent it saves the info to the table and it is …
I deploy a Django/React project with GKE, Cloud SQL as DB, Cloud Storage for static file. When I trying upload files(both by Django admin and API), the url I get always tells me This XML file does not appear to …
I have this error message, when sending an e-mail from Django Docker container. OSError at /accounts/signup/ [Errno 99] Cannot assign requested address Request Method: POST Request URL: http://127.0.0.1:8000/accounts/signup/ Django Version: 4.0.10 Exception Type: OSError Exception Value: [Errno 99] Cannot assign …
I am trying to allow my webrtc video call meeting app have multiple peer connections and have the stream appear on the remote video call dynamically using javascript. I have only two tabs in two windows open on the video …
I have a small Django website, and I've connected OAuth 2.0. It worked just fine on localhost. (In the Google Console, the authorized redirect URIs were: URI 1: http://127.0.0.1:8000/ URI 2: http://127.0.0.1:8000/google/login/callback/) Now I …
I'm trying to email a copy of my contact form when the form is saved, but the template tags seem to be pulling the full model not just the inputs. I have no idea what I'm doing wrong here. My …
I'm facing an odd behavior on one of my applications. So I have an application that has an POST entrypoint that receives a list of order id's and after processing each order it must inform an external API about the …
In my application, when a user registers, they are identified as either a lecturer or a student. These are categorised as auth_groups, and users are assigned to one with these methods... def register_student(self, data): user = User.objects.create( user_id = …
I am working on a Django project where I dynamically add new languages via an API. The workflow is as follows: Add a new language via the API (http://localhost:8000/core/swagger/). Via API /generate/ Generate the .mo and .po files after …
I've been trying to set up my first Django and PostgreSQL project with Docker containers. I followed this setup and everything went as expected: https://learndjango.com/tutorials/django-docker-and-postgresql-tutorial Opening my Django admin portal worked without any issues on: <a href="http://127.0.0.1:8000/admin/" …
Hi I get error while i'm trying to run my application on heroku with Spatialite: Unable to load the SpatiaLite library extension. Library names tried: mod_spatialite.so, mod_spatialite. my settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # 'ENGINE':'django.contrib.gis.db.backends.postgis', # 'ENGINE': …
The page preview in the Wagtail admin is working fine locally on my dev server, but in production, the preview is not displayed, just a spinning wheel. In the Chrome dev tools console, I see the error message: Uncaught SecurityError: …
I have a Model form that has some checkboxes. The database has values for these records for all rows. My form displays with empty checkboxes all the time. I can submit values via the checkbox and the database updates correctly, …
I deployed a Django app in an Ec2 with gunicorn and nginx but links generated by django are http instead of HTTPS. I have included the necessary settings. For example, when I have paginations, I got count": 12, "next": "http://my.example.com/article/?page=2", …
I have a Django application (A), and one of my clients wants to embed it within their application (B) using an iframe. The client application can be built with any framework, and we have no control over its code. Additionally, …
Делаю пагинацию на основе класса Listview. При нажатии на любую кнопку - "Следующая страница", "1 2 3" меня редиректит на главную страницу "home". Может кто ни будь сможет объяснить почему это происходит? Не прошу писать за меня код, просто объясните …
So, I have a form data with the corresponding JSON format project_status: 'OPEN', project_title: '', project_code: '', start_date: '', end_date: '', duration: '', engagement_year: '', financial_year: '', project_budget: '', domain: '', project_type: '', project_mou: null, other_docs: null, thirdAgencyDetails: { …
Пишу код с помощью vscode на django. В шаблоне есть тег В этот тег нужно добавить атрибут(свойство) enctype='multipart/form-data'. Так вот когда в пайчарм пытаешся добавить атрибут(свойство) он тебе подсказывает и название атрибута(свойства) и значение. Vscode вообще отказывается показывать подсказки по …
I have a Booking model where users can book a restaurant table for a specific date and time. However, I want to ensure that multiple users cannot book the same table at the same time. Here’s my model: class Booking(TimeStampWithCreatorModel, …
I am trying to createa mock Request for a post method in django rest framework and tried: factory = APIRequestFactory() data = {"hello": 1} print(data) django_request = factory.post(url, data, format="json") print("body:", django_request.body) print("ct:", django_request.content_type) r = Request(django_request) print(r.data) The …
In my Django5 app everything works fine in development under venv but once I load the application into a Docker container with Debug=False I don't seem to get my CSS rendered properly. Whats really wierd is the CSS loading appears …
I created a calendar with dates where appointments can be made. I then created a form to select appointments. I want each time an appointment is made, it to be grayed out for the exact day and time it was …
Hi I have a django project (4.2.2) and when I start the project from the terminal inside VS Code using "python3 manage.py runserver" everything works perfectly. But I want to debug it so I created a launch.json file to start …
I'm in a position where I would like to submit content to a form that is not defined in a Forms class. For example, in my forms.py: class AnalyseForm(forms.Form): TYPES = (('a', 'Type A'),('b', 'Type B'), ('c', 'Type C')) filename …
При вводе пароля и при повторном вводе пароля пишет что это поле не может быть пустым и не создаётся ничего, хотя пароли я ввожу нормально и они уверен совпадают
Пытаюсь реализовать простой поиск данных на сайте. Если в шаблоне "search_results.html" указываем тег a, то вся информация, которая в нём находятся не отображается, в случае же если убрать тег a, то всё работает, почему так может происходить? То есть - …
I am building a large real estate file management system using Django API. I have created a separate app for media handling, and in my model, I want to enforce the following limits: A single featured image A gallery with …
Base.html <!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> {% load static %} <title>{% block title %}Мой сайт рецептов{% endblock %}</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="stylesheet" href="{% static …
I'm working with Django REST Framework and trying to create an API endpoint that returns live match details along with their associated scores. I have two models, Match and Score, where Score has is associated with Match with a foreignkey. …