Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django: How to add manager in the manager model
I am new to django and working on a project where admin can assign team to manager. I want to known that how can i attach that model and the manager. i mean manager are those who have is_staff status true and have some special permission that i have made for a manager. and only the name of those person should be shown to the admin whose i_staff status is true and have that special permission. And i have no Idea how can i do this. here is model of manager and views. def login(request): if request.method =='POST': # print(request.POST) username = request.POST['username'] password = request.POST['password'] user = auth.authenticate(username=username, password=password) if user is not None: auth.login(request, user) print (user.has_perm('app.edit_task')) # return redirect('index') if user.is_superuser: return redirect('master') # elif user.has_perm('app.edit_task'): # return redirect('manager') elif user.is_staff: return redirect('manager') else: return redirect('index') else: messages.error(request, 'Invalid Credentials') return redirect('login') else: return render(request, 'vadash/sign-in.html') here is my model of manager class manager(models.Model): name = models.CharField(max_length= 500) designation = models.CharField(max_length= 500) class Meta: permissions = [ ("edit_task", "can edit the task"), ] def __str__(self): return self.name I want that users who have is_staff status true and have that permission only that users should be shown in … -
Django filter by serializer method field
I cant create some logic(for me it interesting). For example i have View like this: class DucktList(generics.ListAPIView): serializer_class = DuckSerializer filter_backends = (DjangoFilterBackend,) filter_fields = ('test_field',) // i want to create some custom field and filter by it if needed. serializer: class DuckSerializer(serializers.ModelSerializer): test_field = SerializerMethodField() // i want filter by this field! def get_test_field(self, obj): return True class Meta: ...... How i can filter filter_fields with test_field ? -
How to .append() new message on websocket to page with CSS styles?
I'm having problems conceptualizing how to .append() a new message received on the WebSocket to the client-side chat box with CSS styles. Right now, I have a forloop that populates the chat box when there are objects in the ChatMessage model. {% for chat in object.chatmessage_set.all %} This obviously populates the page with sent_msg and incoming_msg only when the page is refreshed, which means that any messages received over the WebSocket (and then saved to the db) won't appear until the user refreshes the page. I am new to a lot of client-side JS / Jquery stuff so forgive me, but I want to use .append() to echo the message in the chatbox as soon as it is sent/received over the WebSocket, leading to a real-time chat feel. I've tried appending the message inside the forloop but it obviously appends to every message sent or received thus far and does not have CSS styles applied to it (the what is the appended text). If I append it outside of the forloop, it doesn't have any of the styles applied (placement etc) and appends underneath the first message sent (I know I can do prepend but that still doesn't really fix … -
MultiValueDictKeyError at /todo/todo/add/todo/
I am making an Todo app views.py from django.shortcuts import render from django.http import HttpResponseRedirect from .models import To # Create your views here. def first(request): all_items = To.objects.all() return render(request, 'todo/fi.html', {'items': all_items}) def add_todo(request): c = request.POST['content'] new_item = To(content=c) new_item.save() return HttpResponseRedirect('todo/') template: <body> <h1>Welcome to our todo page</h1> <p> Your Todo list:</p> <ul> {% for i in items %} <li> {{ i.content }} </li> {% endfor %} </ul> <form action="todo/add/" method="post"> {% csrf_token %} <input type="text" name="content"/> <input type="submit" value="add"/> </form> </body> </html> I got the following error: File "C:\python\lib\site-packages\django-1.9-py3.7.egg\django\utils\datastructures.py", line 85, in __getitem__ raise MultiValueDictKeyError(repr(key)) django.utils.datastructures.MultiValueDictKeyError: "'content'" [07/May/2019 01:35:40] "GET /todo/todo/add/todo/ HTTP/1.1" 500 70010 I have tried using get like explained in MultiValueDictError but none of that works. -
Getting a keyerror in my django code and where to add that column?
I'm new to Django so please bear with me. I'm having this error when I'm doing a python manage.py migrate Applying mailing.0002_auto_20190221_1932...Traceback (most recent call last): File "findoor_backend/manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line utility.execute() File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(*args, **cmd_options) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute output = self.handle(*args, **options) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 200, in handle fake_initial=fake_initial, File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/db/migrations/migration.py", line 112, in apply operation.state_forwards(self.app_label, project_state) File "/home/andykw/cloned_projects/findoor-backend/.venv/lib/python3.6/site-packages/django/db/migrations/operations/fields.py", line 196, in state_forwards state.models[app_label, self.model_name_lower].fields KeyError: ('mailing', 'questionanswer') Reading this answer, it seems I'm missing a column somewhere but I cannot see where. I'm not sure I have to add that in my view. This is my model class QuestionAnswer(models.Model): """Mail for answer to a question""" if site_lang == 'fr': default_subject = answered_subject_fr default_message = answered_message_fr elif site_lang == 'pl': default_subject = answered_subject_pl default_message = answered_message_pl else: default_subject = answered_subject_en default_message = answered_message_en subject = models.CharField(max_length=100, unique=True, verbose_name=_("mail subject"), default=default_subject) contents = … -
How to add public URL inside tenant navigation in django-multitenant app?
I have a multitenant Django web app. I am trying to add public URL "http://localhost:800/example/" inside the tenant navigation menu. For example, I have http://demo.localhost:800/ and it's all navigation menu is like this http://demo.localhost:800/someurl/ I want to add http://localhost:800/example/ in a tenant. I tried adding the URL in the template but as expected it gave NoReversematch error as it will look for http://demo.localhost:8000/example/ but it's not there, it's in the public URL http://localhost:8000/example/ How do I add public URL inside tenant? -
CreateView into Modal in the same page
I have the following views: class ArticleVideoCreate(CreateView): model = ArticleVideo fields = ['article', 'video', 'video_url'] and this url: path('', CatalogListView.as_view()), path('video/<int:article_id>/create', ArticleVideoCreate.as_view(), name='video-create') I'm in the ListView page. and I have a button to add an article Video: <a href="{% url 'video-create' article.sku %}" class="btn btn-primary btn-sm active" role="button" aria-pressed="true"><ion-icon name="videocam"></ion-icon></a> In my articlevideo_form.html (for create the article video, is the modal): <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Modal title</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> My problem is that when I click the button to add an ArticleVideo, django redirects me to video//create with only the modal shown. Which is the best way to show the modal of the CreateView, in the same page, using Django? And clicking create and doing all in the same page? -
Django Custom MultiWidget Retaining Old Values
I have created a simple custom MultiValueField and MultiWidget for the purpose of entering a date of birth but allowing separate entry of the day, month and year. The rationale is that the app is for entry of historical data, so one or more of these fields could be unknown. There is also a checkbox that displays 'unknown' on the user-facing site. I've found that everything works fine, except that when I save an instance of an object in the admin site and go to create a new instance, the blank admin form displays the date values from the previous entry. It looks like the field is not being reinitialised correctly, but I am not sure where this should be. I have added a workaround by checking in the form whether to reinitialise the fields, but I feel that this should be done in the custom field/widget. Sample code: class CustomDateWidget(forms.MultiWidget): """Custom MultiWidget to allow saving different date values.""" template_name = 'myapp/widgets/custom_date_widget.html' def __init__(self, attrs=None): _widgets = (forms.NumberInput(attrs=({'placeholder': 'DD'})), forms.NumberInput(attrs=({'placeholder': 'MM'})), forms.NumberInput(attrs=({'placeholder': 'YYYY'})), forms.CheckboxInput()) super().__init__(_widgets, attrs) def decompress(self, value): if value: return value else: return '', '', '', False def value_from_datadict(self, data, files, name): value_list = [ widget.value_from_datadict(data, files, name … -
How to show ajax output in a modal Django
I want to click on a button and a modal will pop up which will show information from an ajax call. The div having the class "content" from "inquiry_details.html" should show inside my modal.I cannot figure out why it isn't showing. Here are my codes: Button: <button type="button" class="btn btn-secondary btn-view-details" data-toggle="modal" href="/backend/inquiry/details/{{inquiry.id}}" data-url="/backend/inquiry/details/{{inquiry.id}}"> View Details </button> Jquery and ajax: $('button.btn-view-details').on('click', function () { var url = $(this).data('url') $('#commonModal').modal('show'); }) $.ajax({ url: "inquiry_details.html", type: 'GET', success: function (data) { $('#content').html($(data).find('#content').modal('show')); } }); Modal: <div class="modal fade" id="commonModal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> </button> </div> <div class="modal-body"> <p>.............</p> </div> <div class="modal-footer"> .......... </div> </div> </div> </div> Any help on this? -
How to split DateTime in django template?
My question may seem weird since there are so many questions telling me exaclty how to do this, even the docs show how to do this. But, for some reason I am not able to do get an output at all. Whenever I try any kind of filter, the output just disappears from the template. What I tried <td>{{ quiz.scheduled_date|date:"D d M Y" }} {{ quiz.scheduled_date|time:"H:i" }}</td> and <td>{{ quiz.scheduled_date|date}} or just <td>{{ quiz.scheduled_date}}</td> I know that I am taking the input as a DateTime and hence probably alone date or time filter will not work. I am definitely doing some minor typo error or something. This is my model: class Quiz(models.Model): scheduled_date = models.CharField(max_length=255,default=0) This is some of my sample data which is displayed when I do not use any kind of filter. 05/22/2019 3:35 PM 05/12/2019 2:35 PM This is my views.py @method_decorator([login_required, teacher_required], name='dispatch') class QuizUpdateView(UpdateView): model = Quiz fields = ( 'comments', 'truck_type', 'origin', 'destination', 'total_trucks', 'material_type', 'scheduled_date', 'offered_price', 'status') context_object_name = 'quiz' template_name = 'classroom/teachers/quiz_change_form.html' def get_context_data (self, **kwargs): kwargs['questions'] = self.get_object().questions.annotate(answers_count=Count('answers')) return super().get_context_data(**kwargs) def get_queryset (self): return self.request.user.quizzes.all() def get_success_url (self): return reverse('teachers:quiz_change_list') Edit: Will python strip date time function be of any help … -
Django reversion recovery from a web page
Is it any chance to implement recovery of the deleted model objects by django-reversion from a site web page or it works only from admin panel? I dont wait for ready solution, rather i need to know if it possible or not or maybe some advice where i need to dig to find information about how to do it. Sorry for the broad question. Thanks. -
Django: How to display some objects to specific users only
I am new to django and working on a project where admin have to assign a team to manager and when ever admin assign a team to manager then it will be shown on that manager's dashboard only.I have no idea how can i do this. Please if someone can help please help me. here is my .html file for admin from where admin can assign team to manager. <th>S No.</th> <th>COMPANY NAME</th> <th>TEAM MEMBER</th> <th>Assign TEAM</th> </tr> </thead> <tbody> {%for team in object%} <tr> <form id="form_id" method="POST" action = "{% url 'accept' %}"> {% csrf_token %} <th scope="row"> {{ forloop.counter }}</th> <td>{{team.company_name}}</td> <td>{{team.team_member}}</td> <td> <select name="manager_{{manager.id}}"> {% for manager in managers %} <option value ="{{manager.id}}">{{manager.name}}</option> {% endfor %} </select> </td> <td> <input class="btn btn-raised btn-primary btn-round waves-effect" type="submit" value="Assign"> </td> </tr> {% endfor %} here is my model for the team and manager: class Create_Team(models.Model): first_name = models.CharField(max_length= 50) last_name = models.CharField(max_length= 50) company_name = models.CharField(max_length= 100) address = models.CharField(max_length= 1000) state = models.CharField(max_length= 100) city = models.CharField(max_length= 100) status = models.CharField(max_length= 30) class manager(models.Model): name = models.CharField(max_length= 500) designation = models.CharField(max_length= 500) here is my views.py file for manager and from where the admin is accepting the request: … -
Django convert dataframe groupby into json response
I am using django and Django Pandas to convert my Django query into data frame. My database is like this: symbol price time aab 333 4444 bbb 444 555 ....... ...... And I am making a query like this: df = read_frame(qs) df2 = df.groupby(['symbol']) And I want to convert this into json response for that I have tried few things like covnerting it into dict, list but nothing is working. I want a json response like this: {symbol : aab, price : [22,332,33]}, { symbo: bbb price : [22,332,33] } .... Is there any easy way or a trick to just convert groupby into a format in which I want. I am using : return JsonResponse({'foo': type(qs)}) -
How to pre fill the values in form fields which are already in database and deliver the partial form or taking the remaining inputs
i want to make a form in which the database is queryed and prefill the fields which are already been present to that model instance id or pk. models.py class Uploads(models.Model): name = models.CharField(max_length=20,blank=True) age = models.IntegerField(blank=True) gstin = models.CharField(max_length=15,blank=False,default='xxxxxxxxxx00000') PAN = models.CharField(max_length=10,default="xxxxxxxxxx",blank=False) doc_pdf = models.FileField(upload_to='static/files',blank=True) image = models.ImageField(upload_to='static/images',blank=True) def __str__(self): return self.name forms.py [ do i have to use super().clean() in clean method?, bcoz without using super() is also working , whats the use of super() ] class Uploadform(forms.ModelForm): class Meta: model = Uploads fields ='__all__' def clean_gstin(self): gstin = self.cleaned_data.get('gstin') print(gstin) if len(gstin) != 15: raise forms.ValidationError('Input correct length of GSTIN') if gstin[:2].isdigit() == False: raise forms.ValidationError('put the 1st two digits as number') return gstin def clean_PAN(self): PAN = self.cleaned_data.get('PAN') if len(PAN) != 10: raise forms.ValidationError('input correct length') return PAN def clean(self): gst = self.cleaned_data.get('gstin') pan = self.cleaned_data.get('PAN') print(pan) print(gst) if not pan in gst: raise forms.ValidationError('worng GSTIN') views.py def uploadview_django(request , id): x= Uploads.objects.all.filter(pk = id) if x: gst = x.gstin pan = x.pan if request.method == 'POST': form = Uploadform(request.POST , request.FILES) if form.is_valid(): form.save() return redirect('index') else: form = Uploadform(gstin = gst , PAN = pan) return render(request,'form.html',{'form':form}) -
reactjs Uncaught SyntaxError: Unexpected token < with django
I am trying to deploy my django-react in azure vm. when i am using python manage.py runserver 0.0.0.0:8000 it is working fine. but, when i am using . gunicorn --bind 0.0.0.0:8000 settings.wsgi This is is showing above error in console. Please have a look -
how to print field type of a field in django models
I have made a Django project and designed a model with a field name in it name=models.CharField(max_length=250) is there a way to print CharField on the screen like using command like d=name.field() and it stores a String in d as CharField or something like this I searched but did not found anything that allowed to print CharField on screen from django.db import models as data_type class UserAttendance(data_type.Model): user=data_type.ForeignKey(UserList,on_delete=data_type.CASCADE) date=data_type.DateField() attendance=data_type.BooleanField(default=False) if I ask it as attendance.field I want it to show BooleanField as output or something like this -
How to perform additional actions on PasswordReset in Django
I'm using django-axes for the locking of account when a user tries to enter credentials that are not recognized by the system, it will lock the account. But when I do perform the password reset function using django auth package on a locked account, obviously there is no shortcut way to remove the lock of the account. Even if the password is already reset, the account will still be locked by django-axes for a couple of minutes. I'm trying to perform python manage.py axes_reset_username on the class PasswordResetCompleteView but I'm not sure how to access the username whose password was reset. -
Finding good way of solving a shopping cart code:
As my first app I'm finding myself in trouble about designing an app with django that allows me to administrate my sushi local. This app would do the following Create orders: Save orders in database: Show me daily orders with the client's name, products (this would be easy once I get rid of the following doubt) I took a django course that provided me great tools and I think I'll manage to get the app. Here is what I've made: Models: Order model: -Order Id -ClientName (just to using it after in order to print a ticket with the items and know who the order belongs to) -Datecreated ProductsOrdered model (one row for each product ordered) -ProductOrdered = OneToOneField(ProductList model) -OrderId(Foreign Key from Order model)--> I guess so, this relationship ProductList model: -ProductId -ProductName -Price When adding products to the cart, I would do the following (suppose i'm in the corresponding order template) Write the client name in text area and then as I click in each button (which represents the product), I display it in a list that shows price, name and total amount (I've already done this!). However I don't know how send it to the database, with … -
Why im getting an error at importing django rest framework?
I'm getting this error: "Unable to import "rest_framework". I've installed djangorestframework with pip in my virtual enviroment. I activated the environment before installing it but when I try to import django rest framework in my app book it says that can't import it. I've added the rest framework in my installed apps but I don't know which is the problem. I've checked with pip freeze and it's installed. The virtual environment is activaded. What could be the problem? Code from I'm getting the importation error in my serializer.py file that is in my app called "book" from rest_framework import viewsets from .models import Book from .serializer import BookSerializer INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'book', ] -
Django <img> not working but the static file is accessible via url
I'm trying to put an image in the html code, using: <img scr="{% static "degustos/empanadas.jpg" %}" class="card-img-top" alt="Empanadas Ilustrativas"/> but the image isn't displayed. On the other hand, I can access the image going to http://localhost:8000/static/degustos/empanadas.jpg My settings.py: MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")] STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' It's deployed in Heroku. Thanks! -
SyntaxError with pickled integers when migrating app using django-q to Python 3
This question is specific to using django-q with the Django ORM as the queue backend, since the underlying cause seems to be the use of pickle in their Django model. (That said, pickle might be used for other backends in django-q.) Problem When porting an existing app using django-q to Python 3, I noticed logging lines complaining about the following: 2019-05-06 09:52:12,859 ERROR django-q: invalid syntax (<unknown>, line 1) [in /usr/local/lib/python3.6/dist-packages/django_q/cluster.py:558, 140417530787648 (MainThread), 27943 (Process-1)] Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/django_q/cluster.py", line 506, in scheduler args = ast.literal_eval(s.args) File "/usr/lib/python3.6/ast.py", line 48, in literal_eval node_or_string = parse(node_or_string, mode='eval') File "/usr/lib/python3.6/ast.py", line 35, in parse return compile(source, filename, mode, PyCF_ONLY_AST) File "<unknown>", line 1 (320L,) ^ SyntaxError: invalid syntax (Note, if you're running django-q, you won't actually get the traceback: I edited the logging line in django_q/cluster.py to logger.exception instead of logger.error.) This error makes sense because django-q was storing long integers (in this case, model ids) with a trailing L (pickle strikes again). While the following works in Python 2, it fails to parse in Python 3: >>> import ast >>> ast.literal_eval('(320L,)') File "<unknown>", line 1 (320L,) ^ SyntaxError: invalid syntax Possible Solutions I think my options are: Write … -
How to POST to GenericAPIView from a TemplateView
I have an API endpoint which activates a user's account. It expects uid and token in form data. Certainly, it is a UX flaw to expect the user to POST to my endpoint So they get an email with a link (containing a uid and token) for activating their account like: http://example.com/api/auth/account/activate/{uid}/{token} e.g. https://example.com/api/auth/account/activate/MzA/562-5bb096a051c6210994fd So when clicked, the view for that link POSTs their data to the API endpoint and returns a templated page. My working implementation: # urls.py from django.urls import include, path from . import views urlpatterns = [ path('activate/<str:uid>/<str:token>', views.ActivationView.as_view(), name='activate') ] # views.py from django.views.generic.base import TemplateView from djoser.views import ActivationView as DjoserActivationView from django.test.client import RequestFactory class ActivationView(TemplateView): template_name = "users/activation.html" def dispatch(self, request, *args, **kwargs): form_data = { 'uid': kwargs['uid'], 'token': kwargs['token'] } alt_request = RequestFactory().post('/api/auth/users/confirm/', form_data) activate_view_response = DjoserActivationView.as_view()(alt_request) kwargs['activation_status_code'] = activate_view_response.status_code return super().dispatch(request, *args, **kwargs) However, I do not think it is okay for me to be using RequestFactory the way I did here. I don't know any other way I could achieve this. What options are available with Django? -
Im having trouble receiving the second to last element in a query set list
I am having trouble receiving the second to last element in a queryset list in django.. For starters.. I know i can filter it like this QuoteOfTheDay.objects.all().order_by('-id')[1] but when the queryset empty of course it returns empty. I need a safe way to do this so that when it is empty, it want return an IndexError at / list index out of range Please any help? -
storing user data and keep it during production environment
I am building an MVP for my services on Django, where users can log in/register and use the services. But in case I want to drastically change my product, how will I save and retrieve the data given by users when I relaunch my website? What tips will you give to keep the user data and reuse it, when I deploy my website with the different version as an MVP and later full version. -
"http" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
I can't put an http block/directive on nginx config file, I'm trying to increase timeout of file upload via curl ,It says http" directive is not allowed here in /etc/nginx/conf.d/default.conf:1 I'm using django and I can't seems to work it out. http { fastcgi_read_timeout 300; proxy_read_timeout 300; server { listen 80; server_name localhost; location /media/ { try_files $uri /dev/null =404; } location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $server_name; proxy_pass http://app:8000; client_max_body_size 100M; proxy_temp_file_write_size 64k; proxy_connect_timeout 10080s; proxy_send_timeout 10080; proxy_read_timeout 10080; proxy_buffer_size 64k; proxy_buffers 16 32k; proxy_busy_buffers_size 64k; proxy_redirect off; proxy_request_buffering off; proxy_buffering off; } } }