matthiask / plata

Plata - the lean and mean Django-based Shop
https://plata-django-shop.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
202 stars 63 forks source link

Installation instructions #89

Open RyanHope opened 1 year ago

RyanHope commented 1 year ago

I can not for the life of me get this project working. Can you please update something with installation instructions that work. The examples in the docs are clearly outdated. I have attempted to copy the simple example but can't get the first migrations to work. Your examples don't seem to define PLATA_SHOP_PRODUCT anywhere like in docs and without that you get this error:

  File ".venv\lib\site-packages\django\forms\models.py", line 1232, in <listcomp>
    f.remote_field.model._meta.proxy
AttributeError: 'str' object has no attribute '_meta'

With this var defined and pointing to my simple product, after creating migrations for shop and the other submodules (also not mentioned in the docs), I try and run the migration and I get circular dep errors.

francescortiz commented 1 year ago

It is an old project with no releases after 2016. Maybe you can try with python 2.7 and and an old version of django.

matthiask commented 1 year ago

The examples all define PLATA_SHOP_PRODUCT I think, see https://github.com/matthiask/plata/blob/2a15058b7f5fb234f0420bfed0210f1002fb3328/examples/simple/settings.py#L141 ?

The testsuite does it as well: https://github.com/matthiask/plata/blob/2a15058b7f5fb234f0420bfed0210f1002fb3328/tests/testapp/settings.py#L78

Tests are running (and passing) with Django 4.1 and 4.2; I haven't made a release in years, that's true. I have been looking into updating Plata though so that I can use it in an upcoming project and there's really no reason why I haven't published a release except for the fact that I haven't had to do it for any project yet. If you can confirm that installing from main works I'll happily publish a release though.

sbonelo-nje commented 1 year ago

Hi guys.

@matthiask I just installed using the main branch, setup according to the oneprice example.

I made migrations for the product model and migrated. What I noticed is that no Plata migrations are run when I migrate - only Django defaults and the product model migrations are run.

I continued and created a superuser and ran the project.

When I log in admin, Django raises - >;

"OperationalError: no such table: shop_order"

Everything is as per the oneprice example.

Update

I went and commented out the 'plata.context_processors.plata_context' and rerun the project, this time it worked 😊😅.

I haven't dug deep into the Plata project yet as I'm still checking it out but I will be on the lookout for the context processor and how it works so as to better understand what's going wrong with it currently.

I will update here if I stumble upon something.

Running on :

sbonelo-nje commented 1 year ago

I got excited to soon, upon remembering that no Plata migrations were ran, I thought I'd check out if the Plata models in the admin work or not - as expected, no migration tables means they don't work.

I guess this means I should uncomment the context_processor.

sbonelo-nje commented 1 year ago

Looking at the package apps (contact, shop etc), I see that they don't have any migrations modules in them, only the shipping app has them and unfortunately I am not using it.

@matthiask is there a specific reason behind the missing migrations?

I ran make migrations on all the Plata apps just to see if all is going to go well (I know that's not the way to go but I was just trying to push it further and see what happens) and they ran.

When migrating, I now get a "CircularDepencyError: shop.0001_initial, example.0001_initial'

matthiask commented 9 months ago

@matthiask is there a specific reason behind the missing migrations?

No there's no reason, just (very) slow maintenance. You could try recreating the migrations, and if it works, I'd definitely appreciate a pull request!