Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Generating PDFs from Pandas DataFrame with ReportLab with Python
I have been battling with exporting my Pandas DataFrame to PDF. Let me explain the situation. I have a Pandas DataFrame for example: commissions_df.columns = [ 'Versicherer', 'Produkt Bereich', 'Produkt Typ', 'Produkt', 'Vertragsart', 'Steuersatz', 'AP gesamt', 'BP gesamt', "Anteil Partner" ] I would like to filter by 'Versicherer', which is category type and have each DataFrame as a separate frame. I was successful at exporting each frame as a sheet with Excel. Here is an image of the way it looks: And here is the code I used to do that: Different_Versicherer = commissions_df.Versicherer.unique() number1 = np.random.randint(0,100) number2 = np.random.randint(101,800) FileName1 = 'FileName' con = "_" ext = ".xlsx" excelname = FileName1 + con + str(number1) + con + str(number2) + ext writer = pd.ExcelWriter(excelname) # iterate through each insurance and add a seprate sheet for all of them for Versicherer_names in Different_Versicherer: frame = commissions_df[commissions_df['Versicherer'] == Versicherer_names] frame.to_excel(writer, sheet_name= Versicherer_names[0:7],index=False) writer.save() Right now, I would like to export the DataFrames to PDF using ReportLab and have each unique item in Versicherer have its own page with header colour: So far here is what I tried: import reportlab from reportlab.lib.pagesizes import A4 from reportlab.pdfgen.canvas import Canvas from reportlab.lib.utils import ImageReader … -
Difference between 2 identical codes
I'm am trying to troubleshoot an HTTP response one code works fine but, the other one is returning an ValueError they are the both same code and I looked over them for 1hr side by side but, I can't find what is wrong with the bad code this is really bugging me. Working code:` from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib import auth def signup(request): if request.method == 'POST': if request.POST['password1'] == request.POST['password2']: try: user = User.object.get(username=request.POST['username']) return render(request, 'accounts/signup.html', {'error':'Username in use'}) except User.DoesNotExist: User.objects.create_user(request.POST['username'], password=request.POST['password1']) auth.login(request.user) return redirect('home') else: return render(request, 'accounts/signup.html') def login(request): return render(request, 'accounts/login.html') def logout(request): return render(request, 'accounts/signup.html') BAD CODE: from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib import auth def signup(request): if request.method =='POST': if request.POST['password1'] == request.POST['password2']: try: user = User.object.get(username=request.POST['username']) return render(request, 'accounts/signup.html', {'error':'Username in use '}) except User.DoesNotExist: User.objects.create_user(request.POST['username'], password=request.POST['password1']) auth.login(request.user) return redirect('home') else: return render(request, 'accounts/signup.html') def login(request): return render(request, 'accounts/login.html') def logout(request): return render(request, 'accounts/signup.html') ` -
Make search_fields for integer value
I made models like this and it has the IntegerField. class Corpus(models.Model): text = models.TextField(null=False) manual = models.IntegerField(blank=True,null=True) issues = models.ManyToManyField(Issue,blank=True,null=True) def __str__(self): return self.text And I set, "search_fields' admin class. I expected pull down menu for manual however there is only one text box on the page. class CorpusAdmin(admin.ModelAdmin): list_display = ['text','manual'] search_fields = ['text','manual'] list_editable = ['manual'] How can I use search_fields for integer value?? -
Having trouble with Django and adding to tables
I was following a tutorial on youtube and it came to a point where we were putting data on tables on the admin site. This is the link with the time stamp https://www.youtube.com/watch?v=_uQrJ0TkZlc&t=20490s when I finished with the info it brings up this error message OperationalError at /admin/products/product/add/ no such table: main.auth_user__old btw im on MacOs Catalina django = 2.1 python = 3.8 Anything I can do? -
Updating multiple objects with one request in Django and Django Rest Framework
I need to update multiple Education objects at a time from one request. My Views is: def update(self, request, *args, **kwargs): partial = kwargs.pop('partial', False) instance = self.get_object() serializer = self.get_serializer(instance, data=request.data, partial=partial, many=True) # many = True for multiple update if serializer.is_valid(): self.perform_update(serializer) response = create_response(True,data = serializer.data) return Response(response, status=status.HTTP_200_OK) else: response = create_response(False, err_name = serializer._errors) return Response(response, status = status.HTTP_400_BAD_REQUEST) and my serializer is : class Meta: model = Education fields = ['user','level', 'institute', 'start_date', 'complete_date'] 'many=True' is only work for multiple objects create. How to update multiple objects at a time? -
How to move local django project to an already established server
Note: I think this is just an ftp issue. I really just don't know which files to move to the server. I have seen lots of tutorials on configuring a server to host a django project. I already have that established, now I am unsure how to move my actual local django project to the server (in a way that does not cause a 502 Bad Gateway error). I have a properly configured server connected to a domain. I added a simple test app with one view that returned HttpResponse('working'). Went to my domain and saw this HttResponse. I thought, great everything is working, I can delete this app and upload my local project now (except for production-specific settings) and everything would work. I connected to the server via sftp, moved to my 'home/user/project' folder (contains env, django_project, manage.py). At this point, I don't think I need to copy everything from my local project to the server(such as my local env, and possibly my local manage.py and other files). I tried to copy over specific apps but that just lead to a 502 Bad Gateway error. I couldn't get to the bottom of that error so I scrapped the django … -
django.urls.exceptions.NoReverseMatch despite setting all the parameters
So I think I added everything correctly, with the url patterns, views, and the html page, but I'm not sure what went wrong. path('hero/<int:hero_id>/', manage_hero, name="manage_hero"), @login_required def manage_hero(request, hero_id): context = {'hero_bar' : True} profile = UserProfile.objects.get(user=request.user) hero = get_object_or_404(Accskill, id=hero_id) if not profile.player.guid == hero.guid: return render(request, "dashboard/no_permission.html", context={'redirect' : reverse("dashboard:dashboard")}) context['hero'] = hero context['form'] = ModifyHeroForm(hero=context['hero']) return render(request, "hero/hero.html", context=context) <td><a href="{% url 'hero:manage_hero' hero_id=hero.ID %}" class="btn btn-outline-primary" role="button" aria-disabled="true">管理英雄</a></td> -
Django: Where is the best place to store uploaded file(pdfs, docs) that a user share on a django project?
I am currently working on a Django project to make a file sharing website. I do aware that Django models cant save a file in their fields and only store a string that refers to it, and the file is saved in whatever folder i set in MEDIA_ROOT setting, which I find is not very secure and effective. So where do I store these uploaded files? Or is it safe enough to store it in the folder set by MEDIA_ROOT? I can’t give any progress now as it is still all in my head and I have been searching too and the answer is nowhere to be found(or maybe i didnt try enough). So what is the best practice to store these files? -
Get related_name of Django ForeignKey field at runtime
Let's say I have the following Django models: class Person(models.Model): name = models.CharField(max_length=50) class Pet(models.Model): name = models.CharField(max_length=50) person = models.ForeignKey(Person, related_name='pets', on_delete=models.CASCADE) I need to get the string value of related_name for Pet.person at runtime. I can get the related_query_name, which is "pet" but that's slightly different than the related_name, which is "pets": print(Pet._meta.get_field("person").related_query_name()) # pet Looks like the related name is on the Person class, but I'm not sure how to prove it's tied to Pet.person. print("pets" in [f.name for f in Person._meta.get_fields()]) # True Is there anyway to do this? -
How can we deploy my python-multitenant SAAS App in Amazon EC2?
First of all forgive me if this is not right place to ask this question. As we have been working on multi tenant based SAAS application using python, python-django, python django multitenant-schema, postgres and Redis for backend and angular for front-end. However, we would like to deploy this system on AWS EC2 for testing as well as to work on code automation (CI and CD) using AWS Code Pipeline. Can somebody guide me through right process or any link will be available? I went through this link but could not success and though there could be some easier way to do so. Thank you -
Heroku Django site is suddenly giving 400 errors on PUT requests
I'm not sure if this a Heroku or Django thing specifically, but thought I would try asking here. I have a site deployed on Heroku with Django REST and VueJS. The site was deployed last week and seemed to be working as intended. In the last few days, however, end-users haven't been able to make successful PUT requests, though they can access other parts of the site without a problem. I checked the logs and they seemed to be getting 400 errors all of a sudden. Everything is fine whenever I make a PUT request, and a couple of users had no issues the day before either. It's strange because its popped up all of a sudden, even though it seemed to be fine before. I'm a newb developer so I'm probably missing something obvious, but is it likely to be an error at the server end or something in my code...? Thank you! -
Conditional in crispy forms
I'm actually trying to figure out how to be able make a condition on a field in a HTML page. I've a form in which I want to render a field if the users ask for a 'web application' in the Choicefield above. But I've two problems. First the "conditionnalWeb" form render before the "typeOfTheProject" one. Second, I tried a lot of things but it never worked on how to make this condition. It's probably an easy solution but it's my first time working with django and crispy form. Here is the form: class ConfiguratorForm(forms.Form): queryOfProject = TypeOfProgram.objects.values_list('name') queryOfFramework = Framework.objects.values_list('name','version') queryOfDatabase = Database.objects.values_list('name','version') listFramework = [] listProject = [] conditionnalWeb=[] listFramework=[((q[0],q[1]),q[0]+" version "+q[1])for q in queryOfFramework] listProject=[(q[0],q[0])for q in queryOfProject] listDatabase = [((q[0],q[1]),q[0]+" version "+q[1])for q in queryOfDatabase] typeOfTheproject = forms.ChoiceField(choices = listProject) conditionnalWeb = forms.ChoiceField (choices = [('', '----'),("Only Backend","Only Backend"),("Only Frontend","Only Frontend")]) wantedFramework = forms.MultipleChoiceField(choices = listFramework) wantedDatabase = forms.MultipleChoiceField(choices = listDatabase) Here is the HTML: {% extends 'forms/base.html' %} {% load crispy_forms_tags %} {% block content %} <form method="post"> {% csrf_token %} {{form|crispy}} <button type="submit" class="btn btn-success">Save configuration</button> </form> {% endblock %} </html> I've left the easy {{form|crispy}} . All the others strategies that I tried … -
celery + redis Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused
I can not run the celery worker + redis + django. If I run this command to check that celery worker is ready to receive tasks: celery -A car_rental worker -l info I got this error: [2020-02-24 00:14:42,188: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused. Trying again in 2.00 seconds... In my settings.py I have this: BROKER_URL = 'redis://localhost:6379' requirements.txt: amqp==2.5.2, asgiref==3.2.3, billiard==3.6.2.0, celery==4.4.0, redis==3.4.1 celery.py: from __future__ import absolute_import, unicode_literals import os from celery import Celery os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'car_rental.settings') app = Celery('car_rental') app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks() @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.request)) car_rental/init.py: from __future__ import absolute_import, unicode_literals from .celery import app as celery_app __all__ = ('celery_app',) and the structure of my project is like this: car_rental /car_rental __init__.py celery.py setting.py What I didn't understand is that I am using in the broker_url = 'redis://localhost:6379' but in the error I have: Cannot connect to amqp://guest:**@127.0.0.1:5672// -
I want to return a search result based on current user's data in the db django
This is my view.py def searchposts(request): if request.method == 'GET': query= request.GET.get('q') submitbutton= request.GET.get('submit') if query is not None: lookups= Q(suspect_name__icontains=query) | Q(complaint_name__icontains=query) results= CreateRecord.objects.filter(lookups).distinct() context={'results': results, 'submitbutton': submitbutton} return render(request, 'search.html', context) else: return render(request, 'search.html') else: return render(request, 'search.html') tho the search is working but it return a queryset that matches the query irrespective of the user. i want it to return on queryset that matches the current logged in user data in db. -
Replacing <select> in Django form with custom logic
I have a client who has an existing Django form template rendered from a view that simply extends UpdateView. In the existing template, {{ form.as_p }} is used to render out a fairly generic form i.e. input elements and a select element and an input type="submit". The select element is what is rendered for the model's ManyToManyField to allow multiple value selection. The client wants an 'Ajax-style' input autocomplete instead of the select element, however there is no API at all. The architecture is simply form rendering and then form POSTs. I've replaced the {{ form.as_p }} with a {{ form.xxx }} to render each of the input elements. And instead of the select element, I have written some custom Javascript and layout to manage all the autocomplete functionality. That code maintains an Array of the user selected values from all the possibilities. But I'm unsure how to proceed with using Javascript to get the form to submit with the correct payload. If this was an ajax-style submit, I'd serialize() the form and then add my custom values and then submit a POST to the API with the serialized payload. I could add a hidden select and then modify that … -
Perfoming search filter on my APIView in django
I am trying to implement a search on multiple fields in my Django api, but I don't want to use generics or LISTApi to do that. Please, how can I accomplish that? I imported Django filter also to try to accomplish that but it didn't work. Below is how my code is set up models.py class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(max_length=254, unique=True) name = models.CharField(max_length=250) is_staff = models.BooleanField(default=False) is_superuser = models.BooleanField(default=False) is_active = models.BooleanField(default=True) last_login = models.DateTimeField(null=True, blank=True) date_joined = models.DateTimeField(auto_now_add=True) slug = models.SlugField(max_length=255, unique=True, blank=True) views.py class ListUsersView(APIView, MyPaginationMixin): ''' Gets all the users in the database ''' queryset = User.objects.all() serializer_class = UserSerializer permission_classes = [AllowAny] pagination_class = api_settings.DEFAULT_PAGINATION_CLASS filter_backends = (filters.DjangoFilterBackend,) filterset_fields = ('email', 'name', 'profiles__skills') search_fields = ['email', 'name', 'profiles__skills'] def get(self, request): page = self.paginate_queryset(self.queryset) if page is not None: serializer_context = {"request": request} serializer = self.serializer_class(page, context=serializer_context, many=True) return self.get_paginated_response(serializer.data) settings.py INSTALLED_APPS = [ ... 'django_filters', ... ] 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'], urls.py path('users/', qv.ListUsersView.as_view(), name='list-users'), -
Django: filter database for current user
On my webpage I would like the user to filter the database by month and year. To do so, I created a filters.py . My problem: I did not manage the user to only filter its own data, but he is also able to see the data from the other users. So far I have tried to use @login_required and the objects.filter(user=self.request.user) method. Both didn't solve my problem. I would be grateful for any tipps! Here my code: models.py: from django.db import models from django.contrib.auth.models import User class UserDetails(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="new_spending", null=True) expense_name = models.CharField(max_length=255) cost = models.FloatField() date_added = models.DateTimeField() filters.py from .models import UserDetails import django_filters class BudgetFilter(django_filters.FilterSet): year_added = django_filters.NumberFilter(field_name='date_added', lookup_expr='year', label='Year [yyyy]')# lookup_expr='year', month_added = django_filters.NumberFilter(field_name='date_added', lookup_expr='month', label='Month [mm]') class Meta: model = UserDetails fields = ['year_added', 'month_added'] views.py from django.shortcuts import render from .models import UserDetails from .filters import BudgetFilter from django.contrib.auth.decorators import login_required @login_required def search(request): lista = UserDetails.objects.filter(user= request.user) filtered_list = BudgetFilter(request.GET, queryset=lista) return render(request, 'budget_app/user_list.html', { 'filter': filtered_list, 'users': lista }) urls.py: from django.urls import path from . import views from django_filters.views import FilterView from .filters import BudgetFilter urlpatterns = [ ... path('search/', FilterView.as_view(filterset_class=BudgetFilter, template_name='budget_app/user_list.html'), name='search'), ] html file: … -
Django 2.2: How can I Modify a Specific Page in the Django Admin?
I am having some real trouble finding a definitive, descriptive answer to my question. Situation I need to add a URL/Link to a specific page in my Django Admin. Where I am I have modified the admin page before, but very slightly... I added a banner to my admin site to show me whether I am in a production environment or development environment like this: I did that by doing this: # templates/admin/base_site.html {% extends "admin/base_site.html" %} {% block extrastyle %} <style type="text/css"> body:before { display: block; line-height: 35px; text-align: center; font-weight: bold; text-transform: uppercase; color: white; content: "{{ ENVIRONMENT_NAME }}"; background-color: {{ ENVIRONMENT_COLOR }}; } </style> {% endblock %} - # project/context_processor.py from django.conf import settings def from_settings(request): return { 'ENVIRONMENT_NAME': settings.ENVIRONMENT_NAME, 'ENVIRONMENT_COLOR': settings.ENVIRONMENT_COLOR, } - # settings/base.py TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'wabiclean.context_processors.from_settings', ], }, }, ] Why I am stuck / Where I need help I can't quite figure out how to modify a specific page in the Django Admin. Once I figure out how to modify that specific page, I then need to modify a specific div on that page to insert … -
Django: No such file or directory found
so I am in development for a Django website. I feel like this is such a simple fix but for the life of me I can't find a solution. I know where the error is stemming from; on my index.html I am trying to show cover images for each blog post. When I remove the line where I call the object's image from the view the site runs. But when it is there I get this error: I have my file structure as follows: project/media/images (the image error.jpg is in the images folder. Here is my settings.py as I feel like this is where the problem is stemming from (at least the section I think the error is coming from. Any help at all is greatly appreciated, thanks! -
Multiple class-based views on 1 page
How can I display multiple class-based views on 1 page? For example if I want make To Do List, how do I need to implement them? -
Django ORM Retrieve Database Objects with At least 3 Matching Attributes
I have a Django application where I have a simple Pizza object with a foreign-key field set to another Object, Topping. Each Pizza has 5 toppings. I want to select a Pizza and have query the database with the ORM to retrieve any other pizzas which have at least 3 matching toppings to the Pizza selected. How do I implement the query part of this with the ORM? -
django Site matching query does not exist error
i installed allauth app , and once i try to go to my admin panel this error shows : DoesNotExist at /admin/login/ Site matching query does not exist. i know that it's configuration probleme here my settings.py file : """ Django settings for empliya project. Generated by 'django-admin startproject' using Django 2.1.7. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_DIR=os.path.join(BASE_DIR,'templates') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '^%$6rgi5agbty+pa)pzt9ip$f(ffnrx)y4c1)-+orvywdznw%o' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.sites', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles','accounts','search','gigpost','allauth','allauth.account','allauth.socialaccount', 'allauth.socialaccount.providers.facebook', 'allauth.socialaccount.providers.google', 'allauth.socialaccount.providers.linkedin', 'allauth.socialaccount.providers.twitter', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', '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', ] ROOT_URLCONF = 'empliya.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [TEMPLATE_DIR,], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'empliya.wsgi.application' AUTH_USER_MODEL = 'accounts.User' # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': … -
How to prevent loading my Keras model at every time that I call the views in Django?
I am trying to use mobilenet in a Django app to classify images. I have already trained my model using Keras with Tensorflow backend and it is working properly without using Django. First I tried to use my model inside the view functions and it worked without any errors. However, the model is loaded every time I call this view and it takes a lot of times to reload. then I tried to define the model as a global model to load the weights only once. I have tried to initialize the model weights in the settings or in the app.py file but many problems were shown up. actually I tried to use the model without loading the weights and it worked but after loading the weight it gives me this error: this is my code: global model model = MobileNet(weights=None) model.load_weights(path) model._make_predict_function() with graph.as_default(): model.predict(img) and this is the error RuntimeError at /classifier/ Attempting to capture an EagerTensor without building a function. and this is the error before adding model._make_predict_function(): Error while reading resource variable conv_pw_12/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/conv_pw_12/kernel) … -
List One to Many Relationship
I'm sure this is a very basic question but I have a OneToMany Relationship and I wish to list all the associated children on a page. Here's what i have so far. Model File from django.utils import timezone from django.contrib.auth.models import User from django.urls import reverse class Post(models.Model): title = models.CharField(max_length=100) date_posted = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.title def get_absolute_url(self): return reverse ('blog-post' , kwargs = {'pk': self.pk}) class Paragraph(models.Model): content = models.TextField(default='') post = models.ForeignKey(Post,default='', on_delete=models.CASCADE) def __str__(self): return self.content class Subtitle(models.Model): subtitle = models.CharField(max_length=100,default='') post = models.ForeignKey(Post,default='', on_delete=models.CASCADE) def __str__(self): return self.subtitle View model = Post template_name = 'blog/post.html' context_object_name = 'post' HTML FILE {%block content%} {% if post.author == user %} <a href="{%url 'blog-update' post.id %}">Edit</a> <a href="{%url 'blog-delete' post.id %}">Delete</a> {% endif %} <div class = 'content'> <h2>{{post.title}}</h2> <!-- I want to show Subtitle here--><p></p> <!-- I want to show Paragraph here--><p></p> <h3>By: {{post.author}} on {{post.date_posted}}</h3> </div> {% endblock content %} -
Nginx 502 Bad Gateway with uwsgi+Django app
I am trying to set up nginx to serve my django application with uwsgi, but I am running into an error: whenever I connect to port 80, I get the nginx start page. But when I try to connect on port 8000, I get a 502 bad gateway. I am following a guide, and I am stuck at this step: https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html#if-that-doesn-t-work. I've also tried following a few other guides, but I wasn't able to get it working with any of them, so maybe there's an issue with my configuration. I tried running uwsgi with the following command: uwsgi --socket mysite.sock --wsgi-file test.py --chmod-socket=666 as the guide suggests, but I am still getting a permission denied error: 2020/02/23 20:26:43 [crit] 3745#3745: *25 connect() to unix:///home/bitnami/nate_site/nate_site.sock failed (13: Permission denied) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///home/bitnami/nate_site/nate_site.sock:", host: "xxx.xxx.xxx.xxx:8000" 2020/02/23 20:26:44 [crit] 3745#3745: *25 connect() to unix:///home/bitnami/nate_site/nate_site.sock failed (13: Permission denied) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: xxx.xxx.xxx.xxx, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///home/bitnami/nate_site/nate_site.sock:", host: "xxx.xxx.xxx.xxx:8000" systemctl status nginx shows the service running just fine, so I'm not sure why this error is appearing. I am stopping and starting these processes (nginx, django, etc.) …