Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Configuring Gunicorn and Nginx to serve Django and Vuejs
I have a project made with Django and Vuejs which works perfectly on my local computer. But when it comes to deploy it on a test EC2 (AWS) instance with gunicorn and nginx, I'm completely lost. I've tried to follow pretty much every tutorial I could find about this, and I didn't manage to display anything. First of all, I don't know if it is better to serve the static files directly (the index.html of my SPA with its css and js files) or the django application since up to now I'm using this : ... path('', TemplateView.as_view(template_name='index.html')), re_path(r'^.*$', TemplateView.as_view(template_name='index.html')) ] in my django URLs to serve index.html whatever the URL. I don't ask for something really complicated, just something minimal to make it work and then I'll be able to customize it (i guess). I'm using this script to start the app (inspired by a tutorial) : NAME="<name_of_my_app" USER="<my_user>" GROUP="<my_group>" SOCK_FILE=/<some_path>/gunicorn.sock NUM_WORKERS=3 DJANGO_DIR=/<some_path>/app_name DJANGO_SETTINGS_MODULE=<my_production_settings> DJANGO_WSGI_MODULE=<my_wsgi_module> echo "Starting" cd $DJANGO_DIR source /<path_to_virtualenv>/bin/activate export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE exec /<path_to_virtualenv>/bin/gunicorn ${DJANGO_WSGI_MODULE}:application \ --name $NAME \ --workers $NUM_WORKERS \ --user=$USER --group=$GROUP \ --bind=unix:$SOCK_FILE \ --log-level=debug \ --log-file=- PS: I don't even know what gunicorn.sock is supposed to be? I've read it is supposed to be … -
Параметры класса Meta verbose_name и verbose_name_plural
Django версия 3.1.3 пытаюсь задать параметры, для изменения отображения на админ страничке, но ничего не выходит код модели: from django.db import models class Bb(models.Model): title = models.CharField(null=True, blank=True, max_length=50, verbose_name='Описание') price = models.FloatField(null=True, blank=True, verbose_name='Цена') published = models.DateField(auto_now_add=True, db_index=True, verbose_name='Опубликовано') class Meta(): verbose_name = 'Объявление' verbose_name_plural = 'Объявления' ordering = ['-published'] На админ страничке ничего не изменяется, подскажите как исправить. Поиск не помог. -
How do you create a gitignore file in pycharm? (windows)
What i could find relating to git settings on pycharm -
Is it possible to create a unique Django path for each row in a pandas dataframe?
I have a Django project that takes information in each row of a pandas dataframe and displays the contents on the page. I'd like to separate each row of the dataframe into its own page with its own unique path. There are too many rows in the dataframe to hard code each row in the context of the views.py file. How would I go about creating a unique url path for each row? Is this even possible? -
Filter Form with regular forms,or crispy form
I have this form made with HTML(well with bootstrap) in a template, and I want to make it filter the jobs list under the form by title and by job type (full-time, freelance, etc) I tried with Django-filter and django-bootstrap-form library but I can make it look like the form in the image. please help!! -
Django: add a form into a modal (bootstrap)
i'm trying to add a button that open a modal(bootstrap) where i can add a new object car, but when i press the buttom open the service form in the modal i have a working form where i can add new car (name=create-car), how can i open the CarForm inside of the modal? The idea is that if there is no car in the select dropdown, you can add a new one in from the modal. Any help it's apriciated Car Model class Car(models.Model): brand = models.charfield(...) is_active= models.BooleanField(default=True) Service Model class Service(models.Model): car = models.ForeingKey('Car'....) name = models.Charfield() CreateView class ServiceCreateView(CreateView): model = Service form = ServiceForm ... Service HTML Template Service_form.html {% extends 'generic_base.html' %} {% load crispy_forms_tags %} <body> <script type="text/javascript"> $(document).ready(function() { $("#exampleModal").modalForm({ formURL: "{% url 'create-car' %}" }); }); </script> {%block content %} <div class="container"> <form method="POST"> {% csrf_token %} <div class="form-row"> <div class="form-group col-md-3 mb-0"> {{ form.car|as_crispy_field }} </div> <div class="form-group col-md-3 mb-0"> <button id ="botonmodal" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal">Add New Car</button> </div> </div> <input type="submit" value="Save" class="btn btn-success" /> </form> </div> <!-- Modal --> <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Car</h5> <button type="button" … -
Update django from 1 to 3 in a docker container: ModuleNotFoundError: No module named 'secret_key' when building the image
I have inherited a project in Django 1 and I am trying to convert to Django 3.1.3. To complicate things a bit I am running it in a docker container I have the following code: def generate_secret_key(file_name): chars = "abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)" key = get_random_string(50, chars) with open(file_name, "w") as f: f.write('SECRET_KEY = "%s"' % key) try: from secret_key import * except ImportError: SETTINGS_DIR = os.path.abspath(os.path.dirname(__file__)) generate_secret_key(os.path.join(SETTINGS_DIR, "secret_key.py")) from secret_key import * when I try building the image the following error occurs: Traceback (most recent call last): File "/mcvitty/mcvitty/settings.py", line 234, in <module> from secret_key import * ModuleNotFoundError: No module named 'secret_key' Line 234 is from secret_key import * The code was working in Django 1. If no secret key module is found, the function generate_secret_key should run generating the module secret_key.py and the program should procede smoothly but i get an error instead. What is different in Django 3.1.3? -
How can I get a user that is not the request.user in django m2m field when there's only 2 users inside the template?
I need to get a user for private message chat title from many2many field in Chat model containing 2 users: request.user and message receiver. How can I do that inside of the template? models.py class Chat(models.Model): title = models.TextField('Title', max_length=250) is_private = models.BooleanField(default=False) users = models.ManyToManyField(User, related_name='chat_users') If chat.is_private it can only have 2 users and I need to display the name of the other one for my chat heading. Currently it looks like this: {% for user in chat.users.all %} {% if user != request.user %} <a href="{% url 'chat' chat.pk %}">{{ user.name }}</a><br> {% endif %} {% endfor %} I was wondering if maybe there is a better way. -
How to send a post request via postman to nested writable serializer in django-rest-framework?
I'm really struggling with sending my data with postman in correct form to my Django backend. I followed the approach in the Django documentation for a writeable nested Seralizer and adapted it to my case. If I pass the data to my serializer via the shell, everything works and I can create the two object instances Story and File. But if I try to do the same with post man, it is not successful and receive the following error Message: Got AttributeError when attempting to get a value for field 'file' on serializer 'StoryCreateUpdateSerializer'. The serializer field might be named incorrectly and not match any attribute or key on the 'Story' instance. Original exception text was: 'Story' object has no attribute 'file'. Successfull Request via Shell: >>> data = { 'title': 'HALLLO', 'file': [ {'content': 'Public Service Announcement'}, {'content': 'Public Service Announcement'}, {'content': 'Public Service Announcement'}, ], } >>> serializer = StoryCreateUpdateSerializer(data=data) >>> serializer.is_valid() True >>> serializer.save() Not Successfull Request via Postman. Header: Content-Type: application/json. Body: Raw { "title": "Test", "file": [ { "content": "Hallo" } ] } My models and Serializers #MODELS class Story (models.Model): title = models.CharField(max_length=100,blank=True) author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, null=True) class File(models.Model): story = models.ForeignKey(Story,on_delete=models.CASCADE, null=True) … -
How to return current user's booking history in django rest framework?
I have created a booking api where user have to login to book a package ( holiday package). Now how can a user after login check their booking history that means the bookings that they made? That means I want to create an api where if a user clicks my bookings, it will return the bookings that the user has made. My booking model: class Booking(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) package = models.ForeignKey(Package, on_delete=models.CASCADE, related_name='package') name = models.CharField(max_length=255) email = models.EmailField() phone = models.CharField(max_length=255) bookedfor = models.DateField() created_at = models.DateTimeField(auto_now_add=True) class Package(models.Model): destination = models.ForeignKey(Destination, on_delete=models.CASCADE) package_name = models.CharField(max_length=255) featured = models.BooleanField(default=False) price = models.IntegerField() duration = models.IntegerField(default=5) discount = models.CharField(max_length=255, default="15% OFF") discounted_price = models.IntegerField(default=230) savings = models.IntegerField(default=230) special_discount = models.BooleanField(default=False) My booking serializer: class BookingSerializer(serializers.ModelSerializer): # blog = serializers.StringRelatedField() class Meta: model = Booking fields = ['name', 'email', 'phone', 'bookedfor'] # fields = '__all__' My booking view: class BookingCreateAPIView(CreateAPIView): permission_classes= [IsAuthenticated] queryset = Booking.objects.all() serializer_class = BookingSerializer def perform_create(self, serializer): # user = self.request.user package = get_object_or_404(Package, pk= self.kwargs['pk']) serializer.save(user=self.request.user,package=package) -
Python sorted function on queryset objects
I am first trying to sort by created_on descending and then using the same product_users queryset and applying sorted function on foreign_key user object where field is name. But not able to sort by name: Here 'user.name' is a fk relation what i have in ProductUser model. product_users = ProductUser.objects.filter(entity=entity).order_by('-created_on') product_users = sorted(product_users, key=attrgetter('user.name')) -
Create Django app with no User model - 3.1.3 wants to migrate auth_user?
I've got a Django application which has been happily humming along now for quite some time (2 years or so). It's on 3.0.10 currently - when I tried to upgrade to 3.1.3, it says there was a migration for the auth application. No worries! Never been an issue before... I ran python manage.py migrate and got the following error: "Cannot find the object "auth_user" because it does not exist or you do not have permissions." Which, I suppose would be true because we do not have a User model at all in this application. There is no auth_user table, that is correct. In other apps we have an AbstractUser that routes to a table named: org_user - but again: this particular app (and project) do not have any User model associated with them Obviously this (apparently, now) leads to some issues. Any thoughts on how to get around this? I thought about removing auth from installed apps and tried that but it led to more issues when trying to runserver. -
How to create some group of user without password in django?
I am developing multivender ecommerce site in django. In which, i dont want to authenticate some group of user i.e. customer with password but want to authenticate venders with password. How can i do that? -
"<field>":["This field is required."] message Django REST framework
so today I have been trying to implement the Django REST framework for the first time to my project, everything has been working fine I can create, update, and delete post using the browser interface that the framework provides, but after integrating the JWT token and trying to create a post using curl I always get the message "":["This field is required."] . I have tried to troubleshoot it in many ways but there is no way to parse the fields that I need to correctly. I even was able to create a Post using curl but I had to modify the fields to be all "nulls". Am I sending a wrong curl request ? curl: (note that if I add -H "Content-Type: application/json" I get this output {"detail":"JSON parse error - Expecting property name enclosed in double quotes: line 1 column 2 (char 1)"} that has been already solved here Json parse error using POST in django rest api by removing the content-type header) curl -X POST -H "Authorization: JWT <token>" -d '{ "title": "Helloooo", "content": "Hi", "schools": null, "course": null, "classes": [ 1 ], "isbn": 12312, "semester": null, "visible": false }' 'http://127.0.0.1:8000/api/posts/create/?type=post' This is the output that I … -
How to save nested JSON from response?
I have a nested JSON with array, process the response, and now I'm trying to save it into the database (postgresql) but I get this error: django.db.utils.ProgrammingError: column "created_date" of relation "feedback_patient" does not exist LINE 1: ..., "first_name", "last_name", "email", "language", "created_d... ^ this is my model.py class Patient(models.Model): coreapi_id = models.CharField(max_length=100) first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) email = models.EmailField(max_length=100) language = models.CharField(max_length=20) created_date = models.DateTimeField(default=True) lastmodified_date = models.DateTimeField(default=True) def __str__(self): return self.email and my views.py where I fetch the API def fetchapi_patients(request): url = 'https://dev-api.prime.com/api/v1/plugins/get-patients' headers={"Authorization":"Bearer eyJ0eXAiOiJKV1JIUzI1NiJ9.eyJpYXQiOjE2MDU2MTkwNzUsImlzcyI6Imh0dHA6XC9cLZyIsImZpcnN0X25hbWUiOiJNaXJvc2xhdiIsImxhc3RfbmF"} response = requests.get(url, headers=headers) #Read the JSON patients = response.json() #Create a Django model object for each object in the JSON and store the data in django model (in database)""" for patient in patients['data']['records']: print(patient['Id']) Patient.objects.create(first_name=patient['FirstName'], last_name=patient['LastName'], email=patient['PersonEmail'], language=patient['Language__c'], coreapi_id=patient['Id'], created_date=patient['CreatedDate'], lastmodified_date=patient['LastModifiedDate']) return JsonResponse({'patients': patients}) and this is my json: "data": { "totalSize": 2, "done": true, "records": [ { "attributes": { "type": "Account", "url": "/services/data/v39.0/sobjects/Account/00126000011" }, "Id": "00126000011", "PersonEmail": "test@gmail.com", "FirstName": "Test", "LastName": "Mike", "Language__c": "Deutsch", "CreatedDate": "2020-11-09T14:48:47.000+0000", "LastModifiedDate": "2020-11-17T12:56:50.000+0000" }, Can anyone see what I'm missing? -
DRF django-rest-framework-simplejwt JWTAuthentication not working
Ideally using django-rest-framework-simplejwt and the authentication class JWTAuthentication, the API should give 403 when I pass the token incorrectly. Instead, when I am making my API request it is executing successfully even without the Authentication token. This is a dummy API, my concern is the Authentication should work. My code looks like this: class ViewSet(viewsets.ModelViewSet): queryset = get_user_model().objects.all() serializer_class = SomeSerializer http_method_names = ("post", "patch") authentication_classes = (JWTAuthentication,) When I debug I see that it is executing JWTAuthentication, which in turn returns None. Which is expected since I am not passing the Token in the header. def authenticate(self, request): header = self.get_header(request) if header is None: return None Now I think the View should give Permission Denied, which is not happening. Not able to understand what is missing here. -
Django process\integrate with payment gateway
I am working on Django ecommerce project, at the checkout page "last page". I already have the customer data and order data, and I want to integrate with the payment gateway. As per the payment gateway documentation, I need to:- 1- Execute the payment Send the customer and some order data in Json format to their end point URL as follow baseURL = "https://apitest.gateway.com" token = 'mytokenvalue' #token value to be placed here def execute_payment(): url = baseURL + "/v2/ExecutePayment" payload = "{\"CustomerName\": \"Name\",\"MobileCountryCode\": \"+001\"," \ "\"CustomerMobile\": \"12345678\",\"CustomerEmail\": \"email@gateway.com\",\"InvoiceValue\": 100," \ "\"DisplayCurrencyIso\": \"USD\",\"CallBackUrl\": \"https://google.com\",\"ErrorUrl\": " \ "\"https://google.com\",\"Language\": \"en\",\"CustomerReference\": \"ref 1\",\"CustomerCivilId\": " \ "12345678,\"UserDefinedField\": \"Custom field\",\"ExpireDate\": \"\",\"CustomerAddress\": {\"Block\": " \ "\"\",\"Street\": \"\",\"HouseBuildingNo\": \"\",\"Address\": \"\",\"AddressInstructions\": \"\"}," \ "\"InvoiceItems\": [{\"ItemName\": \"Product 01\",\"Quantity\": 1,\"UnitPrice\": 100}]}" headers = {'Content-Type': "application/json", 'Authorization': "Bearer " + token} response = requests.request("POST", url, data=payload, headers=headers) print("Execute Payment Response:\n" + response.text) 2- The gateway response should be as follow { "IsSuccess": true, "Message": "Invoice Created Successfully!", "ValidationErrors": null, "Data": { "InvoiceId": 12345, "IsDirectPayment": true, "PaymentURL": "https://apitest.gateway.com/v2/DirectPayment/03052193209041/6", "CustomerReference": "ref 1", "UserDefinedField": "Custom field" } } 3- I should route my customer to the PaymentURL received in the GW response My questions are:- 1- How I inject the needed data in the … -
Django check if time is available in slot using models
I have the following model: class Order(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) time = models.DateTimeField() How would I check if a time that I specify is within 1 hour of any of the orders' times by user 1. Example: I specify a time and post it to an endpoint, the endpoint checks if the giver time is within an hour of any of the other orders with User 1. How would I check if the time is within 1 hour of any of teh order models? -
How do we POST data in django rest framework using function based views?
I am new to django rest framework (DRF) and I need to POST some data using function based views (FDV). I successfully used GET method using this way but have no idea how to use POST method to add values to database. # models.py class Item(models.Model): name = models.CharField(max_length=50) quantity = models.IntegerField() price = models.FloatField() # app/urls.py urlpatterns = [ path('', views.get_data_list, name='list'), path('post_val/', views.post_data, name='post_val'), # need to implement ] # app/serializers.py class ItemSerializer(serializers.ModelSerializer): class Meta: model = Item fields = ('id', 'name', 'quantity','price') # app/views.py from django.http.response import JsonResponse from rest_framework.parsers import JSONParser from .models import Item from .serializers import ItemSerializer from rest_framework.decorators import api_view @api_view(['GET',]) def get_data_list(request): if request.method == 'GET': items = Item.objects.all() items_serializer = ItemSerializer(items, many=True) return JsonResponse(items_serializer.data, safe=False) @api_view(['POST',]) def post_data(request): #TO DO If I want to add this new data like this one {name:"Television", quantity:15, price:999.99} to Item table using POST method, How do we do it in FDV? -
Django admin groups permissions and access
I'm searching for a way to customize the Django Administration to support permissions and data based on the user group. For example, I've just created the Developers1, Developers2 groups.. now I've also created the Transaction model, with AdminModel to specify how to list data. what im trying to do is i want each group to only access its own Transaction model, and each group can only add, delete, update and view their own Transactions (eg developers1 group cant access developers2 Transactions and vice versa) any thoughts should be appreciated thanks!:) -
How to make vuejs search work in Django app on heroku?
I worked on a Django project where I am using vuejs for search functionality by creating an API. It works fine on my system. but when I deploy it on Heroku it stops working. search shows nothing. I am using https://unpkg.com/vue@next to use vuejs not cli. I don't understand what's wrong. do I need to do anything before deploying? -
Caching for a REST API made with Django Rest Framework
I am building a REST API with Django + Django Rest Framework, and now I am concerned about adding some cache to improve the response time. I've already configured Redis as a cache backend. I have seen that Django has multiple cache mode, like per-site or per-view, where you have to configure a cache time. My main concern is about avoiding stale responses. Let's say I configured a 5min cache when listing some resources. The user navigates to this list, then POSTs a resource and comes back to the list. If the list is cached for 5 minutes the first time, How can I avoid that he gets a cached result without the added resource the second time he displays the view? I was expecting some kind of "automatic smart cache" that would be enabled for GET requests and cleared after receiving a PUT or POST request. But...well, I can't find anything like this. I have seen that it is possible to configure the cache with Django's low level API cache.add and cache.delete. But this does not seem to be a good solution as it would ask a lot of custom code for each view. I would prefer to seperate … -
Razorpay Python Track Failed Transaction or Payments
I am using Razorpay for my websites payment gateway, I am using pythons razorpay library for payment integration, I am able to get the payments that are successfully captured in my Django Admin(I am using Django version 2.2.3), but I am unable to get the payments that are failed, can anyone help me how can I keep a track on my failed payments.. THANK YOU, -
I have error when migrating my db in django-python
i change my database django default to postgresql and when i try to migrating ... django.db.utils.OperationalError: FATAL: password authentication failed for user "hamid" my settings is install psycop2 but i dont understad my mistake becuse i can enter to shell database by this password but when i migrating i have error DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'postgres', 'USRE': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'localhost', 'PORT': '5432', } } and my docker-compose.yml version: '3' services: blogpy_postgresql: image: postgres:12 container_name: blogpy_postgresql volumes: - blogpy_postgresql:/var/lib/postgresql/data restart: always env_file:.env ports: - "5432:5432" networks: - blogpy_network volumes: blogpy_postgresql: external: true networks: blogpy_network: external: true and my .env POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=postgres and my traceback File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 217, in ensure_connection self.connect() File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/db/backends/base/base.py", line 195, in connect self.connection = self.get_new_connection(conn_params) File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/db/backends/postgresql/base.py", line 178, in get_new_connection connection = Database.connect(**conn_params) File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/psycopg2/__init__.py", line 127, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL: password authentication failed for user "hamid" The above exception was the direct cause of the following exception: Traceback (most recent call last): File "./manage.py", line 21, in <module> main() File "./manage.py", line 17, in main execute_from_command_line(sys.argv) File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/hamid/Documents/django/venv/lib/python3.8/site-packages/django/core/management/base.py", … -
Android - Access static file on Django server using Glide fails
I have the following Django model : class MyAccount(AbstractBaseUser): ... profile_picture = models.FileField(upload_to='Images/',default='Images/placeholder.jpg') ... When the user creates this account, he gets a default placeholder image. The registration of the user ( creation of the MyAccount instance for a particular user) works as expected. But my Android App can not get the placeholder image when it is requested. On my local Django development server, I get the following error: [17/Nov/2020 12:54:34] "GET /media/Images/placeholder.jpg HTTP/1.1" 404 2569 Not Found: /media/Images/placeholder.jpg Why is this happening? The image placeholder.jpg exists, so how it can be that the file is not found ? In the LogCat output of Android Studio, I get a similar error when I filter for okhttp. You can also see that the registration is done correctly but the file is not found: 2020-11-17 13:54:32.852 5825-5924/com.example.project D/OkHttp: {"response":"successfully authenticated.","id":1,"email":"abdullah@gmail.com","username":"abdullahc","profile_picture":"http://192.***.*.***:8000/media/Images/placeholder.jpg","date_joined":"2020-11-17T12:54:30.702559Z","token":"88b8ea2cf59ba851f7bac1751946213f5ee5afe9"} 2020-11-17 13:54:32.852 5825-5924/com.example.project D/OkHttp: <-- END HTTP (287-byte body) 2020-11-17 13:54:33.854 5825-5825/com.example.project I/Glide: Root cause (1 of 1) java.io.FileNotFoundException: http://192.168.2.104:8000/media/Images/placeholder.jpg at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:251) at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:102) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:56) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.startNextOrFail(MultiModelLoader.java:164) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onLoadFailed(MultiModelLoader.java:154) at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:62) at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:310) at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:279) at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)