django-oscar

How to add custom benefit in django-oscar?

一笑奈何 提交于 2021-02-08 11:38:40
问题 Django-oscar provides multibuy benefit type. class MultibuyDiscountBenefit(Benefit): _description = _("Cheapest product from %(range)s is free") Now, I can add Buy 1 get 1 free offer with this benefit. I have a little custom requirement here. I want to add 'Buy 1 get 50% off on second' offer. To do so, I need to add custom benefit. I checked docs for adding custom benefit. And as per doc says.. A custom benefit can be used by creating a benefit class and registering it so it is available to

Django app does not load images from AWS bucket's media folder

心不动则不痛 提交于 2021-02-07 04:21:15
问题 I'm using django-oscar ,and wanted to serve my static files with AWS S3. To config my s3 bucket I've created a module called aws with conf.py and utils.py files. On my website when I upload an image to the product it gets uploaded well with the correct path to my aws s3 bucket, but then after very short time the path changes from https://mybucketname.s3.amazonaws.com/media/cache/..../image.jpg to https://mybucketname.s3.amazonaws.com/cache/..../image.jpg The images are in the media folder in

Customize dashboard catalogue forms in Django Oscar doesn't work

只愿长相守 提交于 2020-04-18 05:48:17
问题 I have followed the main documentations for django oscar. and I am trying to add a new field to product named video_url. first I add the new field to product models and it worked fine. catalogue/models.py from django.db import models from oscar.apps.catalogue.abstract_models import AbstractProduct class Product(AbstractProduct): video_url = models.URLField(null=True, blank=True) from oscar.apps.catalogue.models import * and then I continue to customize the catalogue dashboard but it seems

'staticfiles' is not a valid tag library: Template library staticfiles not found

这一生的挚爱 提交于 2020-02-01 10:36:19
问题 hey guys i am trying django-oscar tutorial from http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html but i am getting a 'staticfiles' is not a valid tag library: Template library staticfiles not found, tried django.templatetags.staticfiles,django.contrib.flatpages.templatetags.staticfiles,compressor.templatetags.staticfiles,oscar.templatetags.staticfiles,haystack.templatetags.staticfiles,treebeard.templatetags.staticfiles,sorl.thumbnail.templatetags.staticfiles any

'staticfiles' is not a valid tag library: Template library staticfiles not found

家住魔仙堡 提交于 2020-02-01 10:34:26
问题 hey guys i am trying django-oscar tutorial from http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html but i am getting a 'staticfiles' is not a valid tag library: Template library staticfiles not found, tried django.templatetags.staticfiles,django.contrib.flatpages.templatetags.staticfiles,compressor.templatetags.staticfiles,oscar.templatetags.staticfiles,haystack.templatetags.staticfiles,treebeard.templatetags.staticfiles,sorl.thumbnail.templatetags.staticfiles any

'staticfiles' is not a valid tag library: Template library staticfiles not found

不打扰是莪最后的温柔 提交于 2020-02-01 10:34:10
问题 hey guys i am trying django-oscar tutorial from http://django-oscar.readthedocs.org/en/latest/internals/getting_started.html but i am getting a 'staticfiles' is not a valid tag library: Template library staticfiles not found, tried django.templatetags.staticfiles,django.contrib.flatpages.templatetags.staticfiles,compressor.templatetags.staticfiles,oscar.templatetags.staticfiles,haystack.templatetags.staticfiles,treebeard.templatetags.staticfiles,sorl.thumbnail.templatetags.staticfiles any

django oscar invoice pdf generation

℡╲_俬逩灬. 提交于 2020-01-16 18:39:05
问题 Hi I am trying to set up invoice generation for django oscar. I have found a useful link https://groups.google.com/forum/#!topic/django-oscar/sg1qtyuu32Q (two main links from this google groups are https://gist.github.com/elbaschid/8722203 and https://gist.github.com/elbaschid/8776935) but I am having an issue trying to set this up. I saved my templates as suggested in the link and the below is the code under OrderListView: def generate_packing_slips(self, request, orders): template = loader

Django Oscar - email admin on order placed

我的未来我决定 提交于 2020-01-11 07:50:16
问题 I am trying to get django-oscar to send me an email everytime an order is placed. It sounds simple but I am struggling. I have tried a couple of methods but all failed... Is there an easy way? 回答1: You can set up a listener for the order_placed signal, and then do whatever actions you want there. from django.dispatch import receiver from oscar.apps.order.signals import order_placed @receiver(order_placed) def send_merchant_notification(sender, order, user, **kwargs): # Do stuff here

django heroku media files 404 error with amazon s3

浪子不回头ぞ 提交于 2020-01-06 13:56:54
问题 So i have followed this question How to set-up a Django project with django-storages and Amazon S3, but with different folders for static files and media files? in order to get my django app uploading media files to my amazon S3 bucket. I am using django-oscar by the way. Everything seemed to work fine right after i uploaded the image, but when i reload the page, the images disappear and i get a 404 error. My static files work fine.. i have found no problems. UPDATE: I have changed my bucket

Django view only returning incomplete data, only one field to template

旧街凉风 提交于 2020-01-03 06:29:08
问题 I have forked the django-oscar catalogue app to alter the models being used. Not in a major way, and not in a way that would affect pulling data from the database as far as I can see. This seems to be supported by the fact the the django-oscar dashboard still works fine and lets me add and view products. My models.py from my forked app: from django.db import models class Collection(models.Model): name = models.CharField(max_length=50) prod_category = models.CharField(max_length=50)