Coder Social home page Coder Social logo

Fix API URL bug in CLI about mezzanine-api HOT 5 CLOSED

gcushen avatar gcushen commented on June 28, 2024
Fix API URL bug in CLI

from mezzanine-api.

Comments (5)

ssteinerx avatar ssteinerx commented on June 28, 2024

I'm using, specifically, the "mezzanine-client-examples" (posts_list.py et al.), and they always go to 127.0.0.1:8000, even after:

mezzanine-cli config api_url http://192.168.99.100/api

If there's an optional parameter to either the Mezzanine() api constructor or the resultant object's .get_posts() call, then they should be used to show how to override the URL.

from mezzanine-api.

gcushen avatar gcushen commented on June 28, 2024

@ssteinerx , thanks for reporting this issue with the API CLI. The CLI project is actually in a separate Github repo dedicated to just the CLI and SDK.

The issue seems to be that line 55 of https://github.com/gcushen/mezzanine-client-python/blob/master/mezzanine_client/api.py was originally designed for the use via the API Python SDK and appears I may have forgotten to update it to check if the API URL has been set in the settings object in the case of CLI access.

Hence if you provide API URL via the SDK it should work fine, but the small fix mentioned above may be needed for the CLI.

from mezzanine-api.

gcushen avatar gcushen commented on June 28, 2024

For example, settings.api_url should be checked in line 55 of https://github.com/gcushen/mezzanine-client-python/blob/master/mezzanine_client/api.py .

Feel free to submit a pull request to the CLI/SDK Repo at https://github.com/gcushen/mezzanine-client-python if you fix it, otherwise I'll try to to fix it when I get a moment.

from mezzanine-api.

pysecuser avatar pysecuser commented on June 28, 2024

Thanks for this API, great work! Is there a way to post featured image and/or set it for any post?
Update:
Added 'featured_image' under Meta of serializer.py, I am able to post with image now.

from mezzanine-api.

gcushen avatar gcushen commented on June 28, 2024

This CLI bug has been fixed in v0.2.2 of Mezzanine Client: https://github.com/gcushen/mezzanine-client-python/releases/tag/0.2.2 .

To update the API client using pip: pip install -U mezzanine-client

from mezzanine-api.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.