EzDevInfo.com

satchless

E-commerce for Python Satchless — e-commerce for Python satchless brings e-commerce and python together. it provides the low-level classes and patterns so you can focus on your business logic and ui.

stroller (turbogears) not working

I'am trying to build an e-commerce website using turbogears. Initially I modified the tgapp-photos to make the items come on the page properly. But then I find it difficult to make cart from the scratch and hence thought to use stroller. However, when I'am plugging it in the config.py file, all of a sudden my app stops. And moreover it is not showing any error too, it just stops. Could someone please tell me what wrong am I doing. Can I use satchless or shoppingCart in the turbogears framework?


Source: (StackOverflow)

Where is the famous excellent documentation of Satchless?

It's not a joke. I'm trying to see if I'm missing something. In the official documentation, I see only a description and the claim that the framework is well-documented. I wonder where is this excellent documentation?

I need to write a simple demo e-shop with a simple list of products and integration with ipayment.de. The list, I can do easily. But where do I read on how to integrate the ipayment form with the shop?


Source: (StackOverflow)

Advertisements

Wrong static urls in Django Grappelli?

I'm trying to use django grappelli for admin and have a problems with static files paths.

I have this in my settings:

STATIC_URL = '/static/'
STATIC_ROOT =  os.path.join(PROJECT_ROOT, "static")

After collecting static I have all required static files in static directory with a paths like this:

/static/grappelli/js/smth.js

When I opening /admin/ I receive a bunch of 404 errors, for example:

/admin/js/grappelli/jquery.grp_autocomplete_m2m.js

In base.html template of grappelli I see following paths:

{% static '/grappelli/js/jquery.grp_autocomplete_m2m.js' %}

How this is possible?


Source: (StackOverflow)

Django session scope

I'm currently developing an e-commerce website using Django 1.6 and Satchless. I have two applications in my project: home and nos_produits.

I'm trying to store the satchless cart object in the django session in order to display the related informations in my templates. Everything works fine in the scope of my application nos_produits (where I add my cart object to the session) but when I navigate through the application "home" it seems that my cart object doesn't exist in the session, i.e {% if 'cart' in request.session %} is not evaluated to true. So my question is what's exactly the scope of a session in django. Is it limited to the application scope where the session is set or to the whole scope of the project?

Thanks in advance.

EDIT

Found the problem: in my "home" view I used render(request, myTemplate.html) instead of using render(request, myTemplate.html, locals())


Source: (StackOverflow)

issues with satchless app

I am using satchless app in my local server. It is installed at python path. Later i have create my project in my home directory and modify the settings.py file as described in this doc

But when i am running my server and goes to localserver localhost:8000 it gives me the error cannot import name cart_app I think it does not imort none of the app (cart, product or anything i have mention in my doc).

My url.py file is similar as it is specified in the doc i have mentioned above.

So any one who have used satchless app can tell me where i am wrong

Any suggestions would be appreciated Thanks


Source: (StackOverflow)

Django unable to load test fixtures, IntegrityError

I'm using Saleor/Satchless to power and e-commerce site (inherited the project). I couldn't find a Saleor mailing list so posting here instead.

I dumped the DB to create some test fixtures.

./manage.py dumpdata -e contenttypes -e sessions -e south -e > payments_data.json

When I run the tests and django tries to load the fixtures it barfs this up. I'm using Postgres as the DB, and although not terribly familiar, it seems like there might be a problem with the order in which data is being loaded

Any ideas how to get around it?

======================================================================
ERROR: test__hometryon_extra_pair_sizes (payment.tests.InterstitialTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 259, in __call__
self._pre_setup()
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 479, in _pre_setup
self._fixture_setup()
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 849, in _fixture_setup
'skip_validation': True,
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/__init__.py", line 161, in call_command
return klass.execute(*args, **defaults)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute
output = self.handle(*args, **options)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 224, in handle
connection.check_constraints(table_names=table_names)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 132, in check_constraints
self.cursor().execute('SET CONSTRAINTS ALL IMMEDIATE')
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 56, in execute
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 54, in execute
return self.cursor.execute(query, args)
IntegrityError: Problem installing fixtures: insert or update on table "product_ship" violates foreign key constraint "product_ship_product_ptr_id_fkey"
DETAIL:  Key (product_ptr_id)=(1) is not present in table "product_product".

Update: Started playing around with django-fixture-magic I discovered that product.product is not actually being dumped even when I do a $ python manage.py dumpdata --indent=4 --all -e contenttypes -e sessions -e south > fulldb.json

Update 2: After including contenttypes in the dumpdata, product.product was still missing in the actual data. I had to manually perform a dump_object and merge_fixture for product.product and order_deliverygroup. When loading the fixture, both gave similar errors to the following:

IntegrityError: Problem installing fixtures: insert or update on table "order_shippeddeliverygroup" violates foreign key constraint "order_shippeddeliverygroup_deliverygroup_ptr_id_fkey" DETAIL:  Key (deliverygroup_ptr_id)=(1) is not present in table "order_deliverygroup".

I am now left with this problem around Contenttypes

IntegrityError: Problem installing fixture '/Users/andres/Documents/projects/rpmwest/rpmwest/payment/fixtures/payments_data.json': Could not load contenttypes.ContentType(pk=5): duplicate key value violates unique constraint "django_content_type_app_label_model_key"DETAIL:  Key (app_label, model)=(product, digitalship) already exists.

Looking at the data in the fixture, sure enough it's there, but there is only one of them. Is it clashing with the DB creating contenttypes when it initially syncs the models?

If I leave out the contenttypes I get the following error:

Traceback (most recent call last):
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 259, in __call__
self._pre_setup()
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 479, in _pre_setup
self._fixture_setup()
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/test/testcases.py", line 849, in _fixture_setup
'skip_validation': True,
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/__init__.py", line 161, in call_command
return klass.execute(*args, **defaults)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute
output = self.handle(*args, **options)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 224, in handle
connection.check_constraints(table_names=table_names)
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 132, in check_constraints
self.cursor().execute('SET CONSTRAINTS ALL IMMEDIATE')
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 56, in execute
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
  File "/Users/andres/.virtualenvs/rpmwest/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 54, in execute
return self.cursor.execute(query, args)
IntegrityError: Problem installing fixtures: insert or update on table "django_admin_log" violates foreign key constraint "django_admin_log_content_type_id_fkey" DETAIL:  Key (content_type_id)=(22) is not present in table "django_content_type".

Source: (StackOverflow)