Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Hossein Rabizadeh
@hrabizadeh
Hi guys
I have question about using mezzanine-api on my project
I add the mezzanine api to my project but all the webservices that created was about the general model of mezzanine
I have a custom model on project and it is important for me that I have webservice for this custom model
my question is : it
Mezzanine api support just mezzanine models(page, categories , ..) or I can create the webserver for my custom model?
gcushen
@gcushen
Mezzanine API is a RESTful API for Mezzanine CMS
If you have added or changed the Mezzanine CMS models and wish to access those resources through the API, you will also need to modify the API for your specific purpose: http://gcushen.github.io/mezzanine-api/#customizing
Akhlaq Rao
@DummyDeck
Hi George, thanks for the fabulous and remarkable approach. I had pretty much the same question as Hossien's. I would like to customize rather extend the endpoints to the Cartridge, so first of all are there any chances adding Cartridge endpoints? meanwhile I am working on adding some Shop endpoints like cart, shop/categories, products, product options, and variations etc. If I need to see all these endpoints through /api do I need to add them to the mezzainine-api urls and serializers? or is there a way to extend these classes in my project and expose these endppoints through mezzanine-api.
Akhlaq Rao
@DummyDeck
i.e this is what my api root shows https://couture92.com/api/
where I would like to add /api/cart to my root https://couture92.com/api/cart/
is there a way doing so without customizing mezzanine_api/urls.py ?
gcushen
@gcushen

Hi @DummyDeck , glad to hear you like the project!

I am not familiar with Cartridge and I don't have any need for it, so I have no plans to support it. However, if you or someone else implement Cartridge integration including tests, please create a Github issue for Mezzanine API with a link to the repository, and we can discuss the possibility of merging it in etc.

Regarding API urls: sure, you can create another Django Rest Framework API router specifically for Cartridge if you want. To avoid touching mezzanine_api/urls.py, you should be able to add an api/cart/ route before the api/ route in Mezzanine's urls.py. Then, api/cart/requests will go to the api/cart/router instead of the main api/ router.

Akhlaq Rao
@DummyDeck
Great help! when I tried your solution it did indeed add the api/cart to the root but then it took away all the mezzanine-api endpoints, any clue?
Akhlaq Rao
@DummyDeck
Hi George, Do you know if I can override OAUTH2_PROVIDER {} settings into my app's settings? I see you are overriding it in mezzanine-api settings from Django oauth toolkit. Thanks
Akhlaq Rao
@DummyDeck

I got it working, the order matters I guess.

try:
from mezzanine_api.settings import *
except ImportError:
pass

OAUTH2_PROVIDER = {
'ALLOWED_REDIRECT_URI_SCHEMES': ['http', 'https', 'custom-scheme'],
}

David Childers
@dchilders21
Hey everybody,
I'm new with Mezzanine and I just installed the API (0.5.0) and getting an error in the browsable web API when trying some of the calls. For instance, for the GET method of http://127.0.0.1:8000/api/posts, I get a 500 internal server error that says
'TypeError at /api/posts
init() got an unexpected keyword argument 'lookup_type'
Some of the other calls work fine. I thought it was an issue of authentication but once I set up OAuth for the User call, 'http://127.0.0.1:8000/api/users' it displayed the same error. Any suggestions or help would be greatly appreciated. Thanks.
yavivi
@yavivi

Hey,

We need our server to connect to the MZN server and fetch blog posts from it.
The MZN Server and our server are on the same site, both are deployed as separate Rocket containers (our server is also Django based).
We need to establish the connectivity and authentication in a fully automatic way (no manual interventions).
In order to do that we tried the “Client Credentials” grant type in the OAuth2 method.
We managed to receive a token using the following request:

curl -X POST -H "Accept: application/json; indent=4" -d "grant_type=client_credentials" -u"<client_id>:<client_secret>" http://localhost:8000/api/oauth2/token/

We then tried to use the following API using the accepted token:
curl -H "Authorization: Bearer <your_access_token>" http://localhost:8000/api/users

And got a message indicating that the Client Credentials were not provided.

Is there anything we are missing in the client_credentials flow ?

Thanks,
Yotam

marcello
@marcs2006_twitter
hello, i installed mezzanine-api on an existing mezzanine working blog, but now i always get a 500 internal server error on any url. so i made a new scratch site directly with mezzanine-api, but still i only got 500 internal error server
i got no msg in error.log, while in access.log i can see the requests
any idea? maybe an undocumentented depndency for mezzanine-api?
mezzanine.version
'4.2.3'
mezzanine_api.version
'0.6.0'
Scott McFarlane
@relhtml
How might I go about integrating mezzanine-api to expose Cartridge specific models - like products and product categories?
Forrest Shuang
@Double1996
hi how to custom the mezzanine views
jsandovalc
@jsandovalc
Hi everyone, I just installed cli api client for mezzanine. I created an app in the admin and configured the cli as shown in the docs. I try to list the posts, I get the authorizations url and it returns the code. Everything is ok till there. I copy the code and I get an exception there: oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter
Any clue with this?
I'm using python 3. 6 and mezzanine 4.2.0
Artem
@PYXPYXzp
Hello everyone Here is my question: By default for customization the page we use the admin panel. If I want to create my admin panel and use for this Django rest. Is it real?