Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Filter Data of foreign key
👋. I want to make a button that filter product on category I Added productatrubuut cause I need colours, size, ect. How do I get the data of category from a Foreign in foreign key? in views.py Models.py class Categorie(models.Model): naam = models.CharField(max_length=150,db_index=True) # # class Product(models.Model): slug = models.SlugField(unique=True, primary_key=True) titel = models.CharField(max_length=200) categorie = models.ForeignKey(Categorie, on_delete=models.CASCADE) # # class ProductAtribuut(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, blank=False) price = models.FloatField(default=0) image = models.ImageField(blank=True, upload_to='gerechten/') visible = models.BooleanField(default=True) # # I can't get category by using this. Views.py product = productatribuut.filter(categorie=categorie)) return render(request, 'pages/index.html', {product}) If someone know please give me an example how I can do it. Thanks in advance. Really appreciate it. <3 -
Django - CheckBoxSelectMultiple renders a list without checkboxes
I'm having an issue rendering a form with the Checkbox widget. The category field appears a unordered list (It takes all the objects) but without the checkboxes. The weird part is that when inspectting with the dev tool it shows the checkboxes as html code. MODELS: class Categories(models.Model): category = models.CharField(verbose_name="Categoria", max_length=20) class Meta: verbose_name = 'Categoria' verbose_name_plural = 'Categorias' ordering = ['category'] def __str__(self): return self.category def __unicode__(self): return self.category class CreatePost(models.Model): #user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="Usuario") title = models.CharField(verbose_name="Titulo", max_length=100) slug = models.CharField(max_length=200, blank=True) content = models.TextField(verbose_name="Contenido", null=True, blank=True) img = models.ImageField(upload_to=custom_upload_to, null=True, blank=False) category = models.ManyToManyField(Categories) created = models.DateTimeField(auto_now_add=True) def save(self, *args, **kwargs): self.slug = slugify(self.title) super(CreatePost, self).save(*args, **kwargs) class Meta: verbose_name = 'Anime' verbose_name_plural = 'Animes' ordering = ['-created'] FORM class PostUpdateForms(forms.ModelForm): categorias = Categories.objects.all() class Meta: model = CreatePost fields = ['title', 'img', 'category', 'content' ] widgets = { 'title':forms.TextInput(attrs={'class':'form-control'}), 'content':forms.Textarea(attrs={'class': 'form-control'}), 'category': forms.CheckboxSelectMultiple() } Images Rendered Form HTML code -
__str__ returned non-string (type NoneType)...im receiving this error may be due to a NoneType user model
I'm getting this error, in admin panel other than this the website is working fine. Here is my forms.py Here is models.py These are in views.py And this is for new user registration I think the error is happening because the order model is receiving a NoneType customer as a foreign key. But I don't know how to solve this problem. I'm new to django please help me out. -
mozilla-django-oidc with keycloak on django 3
I'm trying to connect Django (3.2) with Keycloak (12.0.2) using mozilla-django-oidc (1.2.4). I'm getting the redirection to keycloak when clicking on the Login button (which is using oidc_authentication_init view as per documentation), but after successful login I'm getting this error: Exception Type: HTTPError at /oidc/callback/ Exception Value: 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Relevant settings for django settings are: settings.py INSTALLED_APPS = [ ..., 'mozilla_django_oidc', ] AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', 'mozilla_django_oidc.auth.OIDCAuthenticationBackend', ), OIDC_AUTH_URI = 'http://localhost:8080/auth/realms/mycorp' OIDC_CALLBACK_PUBLIC_URI = 'http://localhost' LOGIN_REDIRECT_URL = OIDC_CALLBACK_PUBLIC_URI LOGOUT_REDIRECT_URL = OIDC_AUTH_URI + '/protocol/openid-connect/logout?redirect_uri=' + OIDC_CALLBACK_PUBLIC_URI OIDC_RP_CLIENT_ID = 'django' OIDC_RP_CLIENT_SECRET = os.environ.get("OIDC_CLIENT_SECRET") OIDC_RP_SCOPES = 'openid email profile' # Keycloak-specific (as per http://KEYCLOAK_SERVER/auth/realms/REALM/.well-known/openid-configuration) OIDC_OP_AUTHORIZATION_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/auth' OIDC_OP_TOKEN_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/token' OIDC_OP_USER_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/userinfo' OIDC_OP_JWKS_ENDPOINT = OIDC_AUTH_URI + '/protocol/openid-connect/certs' urls.py urlpatterns = [ ..., path('oidc/', include('mozilla_django_oidc.urls')), ] And detailed error: HTTPError at /oidc/callback/ 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Request Method: GET Request URL: http://localhost/oidc/callback/?state=cBtEeSIHNNdsgMBUjPXkq2RwVSSpKsZF&session_state=a5b50fc0-0ec2-4def-8ec8-db1e4a95450f&code=864a2e21-75a7-42d8-8249-e9397be9b64b.a5b50fc0-0ec2-4def-8ec8-db1e4a95450f.2ec7cfbf-b5ee-4f9a-9d4b-012fdc0f9630 Django Version: 3.2 Exception Type: HTTPError Exception Value: 404 Client Error: Not Found for url: http://localhost:8080/auth/realms/mycorp/protocol/openid-connect/token Exception Location: /usr/local/lib/python3.8/site-packages/requests/models.py, line 943, in raise_for_status Python Executable: /usr/local/bin/python Python Version: 3.8.9 Python Path: ['/home/maat/src', '/usr/local/bin', '/usr/local/lib/python38.zip', '/usr/local/lib/python3.8', '/usr/local/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/site-packages'] Server time: Tue, 27 Apr 2021 19:08:01 +0200 Apparently … -
Is it possible to assign a OneToOneField through the reverse model in Django?
class Husband(models.Model): wife = models.OneToOneField(Wife, related_name='husband',blank=True, null=True,on_delete=models.CASCADE) name = models.CharField(max_length=200, blank=True) Model Wife(models.Model): name = models.CharField(max_length=200, blank=True) I have a post_save signal on Wife that requires the accessing of the corresponding Husband. This is triggered when I use the .create() method. However, I'm running into some issues assigning the Husband directly in the .create(). I tried the following: Wife.objects.create(name='bla', husband = (some Husband instance)) w = Wife(name = 'bla') w.husband = (some Husband instance) w.save() w = Wife(name = 'bla') (some Husband instance).wife = w w.save() None of these end up storing the relationship into the database. Ultimately I want to have Wife model created with the relationship already set so the signal can draw the husband model object from it. I'm aware that one possible solution is to move the field to the Wife Model Class, but I was hoping there could be cleaner solution than that. any suggestions? -
Creating Django Project
So I'm trying to create a django project with this "django-admin startproject mysite ." but i keep getting this error; Fatal error in launcher: unable to create process using /path/. The system cannot find the file specified. Does anyone know whats going on? I'm using Windows. -
Inserting many foreign keys pertaining to the same model in Django
I am a newbie in Django and building a job portal. When a recruiter posts an internship, it can have many skills. These skills I store them in a different table with a foreign key to Internship. However, I am not sure on how to properly insert that. Getting errors please help this is my code models.py class Internship(models.Model): MODE_CHOICES = ( ('Office', 'Office'), ('Work From Home', 'Work From Home'), ('Blended', 'Blended'), ) recruiter = models.ForeignKey(Recruiter, on_delete=models.SET_NULL, null=True) internship_title = models.CharField(max_length=100) internship_mode = models.CharField(max_length=20, choices=MODE_CHOICES) industry_type = models.CharField(max_length=200) internship_desc = RichTextField() start_date = models.DateField() end_date = models.DateField() internship_deadline = models.DateField() posted_date = models.DateField() def __str__(self): return self.internship_title class InternshipSkill(models.Model): internship = models.ForeignKey(Internship, on_delete=models.CASCADE) skill = models.CharField(max_length=50) def __str__(self): return self.internship+" "+self.skill views.py def post_internship(request): if request.method == 'POST': start_date = request.POST['start_date'] end_date = request.POST['end_date'] internship_title = request.POST['internship_title'] internship_mode = request.POST['internship_mode'] industry_type = request.POST['industry_type'] internship_deadline = request.POST['app_deadline_date'] skills = request.POST.getlist('internship_skills[]') #gets a list emp_steps = request.POST.getlist('employement_steps[]') internship_desc = request.POST['internship_desc'] user = request.user recruiter = Recruiter.objects.get(user=user) try: with transaction.atomic(): internship = Internship.objects.create(recruiter=recruiter, internship_title=internship_title, internship_mode=internship_mode, industry_type=industry_type, internship_desc=internship_desc, start_date=start_date, end_date=end_date, internship_deadline=internship_deadline, posted_date=date.today()) for skill in skills: InternshipSkill.objects.create(internship=internship, skill=skill) except Exception as e: print(e) return render(request, 'post_internship.html', context) -
Django :NoReverseMatch at /spacemissions/organisation/2/
I am getting the following error when, from the list view, I try to access the detail view. Error screenshot The odd thing is that some of the detail views work, some not, and I do not understand where is the problem. For example, here's the detail view of the organisation with pk=1 organisation detail view Organisation model class Organisation(models.Model): code = models.CharField(max_length=256, unique=True) name = models.CharField(max_length=256, null=True) english_name = models.CharField(max_length=256, null=True) location = models.CharField(max_length=256, null=True) country = models.ForeignKey('space_missions.Country', on_delete=models.SET_NULL, null=True, blank=True) longitude = models.FloatField(null=True) latitude = models.FloatField(null=True) parent_organisation = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, blank=True) Views class OrganisationDetail(generic.DetailView): model = models.Organisation class OrganisationList(generic.ListView): model = models.Organisation organisation_list.html {% extends 'base.html' %} {% block content %} <h1>Organisation List</h1> {% if organisation_list %} <ul> {% for organisation in organisation_list %} <li> <a href="{% url 'space_missions:organisation-detail' pk=organisation.pk %}"> {{ organisation.name }} </a> </li> {% endfor %} </ul> {% else %} <p>No organisation is stored in the database!</p> {% endif %} {% endblock %} organisation_detail.html {% extends 'base.html' %} {% block content %} <div class="container"> <h1>{{ organisation.name }}'s details:</h1> <ul> <li><strong>Code: </strong> {{ organisation.code }}</li> <li><strong>English Name: </strong> {{ organisation.english_name }}</li> <li><strong>Location: </strong> {{ organisation.location }}</li> <li><strong>Country: </strong> <a href="{% url 'space_missions:country-detail' pk=organisation.country_id %}"> {{ … -
ImportError: cannot import name 'upath' django 3
How should I resolve the import error? The example code: from django.utils._os import upath dirs = [upath(os.path.abspath(os.path.realpath(d))) for d in dirs] Django 3.2 -
django cbv not sending mails
i am trying to send mail entered in a form which i have in bottom of my html but it does not send mail and does not give errors also my view: from django.conf import settings from django.shortcuts import render from django.views.generic import TemplateView from django.core.mail import send_mail class Homepage(TemplateView): template_name = 'homepage.html' def post(self, request, *args, **kwargs): if request.method == 'post': message = request.POST['message'] name = request.POST['name'] email = request.POST['email'] send_mail('contact form', message, settings.EMAIL_HOST_USER, ['******@gmail.com'], fail_silently=False) return render(request, 'homepage.html') my html form: <form method="post" action={% url 'homepage' %}> {% csrf_token %} <input type="text" name="name" placeholder="Enter First Name"/><br> <input type="email" name="email" placeholder="Enter Your Email"/><br> <input type="textarea" name="message" placeholder="How can we help you?"/><br> <button>Submit</button> </form> -
Vscode black formatter is not working in poetry project
I have these settings in vscode for the black extension in a poetry project, which uses system cache and venv. "editor.formatOnSave": true, "python.formatting.provider": "black", "python.formatting.blackPath": "/Usr/bin/black", "python.pythonPath": "/Usr/bin/python", "python.linting.mypyEnabled": true, "python.linting.mypyPath": "/Usr/bin/mypy" I cannot understand why the formatter formats nothing. I am using local workspace settings ( above ). -
Mypy throws invalid syntax on method signature
A method called within the below method triggers mypy to lint with test_get_all_boards: test_get_all_boards invalid syntax mypy(error). The method in question returns a boolean. I just understand what is wrong with the syntax at test_get_all_boards:. Any ideas? @action(detail=False, methods=["post"]) def try_connection(self, request, *args, **kwargs): result = False cache = caches["instance_details"] if request.data: try: details = Jira(**request.data) if details: if cache[details.uuid]['valid_credentials']: result = True else test_get_all_boards(details): cache[details.uuid]['valid_credentials'] = True result = True except: pass return Response({"test_result": result}, status=status.HTTP_200_OK) -
Application error django blog app with heroku
I deployed a Django blog app to Heroku and the build was successful but on opening the app I got a page saying application error, it said to check the logs but I don't get the message. Here's the log 2021-04-27T15:41:49.301926+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=campusstory.herokuapp.com request_id=c5396159-b7e0-4ada-8764-54d40add0bc2 fwd="102.89.3.201" dyno= connect= service= status=503 bytes= protocol=https 2021-04-27T15:41:49.674072+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=campusstory.herokuapp.com request_id=22a9b86c-9b7a-4851-8ff1-7c0c8c733a44 fwd="102.89.2.205" dyno= connect= service= status=503 bytes= protocol=https 2021-04-27T15:47:31.201263+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=campusstory.herokuapp.com request_id=477c9fb1-4b53-4bb8-9fc2-1f4e66604ff0 fwd="102.89.2.205" dyno= connect= service= status=503 bytes= protocol=https 2021-04-27T15:47:31.619852+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=campusstory.herokuapp.com request_id=3ef7ae48-18cb-4979-8bce-ef80dc4e021f fwd="102.89.3.44" dyno= connect= service= status=503 bytes= protocol=https 2021-04-27T15:47:33.950102+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=campusstory.herokuapp.com request_id=4abaafe0-8bd6-4d0c-a7fb-c0524fc4ca00 fwd="102.89.3.201" dyno= connect= service= status=503 bytes= protocol=https 2021-04-27T15:47:34.389228+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=campusstory.herokuapp.com request_id=3b3953cf-8f47-4de9-ba88-4da2c4e14249 fwd="102.89.2.205" dyno= connect= service= status=503 bytes= protocol=https -
Is it possible to create a django superuser via management.call_command?
The issue I'm encountering is that "password" is not a valid flag option. management.call_command( 'createsuperuser', interactive = False, username = "user" password = "password" ) gives error: TypeError: Unknown option(s) for createsuperuser command: password Valid options are: ... -
I want to export a table's data into excel sheet in django i have done the exact thing and written the code for it but getting FieldError
enter image description herehere is my views.py this code is for exporting to excel sheet def export_excel(request): response = HttpResponse(content_type='application/ms-excel') response['Content-Disposition'] = 'attachment; filename="candidates.xls"' wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('candidates') # Sheet header, first row row_num = 0 font_style = xlwt.XFStyle() font_style.font.bold = True columns = ['Full Name ', 'Email', 'Notice Period (in Days)', 'Current Location', 'Expected Location', 'Current CTC (Per Annum)', 'Expected CTC (Per Annum)', 'Upload CV', ' Gender'] for col_num in range(len(columns)): ws.write(row_num, col_num, columns[col_num], font_style) # Sheet body, remaining rows font_style = xlwt.XFStyle() rows = ApplyForm.objects.all().values_list('full_name', 'email', 'noticeperiod', 'preferredlocation', ' expectedlocation', 'currentctc', ' expectedctc', ' cv', 'gender' ) for row in rows: row_num += 1 for col_num in range(len(row)): ws.write(row_num, col_num, row[col_num], font_style) wb.save(response) return response this is the code for filling up the form and submitting to databasein views.py def applyform(request): data = ApplyForm.objects.all() print(data) if request.method == "POST": full_name = request.POST['full_name'] email = request.POST['email'] noticeperiod = request.POST['noticeperiod'] preferredlocation = request.POST['preferredlocation'] expectedlocation = request.POST['expectedlocation'] currentctc = request.POST['currentctc'] expectedctc= request.POST['expectedctc'] gender = request.POST['gender'] cv = request.FILES['cv'] ins = ApplyForm(full_name = full_name, email = email, noticeperiod = noticeperiod, preferredlocation = preferredlocation, expectedlocation= expectedlocation, currentctc =currentctc, expectedctc = expectedctc, gender = gender, cv = cv) ins.save() print("the data has … -
TemplateSyntaxError at /messages/inbox/ 'account_tags' is not a registered tag library. Must be one of:
I am using pinax_messages and pinax_templates. I am not able to go to the page : http://127.0.0.1:8000/messages/inbox/ I am getting a strange error and dont understand the problem. I am getting the error: TemplateSyntaxError at /messages/inbox/ 'account_tags' is not a registered tag library. Must be one of: admin_list admin_modify admin_urls bootstrap cache crispy_forms_field crispy_forms_filters crispy_forms_tags crispy_forms_utils i18n l10n log pinax_messages_tags static tz I am not able to find any help on google. -
Django: sorting querysets to have a specific order of objects
I've a model with two fields, say deprecated and new. When I'm listing the objects, I'd like the ones with new=True at the beginning, followed by the objects where deprecated=True and then the rest. I've seen a bunch of answers about ordering by multiple fields but that doesn't seem to work for me. This is how I'm doing the ordering now: class Meta: ordering = ['new', 'deprecated'] I've tried using multiple order_by on the queryset as well but that doesn't do the trick either. Right now I get a list with the new ones at the beginning butthe deprecated ones at the bottom. Is there a direct way to do what I want? This doesn't work for me as the order should be based on fields rather than specific ids. -
django check values if they are empty
All fields have values, however, the app is redirected to the first if condition('Fields are empty!'). If I remove the condition the form is submitted. What am I missing here? Any help is appreciated, thank you! def application(request): if request.method == 'POST': name = request.POST['name'] surname = request.POST['surname'] email = request.POST['email'] address = request.POST['address'] city = request.POST['city'] country = request.POST['country'] zipcode = request.POST['zipcode'] phone = request.POST['phone'] if(name,surname,email,address,city,country,zipcode,phone == ""): return HttpResponse("<h3 style = 'background:#000;color:red; display:flex;justify-content:center;align-items:center;width:100%;height:100%;font-family:lato;'>Fields are empty!!</h3>") else: application = Application(name = name, surname = surname, email = email, address = address, city = city, country = country, zipcode = zipcode, phone = phone) application.save() thename = name.capitalize() thesurname = surname.capitalize() ) messages.success(request, 'Your request has been submitted, a representative will get back to you soon') return render(request, 'application.html') -
How to list the titles of html pages with links on the home page in Django
Picture of my window I am sorry if this is a stupid question but I am new to Django. I am building a website and I have articles saved as template files. I want to display all of their titles with links directed to those templates but I want to automatically list them so if I add a new template to the folder, the home page will have the new link to that template. Is there a way to do that? So as I show in the picture... I have a folder for article sites, but I want to list their titles and the URLs on the home page. I know we can do it manually but I want to automatically list them, so every time we add one or remove an article, the home page list should get modified automatically. Thank you for your help. -
Why the platform create a new wallet?
enter code here @login_required def wallet_new(request): wallets = Wallet.objects.all() if request.method == "POST": form = WalletForm(request.POST) if form.is_valid(): new_wallet = form.save(commit=False) new_wallet.profile = request.user new_wallet.save() for wallet in wallets: if new_wallet.profile == wallet.profile: new_wallet.delete() return render(request, 'app/error.html') else: new_wallet.save() return render(request, 'app/response_wallet_executed.html') form = WalletForm() contex = {'form': form} return render(request, 'app/wallet_new.html', contex) I don't understand why the view create always a new wallet, please help me.The scope is to create a new UNIQUE wallet for user, and when a user that has a wallet, he would create a new wallet, the viewmust not allow it -
Editing form data in django
I am trying to edit a form data but instead of editing, it adds new data. I actually referred the codes online, but I couldn't figure out where I have got wrong. The following is the snippet of where I call the edit button <a class="btn btn-secondary" href="{% url 'ride:edit-ride' i.id %}">Edit</a></td> veiws.py def edit_ride(request, pk): obj = Ride.objects.get(id=pk) form = RideForm(instance=obj) if request.method == 'POST': form = RideForm(request.POST, instance=obj) if form.is_valid(): form.save() return redirect('ride_list.html') context = {'form': form} return render(request, 'offerride/create_ride.html', context) -
javascript onclick function not working in django template (problem most certainly is with the js code, i have verified the correctness of django)
what i am trying to do is create a like button just like Instagram's heart. The page must not reload when the like button is clicked, it must simply fill in with the specified color. This is how i am rendering the button in my page: <a href="#" onclick= "favPost('{% url 'events:post_unfavorite' post.id %}', {{ post.id }} );return false;" {% if post.id not in favorites %} style="display: none;" {% endif %} id="favorite_star_{{post.id}}"> <span class="fa-stack" style="vertical-align: middle;"> <i class="fa fa-star fa-stack-1x" style="color: yello;"></i> <i class="fa fa-star-o fa-stack-1x"></i> </span> </a> <!-- the second href --> <a href="#" onclick= "favPost('{% url 'events:post_favorite' post.id %}', {{ post.id }} );return false;" {% if post.id in favorites %} style="display: none;" {% endif %} id="unfavorite_star_{{post.id}}"> <span class="fa-stack" style="vertical-align: middle;"> <i class="fa fa-star fa-stack-1x" style="display: none; color: yello;"></i> <i class="fa fa-star-o fa-stack-1x"></i> </span> </a> here, events is the name of my django app, "post" is the relevant post on which i need to add the like and "favorites" is a list of favorite posts associated with any posts. Though i have double checked and i am almost certain that there are no issues with my python code. But i'll still provide the functions for reference. These are the … -
about django template url parameter without db
I am creating a bulletin board that communicates by DB <> API <> WEB method. Can django templates url parameter be used on 'Web' without db? I need to get two acquisitions, how should I use them? I've Googled and tried many things, but there was nothing I wanted to find. I must use the url tag. please help me. THANK YOU urls.py path('board/<int:pk>/comment/<int:id>/delete/', views.Commentapi_delete.as_view(), name="comment_delete"), template <form action="{% url 'comment_delete' ? ? %} method='POST'"> -
Django static files uploaded to folder in Amazon S3 that can't be found
I'm trying to set up Django so that all static files are uploaded to s3, but for whatever reason, it's not working. Here is the relevant section in settings.py: AWS_STORAGE_BUCKET_NAME = "bucket_name" AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID") AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY") AWS_S3_FILE_OVERWRITE = False AWS_S3_REGION_NAME = "us-east-2" AWS_S3_CUSTOM_DOMAIN = ( f"{AWS_STORAGE_BUCKET_NAME}.s3.{AWS_S3_REGION_NAME}.amazonaws.com" ) AWS_S3_ENDPOINT_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}" AWS_LOCATION = "static" STATIC_URL = f"{AWS_S3_ENDPOINT_URL}/{AWS_LOCATION}/" STATICFILES_STORAGE = "storages.backends.s3boto3.S3Boto3Storage" Supposing that my bucket is called bucket_name, this is what will happen: In my bucket_name bucket, there will be a folder called "bucket_name" with a static folder inside which contains all of my files. On the server, none of the assets will load. This is because they are looking for the url https://bucket_name.s3.us-east-2.amazonaws.com/static whereas it's written in https://bucket_name.s3.us-east-2.amazonaws.com/bucket_name/static. How do I either get the django assets to use this new address, or change the address on aws so that it aligns with django? I've done some things to debug this. It seems that if I redefine AWS_STORAGE_BUCKET_NAME after all of these lines, all that will change is the folder name will change from bucket_name to whatever else. Except I don't want to rename this folder, I want to either remove it entirely or get django to understand this folder. … -
How can I get MINIO access and secret key?
I'm new to minio and I want to use it in a Django app, I read the documentation of minio python library and there is a field for MINIO_ENDPOINT, MINIO_ACCESS_KEY, MINIO_SECRET_KEY. I read the Quickstart documentation of minio but I didn't figure out how to find these parameters.