Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Getting this error : FOREIGN KEY constraint failed in my django application
I have created a BaseUser model to create users and i have also created a Profile for every single user when new user gets created. But when i try to update the information's or try to delete the specific user from the admin panel i get this error :- [12/Jan/2024 15:05:29] "GET /admin/accounts/baseuser/16/change/ HTTP/1.1" 200 17895 [12/Jan/2024 15:05:30] "GET /static/admin/js/jquery.init.js HTTP/1.1" 200 347 Not Found: /favicon.ico Internal Server Error: /admin/accounts/baseuser/16/change/ Traceback (most recent call last): File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 313, in _commit return self.connection.commit() sqlite3.IntegrityError: FOREIGN KEY constraint failed The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 688, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapper_view response = view_func(request, *args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/views/decorators/cache.py", line 62, in _wrapper_view_func response = view_func(request, *args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 242, in inner return view(request, *args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1889, in change_view return self.changeform_view(request, object_id, form_url, extra_context) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/utils/decorators.py", line 46, in _wrapper return bound_method(*args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/utils/decorators.py", line 134, in _wrapper_view response = view_func(request, *args, **kwargs) File "/home/mohit/okk/django_pinterest/myenv/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1747, … -
what are some of the best Resources for Learning and making projects?
I was searching for some great resources for learning React, DSA, and Django all with some bigger Projects. I tried youtubeing but some only are good, if I get someone explaining better on youtube its also fine. other resource like udemy courses are also fine. -
FullCalendar I have the standard event model working, how do I add a dropdown to select additional data in the Javascript/Ajax area?
The events in the FullCalendar are just using fields: name, start and end as in the html-> $(document).ready(function () { var calendar = $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, events: '/list_events', selectable: true, selectHelper: true, editable: true, eventLimit: true, businessHours: true, select: function (start, end) { let title = prompt("Enter Event Title"); if (title) { var start = prompt("enter start", $.fullCalendar.formatDate(start, "Y-MM-DD HH:mm:ss")); var end = prompt("enter end", $.fullCalendar.formatDate(end, "Y-MM-DD HH:mm:ss")); $.ajax({ type: "GET", url: '/add_event', data: {'title': title, 'start': start, 'end': end}, dataType: "json", success: function (data) { calendar.fullCalendar('refetchEvents'); alert("Added Successfully"); }, error: function (data) { alert('There is a problem!!!'); } }); } }, Question: I would like the function to collect additional data such as status, venue and instructor, where status is a selection, and venue and instructor are DB lookups from Django event model My Event model: class Event(models.Model): name = models.CharField('Event Name', max_length=120) status = models.CharField(choices=EventStatus, default=EventStatus.PENDING, max_length=25) start = models.DateTimeField('start', default="2024-01-01 00:00:00") end = models.DateTimeField('end', default="2024-01-01 00:00:00") venue = models.ForeignKey(Venue, blank=True, null=True, on_delete=models.PROTECT) instructor = models.ForeignKey(Consultant, blank=True, null=True, on_delete=models.PROTECT) # 'name', 'start', 'end', 'venue', 'contact', 'instructor' def __str__(self): return self.name I see there are many code snippets and examples online, … -
when i export with the command flutter build app it generates complex javascript codes but i want only HTML,CSS , Javascript codes, is it Possible?
when i export with the command flutter build web it generates complex javascript codes , but i want only HTML,CSS and Javascript codes . is it Possible ? i have intended to make the front end with flutter and the back with django after exporting , but it is generating complex JS codes i cant get HTML tags and CSS styling , please help me if you have any idea i have tried with flutter build web but it is generating complex javascript codes -
Why do I need to configure volumes for running Django and MySQL in Docker containers?
I had a Django project with a MySQL database running on localhost and I wanted to migrate it to Docker containers. First I migrated the database. I didn't have any problems and I could connect to it from my Django project perfectly. However, when I migrated the Django project to another container, I couldn't connect it to the database. I would always get the following error: django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)") I tried all sorts of solutions and nothing worked. I was using the following docker-compose configuration: version: '3.9' services: my-db: build: ./localhost-db container_name: my-db ports: - 3306:3306 volumes: - my-db-vol:/var/lib/mysql my-server: build: . container_name: my-server ports: - 8000:8000 command: python3 manage.py runserver 0.0.0.0:8000 depends_on: - my-db volumes: my-db-vol: external: true Then I came across this blog post: https://dev.to/foadlind/dockerizing-a-django-mysql-project-g4m Following the configuration in the post, I changed my docker-compose file to: version: '3.9' services: my-db: build: ./localhost-db container_name: my-db ports: - 3306:3306 volumes: - /tmp/app/mysqld:/var/run/mysqld - my-db-vol:/var/lib/mysql my-server: build: . container_name: my-server ports: - 8000:8000 command: python3 manage.py runserver 0.0.0.0:8000 volumes: - /tmp/app/mysqld:/run/mysqld depends_on: - my-db volumes: my-db-vol: external: true Now everything works perfectly, but I can't figure out why adding /tmp/app/mysqld:/var/run/mysqld to … -
2 Django services with common Model
I'm developing some project that needs to be split into two separate Django services, but with one common database (and some of their own for each service). I know that I can provide the database as not default in both applications in settings.py. I know that I can create db_router in both services. I know there may not be the best architecture here. I know that I can make one of this services as "client" which requests another for some operations. But are these all possible solutions? What is the best practice? -
why update is not working when customising the save() in the modle class?
class Person(models.Model): SHIRT_SIZES = [ ("S", "Small"), ("M", "Medium"), ("L", "Large"), ] first_name = models.CharField("person's first name:", max_length = 30, help_text = "User First name") last_name = models.CharField("Person's Last Name:",max_length = 30, help_text = "User Last name") shirt_size = models.CharField(max_length=1, choices=SHIRT_SIZES, default = "S", help_text = "User shirt size") def __str__(self) -> str: return self.first_name + ' ' + self.last_name def full_name(self): return '%s %s' %(self.first_name, self.last_name) def get_absolute_url(self): return "/people/%i/" % self.id; def save(self, *args, **kwargs): self.first_name = "%s %s" %('Mr', self.first_name) return super().save(self, *args, **kwargs) Creating a new record is working fine but it's generating an error when updating the existing record. IntegrityError at /admin/members/person/14/change/ UNIQUE constraint failed: members_person.id Request Method: POST Request URL: http://127.0.0.1:8000/admin/members/person/14/change/ Django Version: 3.2.23 Exception Type: IntegrityError Exception Value: UNIQUE constraint failed: members_person.id Exception Location: C:\wamp\www\python\myproject\lib\site-packages\django\db\backends\sqlite3\base.py, line 423, in execute Python Executable: C:\wamp\www\python\myproject\Scripts\python.exe Python Version: 3.6.6 Python Path: ['C:\\wamp\\www\\python\\vleproject', 'C:\\wamp\\www\\python\\myproject\\Scripts\\python36.zip', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\DLLs', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64\\lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python36_64', 'C:\\wamp\\www\\python\\myproject', 'C:\\wamp\\www\\python\\myproject\\lib\\site-packages'] Server time: Fri, 12 Jan 2024 13:11:09 +0000 -
Django not updating latest date on form and website?
I'm doing a website using Django, it's hosted on AWS (EC2 with gunicorn for Django server, S3 + cluodfront for static files). I'm doing tests on several days before deployment, but I have an issue : the data on the website seems to not be updated when new values are coming. For exemple on one page : I have an insight with a total "files" value (each days, there are more files so the number is growing) I have a form with a date range (min and max date from the database) I have a div with a max date insight. The server is running for 3 days and the max date is the same as the first day (09/01), same for the insight : value for the 09/01. I've tried to set up a cache that's updated every day. Surprisingly, the update seems to work: if I print the cached value, it's correct and shows the last day, but on the website, nothing updates. The form always displays the maximum date as 09/01 and the insight seems to be frozen. How to solve this problem? In settings.py DEBUG is False. Here are the contents (shortened with the elements concerned) … -
Sorting data / refresh page with new query - Django5 ListView
I am trying to perform a query on the same page using Django. After selecting data from the dropdown and clicking the button, the information should be filtered accordingly. However, I couldn't find a solution to get the data after selecting from my dropdown and will refresh the page using Django. Is this possible? Here's my views.py class DocListView(ListView): model = Document template_name = 'docs/documents.html' paginate_by = 5 context_object_name = 'doc_list' def get_queryset(self): return Document.objects.all() -
Issue with Azure "django_auth_adfs" and Django built in Token Authentication (IsAdminUser)
I have a Django web app with built in Django Rest Framework. I would like to use the Api via Powershell script to update/create data on the database. The Web application will be accessed by users and they will authenticate via Microsoft login. Currently the authentication works fine, but I'm not able to post to database via Powershell using the token that I created within the Django Admin Portal (Admin User). I get a 401 UNAUTHORIZED. I can confirm the token is generated using Super user account. The api works when I remove permission_classes = [IsAdminUser] from the DRF Create View. When I don't exempt the API url and tries to Post it take me to Microsoft login page and if I exempt the url , I get an authorized call error. In short please guide me on how I can do a post request to a specific endpoint without logging or providing credentials, but just using token. I want to user Azure Authentication in conjunction with Django DRF token authentication. This the guide I referred for ADFS authentication - https://django-auth-adfs.readthedocs.io/en/latest/install.html Below is my settings.py from pathlib import Path import os BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-xxxx' DEBUG = True … -
Django unit test issue with thread and database interaction : database is being accessed by other users
I have a Django project with the following View : def base_task(): # do something def heavy_task(): # do something with interaction with a PostgreSQL database class MyView(generics.UpdateAPIView): def update(self, request, *args, **kwargs): message_to_return, heavy_task_needed = base_task() if heavy_task_needed thread = Thread(target=heavy_task) thread.start() return JsonResponse(message_to_return, status=201) This code returns a response to the client as fast as possible, and start some heavy processing on another thread. I have some unit tests for this code : class EndpointsTestCase(TestCase): fixtures = ["segment.json", "raw_user.json"] def test_1(self): c = Client() body = { #some data } response = c.put( path=f"/my/endpoint/", data=json.dumps(body), content_type="application/json", ) expected_body = to_json_comparable({ #some data }) self.assertEqual(response.content, expected_body) def test_2(self): c = Client() body = { #some data } response = c.put( path=f"/my/endpoint/", data=json.dumps(body), content_type="application/json", ) expected_body = to_json_comparable({ #some data }) self.assertEqual(response.content, expected_body) The issue I have is that, if multiple test cases trigger the heavy_task thread, my tests fail with this error : django.db.utils.OperationalError: database "my_db" is being accessed by other users DETAIL: There are X other sessions using the database. Likely due to the fact that a new test has been started before the thread of the previous test has terminated. How can I solve this issue, as … -
phone number and password not storing in the django admin
Hello I was trying to make a project and the phone number and password from the signup page is not storing but other things like name email are being registered.I tried checking it so many times but could not figure it out ` customer model `from django.db import models from django.core.validators import MinLengthValidator class Customer(models.Model): first_name = models.CharField(max_length=50, null=True) last_name = models.CharField(max_length=50, null=True) phone = models.CharField(max_length=15, null=True) email = models.EmailField(default="",null=True) password = models.CharField(max_length=500,null=True) def register(self): self.save() @staticmethod def get_customer_by_email(email): try: return Customer.objects.get(email=email) except: return False def isExists(self): if Customer.objects.filter(email = self.email): return True return False` views \`from django.shortcuts import render, redirect from django.http import HttpResponse from .models.product import Product from .models.category import Category from .models.customer import Customer def signup(request): if request.method == 'GET': return render(request, 'core/signup.html') else: postData = request.POST first_name = postData.get('firstname') last_name = postData.get('lastname') phone = postData.get('phone') email= postData.get('email') password =postData.get('password' ) customer= Customer(first_name= first_name, last_name= last_name, phone=phone, email=email, password= password) customer.register() return redirect('core:homepage') -
How to translate default Django admin panel to another language?
I use the default Django admin panel with jazzmin. I need the entire admin panel to be completely in Turkmen language. As far as I know, it is not supported in Django yet. How can I translate the entire admin panel to Turkmen? I tried to include these: from django.contrib import admin admin.site.index_title = "SmartLib" admin.site.site_header = "SmartLib Dolandyryş" admin.site.site_title = "Dolandyryş" But it is not enough. I need to translate everything. I also tried makemessages and compilemessages but they didn't generate .po files from the admin panel. -
Google Cloud Storage URL stripped from deployed build/index.html in Django/React on Google Cloud Run (GCR)
Here's the situation. I deploy a Django/React app to Google Cloud Run (GCR) with Docker and static files served over Google Cloud Storage (bucket) Everything is fine except a thing I haven't managed to figure out and I did so many trials that it's impossible to tell my attempts. I'm pretty sure the bucket and GCR service accounts are correct and have sufficient permissions. All necessary API's are activated. The command python manage.py collectstatic run in entrypoint.sh works and the files are uploaded correctly to the bucket. Also, I am totally new to this coming from a "classic" Full Stack PHP/MySQL/JS development environment. Here's the issue. When I run npm run build the /build/index.html shows the correct url to the static files (js/css) like so: src="https://storage.googleapis.com/my-app-bucket/staticfiles/static/js/main.xxx.js" When deployed it "strips" the main url part leaving /staticfiles/static/js/main.xxx.js and so it tries to call the files with the app url like so https://default-xxxxx.a.run.app/staticfiles/static/js/main.xxx.js which of course produces a 404. How can I tell my app to get these files from the bucket? Here are the commands I use to deploy: gcloud builds submit --tag us-east1-docker.pkg.dev/my-app/mbd-docker-repo/mbd-docker-image:my-tag and gcloud run deploy default-my-gcr-service \ --image us-east1-docker.pkg.dev/my-app/mbd-docker-repo/mbd-docker-image:my-tag \ --add-cloudsql-instances my-app:us-south1:my-app-db \ --set-secrets=INSTANCE_CONNECTION_NAME=INSTANCE_CONNECTION_NAME:1 \ --set-secrets=INSTANCE_UNIX_SOCKET=INSTANCE_UNIX_SOCKET:1 \ --set-secrets=DB_NAME=DB_NAME:3 … -
Check if the id is present in the JsonField(list) passed to OutRef during Django subquery filtering
If I have 2 models related through a JsonField(list),I am annotating a queryset of Foos with bars in this list class Foo(Model): bar_list = models.JSONField(default=list) class Bar(Model): id = IntegerField() bar_query = Bar.objects.filter(id__in=OuterRef('bar_list')).values("id")[:1] foos_with_bar_id = Foo.objects.all().annotate(task_id=Subquery(bar_query)) but it doesn't work. I get a error"django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near..." But when i relplace the "OuterRef" to a specified list, like[1,2,3], It works. So does OuterRef not support JsonField? -
what's (page = DEFAULT_PAGE) role in CustomPagination by DRF (django-rest-framework)?
For some reason, I could not understand the meaning and role of page=DEFAULT_PAGE in Custom Pagination in the DRF topic. Can you explain its role to me in the code below? Consider - pagination.py: from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response DEFAULT_PAGE = 9 DEFAULT_PAGE_SIZE = 9 class CustomPagination(PageNumberPagination): page = DEFAULT_PAGE page_size = DEFAULT_PAGE_SIZE page_size_query_param = 'page_size' def get_paginated_response(self, data): return Response({ 'links': { 'next': self.get_next_link(), 'previous': self.get_previous_link() }, 'total': self.page.paginator.count, 'page': int(self.request.GET.get('page', DEFAULT_PAGE)), # can not set default = self.page 'page_size': int(self.request.GET.get('page_size', self.page_size)), 'results': data }) Note : This is important to me for setting up my app and I wanted to understand its role... Although I consulted the documentation, I didn't understand much about the role of page=PAGE_DEFAULT. -
override save for model so only one value is possible
I want to handle a unique condition on the save method of the model: class Car(models.Model): fuel = models.CharField("type of gasoline", max_length=256, null=True, blank=True) charger = models.CharField("loading plug type", max_length=256, null=True, blank=True) def save(self, *args, **kwargs): if self.charger: self.fuel = None elif self.fuel: self.charger = None super().save(*args, **kwargs) Desired behavior: When loading a Car instance and setting fuel="diesel" I want charger=None set automatically on save(). -
What is another way to implement apple sign-in in a django API project without creating an apple developer profile?
Apple bills $99 to create a developer profile. Is there a way to override that step in implementing apple sign-in in my django project ? I tried implementing apple sign in and was expecting to create a free developer profile but unfortunately, I was asked to pay the sum of $99 -
Django numerical RangeField (for SQLite)
After reading the docs for custom model fields of Django 5.0 I'm not sure if or how it's possible to create a ModelField that resembles a range between two numerical (integer) values, since I can only serialize into a single db_column, not into two (min of range, max of range column). Am I wrong? Is there a possibility I don't see? I know for PostgreSQL there are different RangeFields available. -
Dj-rest-auth "CSRF Failed: CSRF token missing"
When I am trying to post data using my dj-rest-auth api http://localhost:8000/dj-rest-auth/login/ it gives this error CSRF Failed: CSRF token missing. How do I fix this as I am unable to find the CSRF value to put into headers. Where can I actually find this value. This is my settings for dj-rest-auth in views.py REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', 'dj_rest_auth.jwt_auth.JWTCookieAuthentication', ), } REST_AUTH = { 'USE_JWT': True, 'JWT_AUTH_COOKIE': 'jwt-auth', } EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' SITE_ID = 1 ACCOUNT_EMAIL_REQUIRED = False ACCOUNT_AUTHENTICATION_METHOD = 'username' ACCOUNT_EMAIL_VERIFICATION = 'optional' AUTHENTICATION_BACKENDS = [ # Needed to login by username in Django admin, regardless of `allauth` 'django.contrib.auth.backends.ModelBackend', # `allauth` specific authentication methods, such as login by email 'allauth.account.auth_backends.AuthenticationBackend', ] Tried sending a get request to this api but the method isn't allowed Tried putting the csrf value of localhost:8000 in my headers which I got from mozilla firefox in the storage/cookies section. But it said the csrf value is incorrect. -
How to handle - Error in save method in Django Model
This is my model: class Sale2021(models.Model): Id = models.AutoField(primary_key=True) cust_name = models.CharField(max_length=120) class= models.CharField(max_length=120) cust_id = models.CharField(max_length=120) branch_desc = models.CharField(max_length=120) cust_desc = models.CharField(max_length=120) month_year = models.CharField(max_length=120) distance_in_kms = models.CharField(max_length=120) def save(self, *args, **kwargs): # Use the get_or_create method with your unique identifier(s) obj, created = Sale2021.objects.get_or_create( cust_id=self.cust_id, month_year=self.month_year, defaults={ 'cust_name ':self.cust_name, 'class':self.class, 'cust_id ':self.cust_id, 'branch_desc':self.branch_desc, 'cust_desc':self.cust_desc, 'distance_in_kms':self.distance_in_kms, }) if created: # If the object is newly created, save it as usual super(Sale2021, self).save(*args, **kwargs) else: # If the object already exists, update its fields obj.cust_name=self.cust_name obj.class=self.class obj.cust_id=self.cust_id obj.branch_desc=self.branch_desc obj.cust_desc=self.cust_desc obj.month_year=self.month_year obj.distance_in_kms=self.distance_in_kms obj.save() I want if the customer adds a new row in the database, I want to check where there is a row with same cust_id and month_year fields. If yes, then update the existing row, else create one. When I trying to add a new row, I'm getting this error: RecursionError at /admin/home/sale2021/add/ maximum recursion depth exceeded Request Method: POST Request URL: http://127.0.0.1:8000/admin/home/sale2021/add/ Django Version: 5.0 Exception Type: RecursionError Exception Value: maximum recursion depth exceeded Exception Location: C:\Users\Dell\AppData\Local\Programs\Python\Python312\Lib\copyreg.py, line 99, in __newobj__ Raised during: django.contrib.admin.options.add_view Python Executable: C:\Users\Dell\AppData\Local\Programs\Python\Python312\python.exe Python Version: 3.12.1 Python Path: ['C:\\Users\\Dell\\Desktop\\KESORAM\\12-01-2024\\dj_web\\dj_web', 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip', 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python312\\DLLs', 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python312\\Lib', 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python312', 'C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages'] Server time: Fri, 12 Jan 2024 06:44:58 +0000 This line … -
Does not log in to the account through the socialaccount in Django allauth
Does not log in to the account through the socialaccount, although the message appears 'Successfully signed in as ' ({% if user.is_authenticated %} is False, user is AnonymousUser). Everything is configured according to the instructions in the documentation. Simple accounts (via login and password) are logged in ({% if user.is_authenticated %} is True). I've tried different providers, different ways to add keys, and used settings that could have an impact. But nothing helped. Please help me understand how to set up allauth so that logging in only through the social account is carried out. -
How to align each new post next to each other?
I am working on this blog and I want to whenever a user makes a new post it gets displayed next to the others not under them but I don't know what should I do so far I have these cards but they keeps being displayed under each other if I need to post another part of my code please let me know I appreciate the help I want it to be something like this post.html {% extends "online_shop/base.html" %} {% load static %} {% block content %} {% for post in posts %} <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div style="margin-top: 35px;"></div> <div class="card-deck" style="max-width: 300px;"> <div class="card row"> <img class="card-img-top" src="{% static 'online_shop/unicorn-cake-14.jpg'%}" alt="Card image cap" width="300" height="310"> <div class="card-body"> <h2><a class="article-title" href="#">{{ post.title }}</a></h2> <p class="card-text">{{ post.content }}</p> {{ post.content|truncatewords_html:15 }} </div> <div class="card-footer"> <small class="text-muted"><a href="#">{{ post.author }}</a></small> <small class="text-muted" style="margin-left: 5px;">{{ post.date_posted|date:"F d, Y" }}</small> </div> </div> </div> </body> {% endfor %} {% endblock content %} -
is there a way to upload multiple large image files to GCS in django admin?
I'm attempting to upload multiple image files to a Google Cloud Storage bucket simultaneously through the django admin interface, 14 image files totaling up to 175mb. They are contained in one model with multiple imagefields. I'm using django-storages to connect django to gcs. I'm not able to increase the upload timeout past the 10 minute mark, and I have to stay inside the django admin interface. My project lead suggested that there might be a way to split the POST request into multiple smaller requests to circumnavigate the timeout, but I can't find any documentation on how to do such a thing inside django admin. Clicking 'save' creates a POST request that takes over 10 minutes, which is long enough to give me a 413 error. I'm using google app engine as a back-end. When I use the local test server, it all uploads as intended. It takes a little while but not ten minutes. If I save after changing one or two images at a time it uploads successfully. -
Inapp mail service django and reactjs
I am making some school management system in django and reactjs ,I want help in making inmail system so that teacher can send notice/attachment to the student of his/her class at once and it will be oneway communication. I wanted to build this but don't have any idea what technology to be use in django . If anyone know the approach than please reply Thanks