I have been facing many issue regarding installation django on windows using pip. i have used "pip install django". But I am unable run the command "django-admin startproject myproject" it is showing following error: 'django-admin' is not recognized as an …
Can someone help me configure my django channel app in order for me to be able to test the chatting feature between two users. They must use two different devices and chat over a wifi network Looking through the net …
Front end (React) and Back end (Django) are working on the local server and are sending information to the user, but the Front end code has been updated and the local server is working, but the users still see the …
I'am building application in django and tailwind css to asking legal questions. I created user in django admin panel, created views etc. But after login(it is success 200 status), it doesn't work. I can't redirect user after login to user …
I wrote middleware to catch requests and view them on admin page. It successfully views raw text request body, but fails on image render. admin.py class RequestLogEntryAdmin(admin.ModelAdmin): fieldsets = ( ('Request', { 'fields': ('request_headers', 'request_size', 'request_body_'), }) ) def request_body_(self, …
I want to write custom filter with drop down field using admin_searchable_dropdown I tried two ways too implement this and got error both times first way: the custom filter class PrimaryLabelFilter(AutocompleteFilter): field_name = 'primary_label' title = …
I have two dataframe set called df1 and df2. I need to create a view in django template to compare these two dataframe in side by side. It should be looks like the git like comparison like below. <a href="https://i.sstatic.net/G3BWnWQE.png" …
I am writing a webapp in Python and Django. I use weasyprint to write pdf documents and I would like to use write_png() to get a png thumbnail of each pdf. This is from my views.py: pdf_letter = …
Upon sending requests to the dockerized Django app through the API gateway layer using the container name (svc_payment_dev), I faced an issue indicating that the domain name provided is not valid acoarding to RFC 1034/1035 I know that underscores are …
Am using following nginx conf file : server { listen 80; server_name domain; # Redirect HTTP to HTTPS return 301 https://$host$request_uri; } server { listen 443 ssl; server_name localhost; ssl_certificate /etc/nginx/cert/ddomain.crt; ssl_certificate_key /etc/nginx/cert/domain.key; location / { proxy_pass http://0.0.0.0:8000; proxy_set_header Host …
I am a newbie to nginx and run into a problem: nginx response with 403 Forbidden when I request example.com/media/ and all files inside the media folder. I am creating web application with python using Django Rest Framework. Here is …
As we know, we don't have access to Django CSRFToken in React by default, So we have to get it somehow. The solution was make a URL for receive CSRFToken in Response-Headers and set csrftoken cookie in browser. So I …
I have implemented database routing in django. I am creating tables in two different database using database routing in django. The issue is app name is appended in database table name. I am using prosgreSql database. I tried to mention …
I tried disabling the dark mode in my base.css like bulma describes in their docs by adding the @media lines: @media (prefers-color-scheme: light) { :root { } } body { display: flex; min-height: 100vh; flex-direction: column; } ... This …
I'm integrating Okta SAML2 authentication into my React + Django application. However, despite not encountering any errors, when I attempt to access https://org.okta.com/app/org_lighthousedev_1/exk14dabkz9lmSTEq0x8/sso/saml, it redirects me to https://dev-lighthouse.corporate.org.com/accounts/login/?next=/sso/saml/ instead of completing the SAML authentication …
I keep getting this error in logout.html in django everytime i go to it. Here is the code for the logout.html: <form method="post" action="{% url 'logout' %}"> {% csrf_token %} <button type="submit">logout</button></form> here is my views.py code: from django.shortcuts import …
I have a Django project running on an Ubuntu 22.04 server with Nginx and Gunicorn. After updating the project on my local server, I attempted to transfer it to my cloud server. Using FileZilla, I copied the new files to …
I need to add custom file upload handler in admin add and change view (using django 3.2). And getting an error. So far I created custom FileUploadHandler and trying to add to request in my ModelAdmin. Created class in my …
This is the token api of drf jwt. It is giving me 200 but in response it is saying me failed to load data I tried the code in locally it is running in the postman and …
I am having an issue with my project. I have everything working in my Django project, when the DEBUG=True in settings.py. But as soon as I change it to False, I get this issue when I go to my website …
During deep debuging i found that simple .get triggers FOUR queries: kwargs['context']['user'] = models.Person.objects.get( pk=16879 ) And postgresql.log prints this: 2024-05-08 10:21:07.913 CEST [3987190] party@partytest LOG: statement: SELECT "structure_persondata"."id", "structure_persondata"."created_at", "structure_persondata"."updated_at", "structure_persondata"."person_id", "structure_persondata"."first_name", "structure_persondata"."middle_name", "structure_persondata"."last_name", "structure_persondata"."pesel", "structure_persondata"."validity_range" FROM …
I could not serve the Django-admin's static files... I think.. It can't not recognize the reverse-proxy path. the location /static/admin/ Literally, The Django static folder is in upstream django server. There is nginx.conf and the inside docker container with django. …
I have a problem with runserver on PowerShell. entries_detail.html: <article> <h2>{{ entry.date_created|date:'Y-m-d H:i' }}</h2> <h3>{{ entry.title }}</h3> <p>{{ entry.content }}</p> </article> entries_list.html: {% for entry in entry_list %} <article> <h2 class="{{ entry.date_created|date:'l' }}"> {{ entry.date_created|date:'Y-m-d …
I am building an algotrading platform, i have access to broker apis and websockets, but i dont know how to connect to broker websocket and consume the data on realtime basis in django I have setup channels: #consumers.py class ChatConsumer(WebsocketConsumer): …
I had django-debug-toolbar working fine in my application until I added htmx. Now I'm getting Another profiling tool is already active error. The page loads then htmx fires on load …
I'm facing an issue with my Django projects that have a similar structure. Each project has a backend folder containing a docker-compose.yml and Dockerfile. The structure is as follows: project1/backend/docker-compose.yml project2.backend/docker-compose.yml The problem arises when I switch between projects …
I have Django models hierarchy class Workspace(Model): title = CharField() class User(Model): workspace = ForeignKey(to=Workspace) class Chat(Model): user = ForeignKey(to=User) In Django admin at Chats page i want to filter them by workspace, but there are many workspaces, so …
I have been trying to connect Django with SQL server but there are errors occurring continuously no matter what I try. For example DATABASES = { 'default': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'xxxxx', 'USER': 'xxxx', 'PASSWORD': 'xxxx', 'HOST': 'xxxxx', 'PORT': '1433', …
I'm following this DJANGO Rest Framework tutorial: https://www.youtube.com/watch?v=eA4H3p95hbM&list=PLmDLs7JbXWNjr5vyJhfGu69sowgIUl8z5&index=4 After modifying in 'urls.py', then type "python manage.py migrate" I get this error: from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls' (F:\Learning HTML and CSS\DJANGO_DAVE …
Pip install validate email Collecting validate Using cached validate-1.0.1.tar.gz (32 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: …
I am trying to sum the hours user spent per day. I wanted to convert this into whole number or decimal (e.g. 2, 6.5) hrs, to easily plot this to my chart. But the result of below code is in …
Suppose I have two models: class One(models.Model): name = models.CharField(max_length=300, unique=True) class Two(models.Model): name = models.CharField(max_length=300, unique=True) They are not related by a foreign key, and there are reasons to leave it that way in this project. …
I have been working on a project where my client wants me to load some csv files data into the database and he wants me to use Postgresql. The problem is that sqlite has a physical database stored in django …
I am trying to add more information to a form dropdown built using Django forms. A basic explanation of the program is: The user logs in The user can create 'decks' that are to be displayed on the 'game_tracking' …
I have created a django web app with CRUD functionality, i want to be able to see the users (With their names) that have posted on the form and see a full list of the data they post along with …
I used int:observatory_id to provide a special number for each pages without any special typos and mistakes and i have this error Reverse for 'observatory' with arguments '('',)' not found. 1 pattern(s) tried: ['observatorys/(?P<observatory_id>[0-9]+)\Z'] here is my code : urls.py …
I have a working multitenancy app in Django with isolated databases that currently uses a subdomain for each tenant and threading. The subdomain prefix is used to make a connection to the corresponding database, so: client1.mysite.com access the database …
I need to write some scripts for django and trying to set up the DJANGO_SETTINGS_MODULE environment variable at the beginning of each script. The scripts, manage.py and myproject directory are in the same parent directory. Additionally, settings.py file is in …
Проблема с отображением списка в форме при выборе города: JavaScript и AJAX не обновляют содержимое. Как исправить? Есть функция по оформлению заказа (create_order), которая обрабатывает форму. В форме есть поле (country) - город. Задумка такая, хочу чтобы пользователь выбирал …
Im struggling with same problem for 3 days now, im trying to make my finish project which is some kind of online servicebook for cars we own, i have models vehicle, workshop, filter, servicerecord and i cant add servicerecord to …