Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation instructions #89

Open
RyanHope opened this issue Sep 23, 2023 · 6 comments
Open

Installation instructions #89

RyanHope opened this issue Sep 23, 2023 · 6 comments

Comments

@RyanHope
Copy link

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
Copy link

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
Copy link
Owner

The examples all define PLATA_SHOP_PRODUCT I think, see

PLATA_SHOP_PRODUCT = "%s.Product" % EXAMPLE
?

The testsuite does it as well:

PLATA_SHOP_PRODUCT = "testapp.Product"

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
Copy link

sbonelo-nje commented Dec 3, 2023

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 :

  • Python 3.10.12
  • Django 4.2.7

@sbonelo-nje
Copy link

sbonelo-nje commented Dec 3, 2023

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
Copy link

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
Copy link
Owner

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants