Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to use Google OAuth in django to authorize user emails from specific domain without creating a new user?
I am creating an ERP for my college and need to provide google's authentication as the source for login. Our college mails are being managed by google so I need to make sure that only college employees and students are able to access it via college's email which looks something like 'user@iiitdmj.ac.in'. And as we already have a database for the users with all their details, I want to add the google account to corresponding user in the database. Any suggestions on how can I achieve this? -
CSS Link Static Page
Before you mark this as a duplicate, I have indeed already looked at the django forums, tutorials, etc. I have a blog I made with Django, the blog's index page template needs to have a css stylesheet that I have linked in my static folder. (Folder Tree attached attached). In the html for the template I have the following code: {% load static %} <link rel="stylesheet" type="text/css" href="{% static 'blog/style.css' %}" /> Why is this not working! Thanks! -
How to compile TeX file from Python
I'm trying to create a pdf file inside a python/django project. I'm using PyLatex, which helps, but it's generate_pdf method breaks when it calls pdflatex. I keep getting this error: FileNotFoundError: [Errno 2] No such file or directory: 'pdflatex' I tried everything - os.system() ... subprocess. Any way I try, it can't find pdflatex. I'm running on Windows, but I need to be able to to do this within the web-app anyway. Thanks for any help! -
Django CSRF cookie not set by JS post request
I'm trying to build client/server system as follows: server is django REST with some database, client is static HTML/CSS/JS built as separate django project. I've got stuck with a basic user authentication scheme processed via simple login form on client side. My idea was to go for token authentication, token to be stored in client's localStorage - so that's why I've taken approach to handle the form submit and POST for token to server by JS. The issue is I cannot get the token from server to client due to Forbidden (CSRF cookie not set.): /getToken/ error on the server side. Spent tons of time on it and I cannot find answer why CSRF cookie is not set as I enforce at least 4 mechanisms forcing the cookie set: 1) {% csrf_token %}, 2) manual setting of cookie header, 3) @ensure_csrf_cookie, 4) removing 'django.middleware.csrf.CsrfViewMiddleware', from MIDDLEWARE_CLASSES in server settings.py ... Here are the details: The client part looks as follows: login.html form: <form name="login" method="POST"> {% csrf_token %} Username<input type="text" name="uname"/> Password<input type="password" name="psswd"/> <input type="button" onclick="do_login(this.form)" value="Login"/> <input type="reset" value="Reset"/> </form> where do_login() is in the script below. Pls mind the {% csrf_token %} is included ... login_script.js : … -
Where Django's cookie based session data is stored?
I am using Django's signed cookie engine for storing session data. My settings are: SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies' SESSION_EXPIRE_AT_BROWSER_CLOSE = False SESSION_COOKIE_NAME = 'sessionid' And it works as it should. Even after closing browser and web server when I visit the website, I am still logged in. I can see the sessionid being set but I can't seem to find where session data is stored. I am storing entire user object in session. -
Django:not able to fetch values of attributes email,message in modal form on click of button in dynamically created table
I have a table that is dynamically created based on leaves submitted in which the manager needs to approve,reject the leaves.On click of approval button a modal opens with a form in it containing 2 fields message->textarea and notify-->checkbox.On click of submit button the values are caught in jquery and sent to views. But I find the values written in message textarea is returning value sometimes for a employee and sometimes null and the same with notify checkbox is returning true sometimes and false sometimes even it is checked. template.html <td> <!-- for accepting --> <button type="button" class="btn btn-default btn-sm" data-toggle="modal" data-target="#{{pl.id}}_1"><i class="fa fa-check" aria-hidden="true" style="color:green"></i></button> <!-- Modal --> <div class="modal fade" id= "{{pl.id}}_1" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">Do You want to accept <b>{{pl.employee.emp_name|title }} </b> leave?</h4> </div> <form action={% url 'm_manage:accept' %} method="POST"> {% csrf_token %} <div class="modal-body" > <p><input type="checkbox" name="email" id="email"> Notify Via Email<br></p> <p><label for="message">Message </label> <textarea rows="3" name="message" id="message" class="form-control input-md"></textarea></p> </div> <div class="modal-footer" id="{{pl.id}}"> <button type="button" class="btn btn-success" id="accept" data-dismiss="modal" >Accept</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </form> </div> </div> </div> Jquery call: $(document).on('click','#accept', function(e){ e.preventDefault(); var v_id=$(this).closest('div').attr('id'); // tried msg var msg=$('#message').val(); … -
How to log request timing, django multithreading?
I am not able to log the request and their queue timings in Python. I am using django. How to log the request timing and queue timing in django, multithreading? -
Django + Postfix + Gmail + openDKIM -avamis > dkim = neutral (body hash did not verify)
I have followed this tutorial to configure DKIM and Postfix on Debian 7 wheezy. These instructions are pretty much a standard on the interwebz. I am using Gmail to send and receive emails using my own domain. I followed this instructions to achieve that. My problem I can send and receive emails but I can't manage to pass the DKIM test (at least with Gmail). After searching and struggling for a while I have come to the conclusion that the reason of my woes is that my message is getting multiple DKIM signatures (see mail.log below). And this, according to the DKIM directives is enough for the DKIM to fail. But after reading about on how to solve the multiple signatures problem I found that absolutely all of these solutions refer to having 'amavis' installed. Thing is...I don't have it installed! In any case these solutions mention changing postfix configurations related to the milters in master.cnf and/or main.cfn. For example, adding this to the 'receive_override_options' (again, I don't have that variable since I don't have amavis installed) should solve the issue: receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters Or, another solution is commenting global settings in main.cf... #smtpd_milters = inet:localhost:12301 #non_smtpd_milters = inet:localhost:12301 ...And then adding … -
Accessing assets from a folder different than /static/ (Django project)
For a Django project I'm developing, the static folder's contents is mapped onto a CDN. I recently added self-hosted fonts to /static/css/fonts/. This doesn't work because cross-site access isn't allowed for self-hosted fonts. I get the error: `downloadable font: download failed (font-family: "droid_arabic_naskh" style:normal weight:normal stretch:normal src index:1): bad URI or cross-site access not allowed source: http://mysite.azureedge.net/css/fonts/droidnaskh-regular-webfont.woff2/woff/ttf` One way around is to use the CORS option (Cross Origin Resource Sharing). That enables a web application running under one domain to access resources in another domain. However, my question is - can I map the /fonts/ folder to any other location - apart from static - and access the fonts? If so, then a natural question is: how can one access a location other than STATIC_URL in a Django template? An illustrative example would be nice. -
Django read/write serializer for recursive many-to-many relationship with through field
So I have a model representing an "Assembly", where one assembly can have any number of sub-assemblies, and for each sub-assembly, it specifies how many instances of that sub-assembly it contains. For example, A contains 1 B and 2 C's, while B contains 1 D, C contains nothing, and D contains nothing. I've represented this in the model like so: from django.db import models class Assembly(models.Model): guid = models.CharField(max_length=40, unique=True, primary_key=True) subassemblies = models.ManyToManyField('self', blank=True, symmetrical=False, through='AssemblyLink', through_fields=('parent', 'child')) class AssemblyLink(models.Model): parent = models.ForeignKey(Assembly, on_delete=models.CASCADE, related_name='child_link_set') child = models.ForeignKey(Assembly, on_delete=models.CASCADE, related_name='parent_link_set') count = models.PositiveSmallIntegerField() # Small means <32k and this seems to work, but what I can't figure out is how to write the serializer such that it can read JSON to create a model, and turn the model back into JSON. I'd like to be able to read JSON that looks like: { "guid": "GUID123", "subassemblies": [ {"child": "GUID1234", "count": 1} ] } although this format is flexible. Right now my AssemblySerializer looks like this: class AssemblySerializer(serializers.ModelSerializer): subassemblies = ... class Meta: model = Assembly fields = ('guid', 'subassemblies') How should I fill in the ... to make this work? -
How to create an object and then set related field in Django Rest Framework
I'm trying to create a new object using Django REST Framework's ModelViewSet and the ModelSerializer and associate an existing object to it's ForeignKey field. I have two models with a one-to-many relationship, basically a manufacturer and a product. The manufacturer already exists in the database and I'm trying to add a product individually and assign it's manufacturer at the same time. When I do, DRF is giving me this error: "non_field_errors": [ "Invalid data. Expected a dictionary, but got Product." ] Here are what my models look like (I've tried to take out the unneeded code to keep it small). When a product is created the manufacturer field is an integer representing the ID of it's related object. As you can see in my view, I query for the Manufacturer object, set it and then continue to let DRF create the object. If someone can please tell me where I'm going wrong, I'd greatly appreciate it! models.py class Manufacturer(models.Model): name = models.CharField(max_length=64) state = models.CharField(max_length=2) class Product(models.Model): manufacturer = models.ForeignKey(Manufacturer, related_name="products") name = models.CharField(max_length=64) sku = models.CharField(max_length=12) views.py class ProductViewSet(view sets.ModelViewSet): model = Product permission_classes = [IsAuthenticated] def get_queryset(self): # get logged in user's manufacturer return Product.objects.filter(manufacturer=manufacturer) def create(self, request, … -
deploying django project on aws elastick beanstalk
getting an error while deploying the Django project to aws server. I have tried upgrading pip but it is not working. also in aws documentation, any changes done in ssh terminal will get revert if it`s not in the file format. I have tried going through a bunch of solutions given on StackOverflow and blogs. but the solutions are bit old and aws console keep updating in short period of time. this error is not getting solved by. updating pip manually in ec2-ssh. updating .config files adding activity.log file Retrieving logs... ============= i-021263909933668a2 ============== ------------------------------------- /opt/python/log/supervisord.log ------------------------------------- 2017-08-24 13:15:24,774 CRIT Supervisor running as root (no user in config file) 2017-08-24 13:15:24,784 INFO RPC interface 'supervisor' initialized 2017-08-24 13:15:24,784 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2017-08-24 13:15:24,784 INFO supervisord started with pid 2943 2017-08-24 13:15:25,786 INFO spawned: 'httpd' with pid 3034 2017-08-24 13:15:26,873 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-08-24 14:08:40,855 INFO stopped: httpd (exit status 0) 2017-08-24 14:08:41,860 INFO spawned: 'httpd' with pid 5088 2017-08-24 14:08:42,888 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) ------------------------------------- /var/log/httpd/error_log ------------------------------------- [Thu Aug … -
Passing "request.user" value from views.py to template file
I am trying to use the value of request.user in templates file. I am passing that value as context from views.py file. form.html - login <form method = "POST" action="{% url 'home' %}"> **<--This is where views.py of home app is called** {% csrf_token %} {{ form|linebreaks }} <input type="submit" class='btn-btn-default' value="{{ button_value }}" /> </form> views.py - home def home_view(request): uname = request.user return render(request,"home/index.html",{{ 'uname' : uname }}) index.html - home <body> {% csrf_token %} <h4>{{ uname }}</h4> </body> I am getting AnonymousUser as output instead of "user1". Please help me out. -
Django Model Foreign Key filtering
I need to filter some Models in Django and return them trough REST, but I have some difficulties. I have 4 Models connected with Foreign key's like so: class Standort(models.Model): name = models.CharField(max_length=40) farbe = models.CharField(max_length=20, default="Black") class Gruppe(models.Model): standort = models.ForeignKey(Standort) name = models.CharField(max_length=40) class Person(models.Model): name = models.CharField(max_length=40) gruppe = models.ForeignKey(Gruppe, related_name='personen') class Eintrag(models.Model): person = models.ForeignKey(Person, related_name='eintrage') typ = models.ForeignKey(Typ) datum = models.DateField() and Iam serializing them like so: class EintragSerializer(serializers.ModelSerializer): class Meta: model = Eintrag fields = ('datum', 'typ') class PersonenSerializer(serializers.ModelSerializer): eintrage = EintragSerializer(read_only=True, many=True) class Meta(object): model = Person fields = ('id', 'name', 'eintrage') class GruppenPersonenEintraegeSerializer(serializers.ModelSerializer): personen = PersonenSerializer(read_only=True, many=True) class Meta(object): model = Gruppe fields = ('id', 'name', 'personnel') and my view looks like this: class GruppenPersonenEintraege(APIView): def get(self, request, standort, jahr): gruppen = Gruppe.objects.filter(standort=standort) serializer = GruppenPersonenEintraegeSerializer(gruppen, many=True) return Response(serializer.data) The result looks like this: [ { "id": 2, "name": "2.Schicht", "personen": [ { "id": 1, "name": "Rolf der Tester", "eintrage": [ { "datum": "2017-02-16", "typ": 3 }, { "datum": "2017-02-15", "typ": 3 }, { "datum": "2018-04-05", "typ": 2 } ] } ] }, { "id": 3, "name": "Test", "personen": [] } ] This is totally fine, my Problem is when i also … -
Django Data in Form Not Showing Up With POST
I currently have an UpdateView and a button to edit data in fields, but for some reason the data is not being displayed when I click my edit button. It shows a bunch of empty fields unless I go to the address bar and press enter, basically requesting the same page. Then all the data shows up. Doesn't work when I click Edit, works when I press enter in address bar: /inventory/update/7/ views.py class ProductUpdate(UpdateView): model = Product fields = [ 'manufacturer', 'part_number', 'description', 'vendor', 'upc', 'stock_quantity', 'unit_cost', 'sale_price', ] urls.py # /inventory/update/<pk> url(r'update/(?P<pk>[0-9]+)/$', views.ProductUpdate.as_view(), name='product-update'), index.html <div class="col-sm-6"> <ul class="list-group"> {% for product in all_products %} <li class="list-group-item"> <a href="{% url 'inventory:product_detail' product.id %}"><span style="font-size: 1.6em;">{{ product.manufacturer }}: {{ product.part_number }}</span></a> <form action="{% url 'inventory:product-delete' product.id %}" method="post" style="display: inline"> {% csrf_token %} <button type="submit" class="btn btn-danger btn-sm float-right" style="margin-left: 10px; margin-top: 4px;">Delete</button> </form> <form action="{% url 'inventory:product-update' product.id %}" method="post" style="display: inline"> {% csrf_token %} <button type="submit" class="btn btn-warning btn-sm float-right" style="margin-top: 4px;">Edit</button> </form> </li> {% endfor %} </ul> </div> If I change the update form method to GET instead of POSTthen it works when I click the button, but my address bar shows up like this. /inventory/update/7/?csrfmiddlewaretoken=34WWjKDIDsNpZdmEmef9cr3tCoCO0V7jO3uks5qXFzSVKu1uAklqUA3ihaGBGaRK … -
Adding comment in django in blogging site post
This is model in this the commentmodel is to be connnected to the user and the postmodel so that it can be interlinked during reading post. from django.db import models from django.contrib.auth.models import User class sighinmodel(models.Model): relateduser = models.ForeignKey(User,on_delete=models.CASCADE,default=None) fullname = models.CharField(max_length=100,blank=False,null=False) def __str__(self): return self.fullname class postmodel(models.Model): title = models.CharField(max_length=100) author = models.ForeignKey(User,default=None) body=models.TextField() subject=models.TextField() timestamp = models.DateTimeField(auto_now_add=True,auto_now=False) updated = models.DateTimeField(auto_now=True,auto_now_add=False) def __str__(self): return self.title #return '%s %s' %(self.title,self.author) class commentmodel(models.Model): commentauthor = models.ForeignKey(User,default=None) comments = models.TextField(default="") def __str__(self): return self.comments this is read post: def postread_view(request): title1 = "view post" if request.POST: form = commentform(request.POST) if form.is_valid(): comment = form.cleaned_data["comment"] instance = commentmodel.objects.create(commentauthor=request.user,commentpost=request.post,comments=comment) instance.save() form = commentform() instance = postmodel.objects.order_by('-updated') return render(request, "postread.html", {"instance":instance,"form":form,"title": title1}) this is Html {% extends "base.html" %} {% load static %} {% load bootstrap %} {% load crispy_forms_tags %} <html> <head> <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" media="screen"> </head> <body> {% block baseclass %} <div class="container "> <div class="jumbotron"> <h1>Daily blog</h1> </div> <div class="row"> <div class="col-sm-2 "> </div> <div class="col-sm-8"> <h2>{{ title }}</h2> {% for r in instance %} <div> <hr> <h2>Title:{{ r.title }}</h2> <h3>by {{ r.author }}</h3> <hr> <span class="glyphicon glyphicon-time"> Created on: {{ r.timestamp }} Last update on: {{ r.updated }} … -
git push heroku master error, fatal repository
Got an error when trying to deploy a django web app to heroku using the command $ git push heroku master Here is the error given after I type that command: mysite lateefa$ git push heroku master remote: ! No such app as vast-spire-40247. fatal: repository 'https://git.heroku.com/vast-spire-40247.git/' not found Any suggestions on how to fix this issue? -
Azure web app with python and pip wheel installations
I've been trying to install certain python packages to my Django Web App on Azure. I'm trying to install the packages using the requirements.txt and pips wheel files, as is instructed here https://blogs.msdn.microsoft.com/azureossds/2015/06/29/install-native-python-modules-on-azure-web-apps-api-apps/ The problem is that pip does not seem to locate the wheelhouse folder. The wheelhouse folder is located at the root of my app directory, where I'm also keeping the requirements.txt, manage.py, readme.md and the web.config files. Here's what my requirements.txt file looks like: --find-links wheelhouse django<2 pyodbc==4.0.17 django-pyodbc-azure==1.11.0 Here're the files in wheelhouse folder: ~/myapp/wheelhouse/django_pyodbc_azure-1.11.0.0-py2.py3-none-any.whl ~/myapp/wheelhouse/Django-1.11.4-py2.py3-none-any.whl ~/myapp/wheelhouse/pyodbc-4.0.17-cp27-cp27m-win_amd64.whl ~/myapp/wheelhouse/pyodbc-4.0.17-cp27-cp27m-win32.whl I've downloaded the pyodbc .whl files from here:http://www.lfd.uci.edu/~gohlke/pythonlibs/ The django_pyodbc_azure-1.11.0.0-py2.py3-none-any.whl file was created by using a windows laptop with the windows c++ compiler for python installed (https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266) When pushing the commits to the server I still Counting objects: 7, done. Delta compression using up to 4 threads. Compressing objects: 100% (7/7), done. Writing objects: 100% (7/7), 730 bytes | 0 bytes/s, done. Total 7 (delta 3), reused 0 (delta 0) remote: Updating branch 'master'. remote: ...................................................................... remote: Updating submodules. remote: Preparing deployment for commit id '7feb3f4dde'. remote: Generating deployment script. remote: Running deployment command... remote: Handling python deployment. remote: Detected requirements.txt. You can skip Python specific steps with … -
Generate PDF of Protected Django Webpage with Attachments
So I'm trying to generate a PDF of a view that I have in a django web application. This view is protected, meaning the user has to be logged in and have specific permission to view the page. I also have some attachments (stored in the database as FileFields) that I would like to append to the end of the PDF. I've read most of the posts I could find on how to generate PDFs from a webpage using pdfkit or reportlab, but all of them fail for me for some reason or another. Currently, the closest I've gotten is successfully generating a PDF of the page using pdfkit, but this requires me to remove the restrictions that require the user to be logged in and have page permissions, which really isn't an option long term. I found a couple posts that discuss printing pdfs on protected pages and providing login information, but I couldn't get any of that to work. I haven't found anything on how to include attachments, and don't really know where to start with that. I'm more than happy to update this question with more information or snippets of code if need be, but there's quite … -
Django-python3-ldap - only certain active directory user groups can login?
I'm using the django-python3-ldap module located here https://github.com/etianen/django-python3-ldap#available-settings I only want users who are a member of certain groups to be able to login, so I have created a function as suggested def app_users(ldap_fields): # Add in simple filters. ldap_fields["memberOf"] = "foo" # Call the base format callable. search_filters = format_search_filters(ldap_fields) # Advanced: apply custom LDAP filter logic. search_filters.append("(|(memberOf=App_Admin)(memberOf=App_ITUser)(memberOf=App_NetworkUser))") # All done! return search_filters however this returns the below then debugging File "/itapp/itapp/ldap_filters.py" in app_users 5. search_filters = format_search_filters("(|(memberOf=App_Admin)(memberOf=App_ITUser)(memberOf=App_NetworkUser)))") File "/usr/local/lib/python3.6/site-packages/django_python3_ldap/utils.py" in format_search_filters 123. in ldap_fields.items() Exception Type: AttributeError at /login/ Exception Value: 'str' object has no attribute 'items' I think its something to do with with the foo sample but I'm not sure how to fix it Thanks -
Problems installing MySQL-python on Linux AMI
When I try to install MySQL-python library with PIP (sudo /usr/local/bin/pip install MySQL-python) it returns this error: Collecting MySQL-python==1.2.5 Using cached MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: sh: mysql_config: command not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-fhec7G/MySQL-python/setup.py", line 17, in <module> metadata, options = get_config() File "setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found I read all the different solutions about this problem, so I tried with sudo yum install python-devel sudo yum install mysql mysql-devel mysql-common mysql-libs sudo yum install mysql-devel python-devel MySQL-python sudo /usr/local/bin/pip install MySQL-python and this is my $PATH environment variable: /usr/local/bin:/bin:/usr/bin:/usr/local/sbin: /usr/sbin:/sbin:/opt/aws/bin:/home ec2-user/.local/bin: /home/ec2-user/bin:/usr/lib64/mysql:/usr/bin/mysql: /usr/bin:/usr/sbin/mysqld so it contains the directories for mysql (/usr/bin/mysql), mysqld (/usr/sbin/mysqld) and mysql_config (/usr/lib64/mysql). I repeat that I'm running an Amazon AMI instance, so I have not the possibility to install libraries such as libmysqlclient-dev, but it should not to be a problem. Thank you to everyone would give me an hand! -
Django - Modifying Multiple Records Indirectly
I'm working on a Django project and am relatively new to it and only have a limited knowledge currently. In my project I need a form in which I can edit multiple employee records at once. However due to the nature of the problem the option that needs to be on the form does not directly correspond to a model field. The model field is in fact an integer, that depending on the selection should be incremented, set to zero, or kept the same. I suspect this is somewhere where formsets could come in useful but currently am unsure, any advice or pointers towards what a solution could be would be much appreciated. Thanks -
Django admin 403 csrf error
I'm getting csrf token error for django admin. My infra is, 1 load balancer (set to roundrobin) and 3 nodes (running django application in these servers). My django application is an API backend for a mobile app. By enabling 'Session Stickiness' in loadbalancer will fix the django admin issue. But it will affect the load balancing. Is anyone suggest me a way to fix the 403 error without enabling the 'Session Stickiness' ? Thanks in advance! -
set a inside loop value input hidden in the template
i pass two variables named hotel and rooms in context (view), to a template. The hotel variable allways have only one hotel (called with hotel id). The rooms variable is a list that i pass with rooms related with the hotel. For example i have one hotel with two rooms. In the template i obtain the hotel like this {{ hotel.id }}. I iterate the rooms and i obtain the value like this {{ room.id }}. Each room for example has two forms where the client select the qty of room desired and these forms, have to have input hiddens with the hotel value, room value, policy value, etc. to send by post. The form has only one visible input (the qty). How can i give the correct value inside a loop to the input hiddens. I do this way, but i think it is no practical. {% for field in form %} {% if field.name == 'hotel'%}<input type="hidden" name="hotel" value="{{ hotel.id }}">{% endif %} {% if field.name == 'room'%}<input type="hidden" name="hotel" value="{{ room.id }}">{% endif %} and this way with all the inputs i need. How can i do this other way? -
django CSV upload, add column, store to S3
Python beginner here. I am writing a python django application that requires a CSV upload file. After upload, the file should be given an additional column and then it should be stored on amazon S3 environment. I managed to create a form to upload a csv file directly to amazon s3 with this tutorial: https://simpleisbetterthancomplex.com/tutorial/2017/08/01/how-to-setup-amazon-s3-in-a-django-project.html I have different problems: The upload is currently a synchronous task, and it should be an asynchronous task, leaving my django web worker free for other users. now the web app is blocked during upload. What would be the best set-up? asynchronous upload to s3 (task 1) > download csv file from s3 inside a worker (task 2) > create new file inside worker task and add column (task 2 continued) > write the modified task to s3 (task 2 continued) OR just in one single task asynchronous upload to worker environment > add column > write to s3 I have celery running, can add code to the queue and it executes correctly. I don't now how to get started on passing the upload to the celery queue and don't know how to decide on which approach for uploading the file (directly to s3 and …