Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How can I display data stored in a Django model using CSS styles?
I have a for loop to display an image, title and description from a Django model, and it works good. but I want the title and description to be displayed as overlay on the image. Is there any way to do that? This code displays the data: <div class="tz-gallery"> <div class="row"> {% for service in services %} <div class="col-sm-6 col-md-4"> <h6 class="text-center">{{service.title}}</h6> <a class="lightbox" href="{{service.image.url}}"> <img src="{{service.image.url}}" alt="Park"> </a> <p>{{service.content}}</p> </div> {% endfor %} </div> </div> And I want the service.title and service.image.url to be displayed with this css style while the for loop iterates .tz-gallery .lightbox:after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; background-color: rgba(46, 132, 206, 0.7); content: ''; transition: 0.4s; } .tz-gallery .lightbox:hover:after, .tz-gallery .lightbox:hover:before { opacity: 1; } How could I do that? -
Django Models Design: Solo-Player OR Team with players in Game
I'm designing a Django based webinterface for a game which can be played eiter solo OR as a team. A game is based on points; First party to reach set number of points wins. For later statistics and displaying, points have a timestamp. My Problem: How can I have either two Players OR two Teams in one Game? My Models look like this at the moment: from django.db import models # Create your models here. class Player(models.Model): slug = models.SlugField(unique=True) # will be autogenerated when inserting new Instance name = models.CharField(max_length=100) wins = models.IntegerField() losses = models.IntegerField() picture = models.ImageField(upload_to='images/player_pics') # games_played = wins + losses def __str__(self): return self.name class Team(models.Model): slug = models.SlugField(unique=True) name = models.CharField(max_length=100) players = models.ManyToManyField(Player) wins = models.IntegerField() # from here on seems redundant to Player class losses = models.IntegerField() picture = models.ImageField(upload_to='images/team_pics') # games_played = wins + losses def __str__(self): return self.name class Point(models.Model): val = models.IntegerField() timestamp = models.DateTimeField() class Game(models.Model): slug = models.SlugField(unique=True) timestamp = models.DateTimeField() players = models.ManyToManyField(Player) # here should be either Team or Player points = models.ManyToManyField(Point) My Idea was to implement another class like GameParty which can be either a Player or a Team but the same … -
How to not trigger `m2m_changed` signal when updating many to many relationship in Django?
The Use Case In my case, I have two signals that are listening on two 2 m2m fields, each of those fields are in different models. The problem happens when one signal is triggered, it triggers the other signal and vice versa, which will result in a recursive loop which will never ends. I need a convenient way to run one signal without triggering the second signal. Understand More If you are curious to know how this case could happen: I have two models which I need to make them mutually synced; if I updated the m2m field in the one model, I need those changes to be reflected on another m2m field in another model and vice versa. -
Unable to restore DB after Database change to Postgres (Django)
I have migrated from SQLite to Postgres, but now I am unable to restore my data on Postgres, i am using Django db-backup package, it is giving me this error on dbrestore command Traceback (most recent call last): File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 22, in <module> main() File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line utility.execute() File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 398, in execute output = self.handle(*args, **options) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\management\commands\dbrestore.py", line 53, in handle self._restore_backup() File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\management\commands\dbrestore.py", line 94, in _restore_backup self.connector.restore_dump(input_file) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\base.py", line 92, in restore_dump result = self._restore_dump(dump) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\postgresql.py", line 56, in _restore_dump stdout, stderr = self.run_command(cmd, stdin=dump, env=self.restore_env) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\postgresql.py", line 21, in run_command return super(PgDumpConnector, self).run_command(*args, **kwargs) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\dbbackup\db\base.py", line 150, in run_command raise exceptions.CommandConnectorError( dbbackup.db.exceptions.CommandConnectorError: Error running: psql --host=localhost --port=5432 --username=postgres --no-password --set ON_ERROR_STOP=on --single-transaction postgres ERROR: syntax error at or near "AUTOINCREMENT" LINE 1: ...S "auth_group" ("id" integer NOT NULL PRIMARY KEY AUTOINCREM... -
AttributeError: 'function' object has no attribute 'as_view' | Django
Don't know why this error occur. ERROR Watching for file changes with StatReloader Performing system checks... Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\Qasim Iftikhar\anaconda3\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Qasim Iftikhar\anaconda3\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 118, in inner_run self.check(display_num_errors=True) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\core\management\base.py", line 419, in check all_issues = checks.run_checks( File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\core\checks\registry.py", line 76, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\core\checks\urls.py", line 13, in check_url_config return check_resolver(resolver) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\core\checks\urls.py", line 23, in check_resolver return check_method() File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\urls\resolvers.py", line 412, in check for pattern in self.url_patterns: File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\urls\resolvers.py", line 598, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\utils\functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Users\Qasim Iftikhar\anaconda3\lib\site-packages\django\urls\resolvers.py", line 591, in urlconf_module return import_module(self.urlconf_name) File "C:\Users\Qasim Iftikhar\anaconda3\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module … -
Jquery CurrentLink Detector with wildcard support for django?
I have a snippet which words good on html files, as it check filename and compare url to make menu active ! It also works on web framework like django, but the problem is that it doesnt support sub urls, Menu changes active, when i go to "example.com/profile" But it doesnt gets active when i go to "example.com/profile/another/123" How to make this snippet which can support wildcard urls' I need it to make active irrespective to what comes after the /profile CurrentLink = function(){ var _link = '.nk-menu-link, .menu-link, .nav-link', _currentURL = window.location.href, fileName = _currentURL.substring(0, (_currentURL.indexOf("#") == -1) ? _currentURL.length : _currentURL.indexOf("#")), fileName = fileName.substring(0, (fileName.indexOf("?") == -1) ? fileName.length : fileName.indexOf("?")); $(_link).each(function() { var self = $(this), _self_link = self.attr('href'); if (fileName.match(_self_link)) { self.closest("li").addClass('active current-page').parents().closest("li").addClass("active current-page"); self.closest("li").children('.nk-menu-sub').css('display','block'); self.parents().closest("li").children('.nk-menu-sub').css('display','block'); } else { self.closest("li").removeClass('active current-page').parents().closest("li:not(.current-page)").removeClass("active"); } }); }; This is the snippet ! Am asking this for django -
How to unpack OrderedDict in python?
serializers.py def create(self, validated_data): choice_validated_data = validated_data.pop('choices') print("jdsfd this from vdata sdjfdsjf", validated_data) question = Question.objects.create(**validated_data) for each in choice_validated_data: choice = Choice.objects.create(text=each, question=question) choice.save() return question Output i want... { "title": "Added from admin", "choices": [ { "id": 144, "text": "asdf1" }, { "id": 145, "text": "asdf2" } ] } Can anyone help me out to fix this issue, I am facing it from almost 5 days. Please can anyone fix the code. -
Duplicate key value violates unique constraint Dajngo python
My goal. If the id matches, you need to update the creation time column in the model. I can't figure out how I can solve this problem. It doesn't seem complicated, but I'm stuck. if a:=Defect.objects.get(id_leather=id_file_name) == True: a.update(created=datetime.datetime.now()) else: Defect.objects.create(id_leather=id_file_name, path=path_file_save) Models.py class Defect(models.Model): created = models.DateTimeField(auto_now_add=True) Error: django.db.utils.IntegrityError: duplicate key value violates unique constraint "files_defect_id_leather_key" DETAIL: Key (id_leather)=(9998) already exists. -
Get distinct titles from product list with min and max price of that product title in django
I have list of products with same title but of different price. This is my Product model: class Product(BaseModel): title = models.ForeignKey( ProductTitle, on_delete=models.CASCADE, related_name="product_title", null=True, blank=True, ) quantity = models.PositiveIntegerField(default=1) price = models.FloatField(validators=[MinValueValidator(0.00)]) unit = models.CharField( max_length=20, blank=True, null=True, help_text="Standard measurement units.eg: kg, meter,etc..", ) description = models.TextField( blank=True, null=True, help_text="Short Info about Product" ) slug = models.SlugField(null=False, unique=True) Say, I have 10 products of same title but with different price, and same goes for other products as well. Now i want to get single(distinct) product of particular title with Min and Max price for that product and so on. So, i should get say Orange with min and max price, apple with min and max price and so on. I have tried some ways but its not working. Like in this query its giving me: product_qs = ( Product.objects.filter(is_deleted=False) .order_by("title__title") .distinct("title__title") ) p_list = product_qs.values_list("title", flat=True) product_list = product_qs.filter(title__in=p_list).annotate( max_price=Max("price"), min_price=Min("price") ) NotImplementedError at /api/product/unique_product/ annotate() + distinct(fields) is not implemented. Can somebody help me with this -
How to make certain field not visible in an api output using python and django?
i have parent (AccessInternalSerializer) and child serializer (AccessSerializer) classes like below, class AccessInternalSerializer(AccessBaseSerializer): private_key = serializers.FileField( allow_null= True, required=False) ca_cert=serializers.FileField( allow=True, required=False) def to_representation(self, obj): data = super().to_representation(obj) data['private_key'] = obj.private_key data['ca_cert'] = obj.ca_cert return data class Meta(AccessBaseSerializer.Meta): model=Access extra_kwargs = { 'auth_failure': { read-only: True } } class AccessSerializer(AccessInternalSerializer): private_key = serializers.FileField( write_only=True, allow_null=True, required=False) ca_cert=serializers.FileField( write_only=True, allow_null=True, required=False) class Meta(AccessInternalSerializer.Meta): extra_kwargs={ **AccessInternalsSerializer.Meta.extra_kwargs, 'private_key': { 'write_only':True, } 'ca_cert': { 'write_only': True, } } Now with above code for some reason private_key and ca_cert are shown in the output of api using AccessSerializer. with AccessInternalSerializer to_representation i make the private_key and ca_cert fields visible in api output that uses AccessInternalSerializer. however it behaves the same using AccessSerializer. i expect the api output to not return private_key and ca_cert fields using AccessSerializer. I am not sure where i am going wrong. i am new to python and django programming. i am stuck with this from long time. could someone help me with this. thanks. -
How to Fix django migrate issue?
I am try to run my django project before run I did makemigrations all my apps and then I run command migrate but I am getting this error I am not able to understand what exactly this error. Please help. -
Using CDN fro django-jet theme's Static Files
Can i move every Static file related to Django-jet (like static/admin/css/autocomplete.css) theme to CDN ? Is it required to keep the referenced libraries within code base ? -
Free SMTP for Django Projects
What is the best Free SMTP Service for website? Also what are the Django settings for the same. Currently, I am developing a Django project based on amounts due to pay in the organization. The person whose amount are due should get a proper email notification regarding the remaining amount to be paid. So I want to use a free SMTP service for the base usage. -
Sum multiple annotates in django orm
Here's my model: class Product: name = models.CharField(max_length=80) price = models.FloatField() category = models.CharField(max_length=40) class ProductInventory: inventory = models.IntegerField() product = models.OneToOneField(Product, on_delete=models.RESTRICT) and here's raw sql of what I want to achieve but how do I write this in django ORM? SELECT product.category, SUM(price) * SUM(product_inventory.inventory) FROM product LEFT JOIN product_inventory ON product.id=product_inventory.product_id group by product.category; Thank you. -
django.db.utils.ProgrammingError: table does not exist after migrating to Postgres from SQLite
After changing my settings and migrating to Postgres I am getting this error while performing migrations, I previously deleted all my migration folders because I had a similar issue with database inconsistency, now I don't have any migrations in my app-level directories, I do have DB backup but, how do I get past this, any help is appreciated, thanks in advance Db Settings DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'mypass', 'HOST': 'localhost', 'PORT': '5432', } } Trace Traceback (most recent call last): File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 22, in <module> main() File "C:\Users\atifs\Documents\food_deliveryapp\fooddelivery\manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 419, in execute_from_command_line utility.execute() File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 398, in execute output = self.handle(*args, **options) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\base.py", line 89, in wrapped res = handle_func(*args, **kwargs) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\core\management\commands\migrate.py", line 244, in handle post_migrate_state = executor.migrate( File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\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 "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\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 "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\db\migrations\executor.py", line 230, in apply_migration migration_recorded = True File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\db\backends\base\schema.py", line 118, in __exit__ self.execute(sql) File "C:\Users\atifs\Documents\food_deliveryapp\virtual-env\lib\site-packages\django\db\backends\base\schema.py", line 145, in execute … -
django.db.utils.IntegrityError: (1364, "Field 'name' doesn't have a default value")
I'm Facing This Error Whenever I am trying to execute the python manage.py migrate command then, Please Help Us. -
Set attribute based on another attribute
How to set hostel choices based on gender? Global variables BOYS_HOSTEL_CHOICES = (...) GIRLS_HOSTEL_CHOICES = (...) class Student(models.Model): MALE = 'M' FEMALE = 'F' #... GENDER_CHOICES = ( (MALE, 'Male'), (FEMALE, 'Female') ) gender = models.CharField( max_length = 10, choices = GENDER_CHOICES, verbose_name="gender", ) hostel = models.CharField( max_length=40, choices = BOYS_HOSTEL_CHOICES if gender == 'M' # <--- else GIRLS_HOSTEL_CHOICES, default = 'some hostel' ) -
drf spectacular not showing query params in swagger ui
I have generic ListAPIView with following list request function. Here category is a query parameter. I am trying to achieve such that the swagger ui also shows the query parameter in the swagger ui doc. How to achieve this? I have the following code. @extend_schema( parameters=[ OpenApiParameter(name='category',location=OpenApiParameter.QUERY, description='Category Id', required=False, type=int), ], ) def list(self, request, *args, **kwargs): category_id = request.query_params.get('category') .... return Response(data) -
How can I find out which mange.py is running?
On a Ubuntu machine, there is a Django process $ ps aux | grep 8010 xxx 5790 0.0 0.0 75228 12 ? S 2019 0:00 python manage.py runserver 0.0.0.0:8010 How can I find out the absolute path to this manage.py? -
Custom Authentication returning NULL everytime in django
I am beginner in django and I want to build authentication using custom user model. I have asked question Here. I have been advised to inherit the User Model. I created custom user model. As all the password are stored using bcrypt function so I created my own custom authentication. Now every time I login, I am getting None even if my password is correct. I want to know what I am missing? models.py class AdminUserManager(BaseUserManager): def create_user(self, username, password): if username is None or password is None: raise ValueError("Username and Password is Required") else: user = self.model( username = username, password = str(bcrypt.hashpw(password.encode('utf8'),bcrypt.gensalt()),'utf-8') ) user.save(using=self.db) return user class AdminUsers(AbstractBaseUser): username=models.CharField(max_length=50,unique=True) firstname=models.CharField(max_length=50) department=models.CharField(max_length=50) mail=models.CharField(max_length=50) id=models.IntegerField(primary_key=True) password=models.CharField(max_length=200) # some more field USERNAME_FIELD = 'username' REQUIRED_FIELDS = ['mail'] objects = AdminUserManager() class Meta: db_table="admin_users" def __str__(self): return self.username backend.py from .models import AdminUsers import bcrypt class CustomAuthentication(object): def authenticate(self,username,password): if username is not None and password is not None: user = AdminUsers.objects.get(username=username) hashed_password = user.password is_check = bcrypt.checkpw(password.encode('utf8'),hashed_password.encode('utf8')) if is_check == True: return user else: return None else: return None def get_user(self,id): user = AdminUsers.objects.get(id=id) if user is not None: return user else: return None views.py def login(request): if request.method == 'POST': … -
Is Django is necessary for data science and machine learning
In my experience, Django has been a really great choice for data science projects. This is a common scenario I've found in freelancing, and in having conversations with other developers; typically in companies that are working with data, whether it's a service they provide to their clients or it's for internal tools. Traditionally the company starts by using Microsoft Excel. Over time those companies want their data to be more flexible and want to start doing things that are more demanding than what traditional spreadsheets can provide. They'll then start looking at custom solutions to improve their processes. Data science machine learning + django What do you think Django can improve our data science projects. is Django necessary for a good data scientist or machine learning engineer? -
Can't set a password for costume user model in the admin page
I'm working on an app where I have Users with multiple role, Customers, and Employees, where employees also are in different roles: Drivers and administration. I used AbstractBaseUser model to set a customized user model as this: class UserAccountManager(BaseUserManager): def create_superuser(self, email, first_name, last_name, password, **other_fields): other_fields.setdefault("is_staff", True) other_fields.setdefault("is_superuser", True) other_fields.setdefault("is_active", True) other_fields.setdefault("is_driver", True) other_fields.setdefault("is_customer", True) other_fields.setdefault("is_responsable", True) if other_fields.get("is_staff") is not True: raise ValueError(_("Supperuser must be assigned to is_staff.")) if other_fields.get("is_superuser") is not True: raise ValueError(_("Superuser must be assigned to is_superuser.")) return self.create_user(email, first_name, last_name, password, **other_fields) def create_user(self, email, first_name, last_name, password, **other_fields): if not email: raise ValueError(_("You must provide an email address")) email = self.normalize_email(email) user = self.model(email=email, first_name=first_name, last_name=last_name, **other_fields) user.set_password(password) user.save() return user class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(_("Email Address"), unique=True) first_name = models.CharField(_("First Name"), max_length=150, unique=True) last_name = models.CharField(_("Last Name"), max_length=150, unique=True) mobile = models.CharField(_("Mobile Number"), max_length=150, blank=True) is_active = models.BooleanField(_("Is Active"), default=False) is_staff = models.BooleanField(_("Is Staff"), default=False) is_driver = models.BooleanField(_("Is Driver"), default=False) is_responsable = models.BooleanField(_("Is Responsable"), default=False) is_customer = models.BooleanField(_("Is Customer"), default=False) created_at = models.DateTimeField(_("Created at"), auto_now_add=True, editable=False) updated_at = models.DateTimeField(_("Updated at"), auto_now=True) objects = UserAccountManager() USERNAME_FIELD = "email" REQUIRED_FIELDS = ["first_name", "last_name"] class Meta: verbose_name = "Account" verbose_name_plural = "Accounts" def __str__(self): … -
How to insert a 3d model and display in django
class orders(models.Model): orderitem = models.CharField(max_length=100) orderprice = models.CharField(max_length=100) 3dimage = models.ImageField(max_length=100) '''can we use the image format in the model to insert a 3d model''' -
Django - Write test to upload multiple Images
I have this code below that generates a fake image then tries to send it to this endpoint. I have a breakpoint at the first line of def post(self, request) and when I look into request.data I don't see an images key and when I do request.FILES, it's an empty multi-dict. I'm trying to allow the user to upload multiple images, which is why it's in a list. How do I properly add images to a request to test upload? test.py from django.core.files.base import ContentFile from PIL import Image from six import BytesIO def create_image(storage, filename, size=(100, 100), image_mode='RGB', image_format='PNG'): """ Generate a test image, returning the filename that it was saved as. If ``storage`` is ``None``, the BytesIO containing the image data will be passed instead. """ data = BytesIO() Image.new(image_mode, size).save(data, image_format) data.seek(0) if not storage: return data image_file = ContentFile(data.read()) return storage.save(filename, image_file def test_image_upload_authorized(self): image = create_image(None, 'test.png') image_file = SimpleUploadedFile('test.png', image.getvalue()) response = self.client.post(reverse('post'), data={'creator_id': str(self.user.uuid), 'images': [image_file]}, content_type='application/json') self.assertEqual(response.status_code, status.HTTP_201_CREATED) view.py def post(self, request): serializer = PostSerializer(data=request.data) if serializer.is_valid(): try: serializer.save() except django.db.utils.InternalError as e: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) return Response(serializer.data, status=status.HTTP_201_CREATED) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) -
InvalidParameterValueError - Source bundle is empty or exceeds maximum allowed size: 524288000
I use eb cli to deploy django applicatoin. It suddenly started showing error InvalidParameterValueError - Source bundle is empty or exceeds maximum allowed size: 524288000 while deploying my app using eb deploy command. It showing error for both my production and stating environment. My source bundle size should be below the limit. What is the cause and how to fix it?