Coder Social home page Coder Social logo

gcushen / mezzanine-api Goto Github PK

View Code? Open in Web Editor NEW
88.0 7.0 35.0 2.55 MB

The Simple Python Headless CMS ๐Ÿ

License: MIT License

Python 93.31% HTML 5.29% CSS 1.39%
django mezzanine cms api python rest-api headless-cms python-cms headless

mezzanine-api's Introduction

Hi there, I'm Geo ๐Ÿ‘‹๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป

Twitter

George

mezzanine-api's People

Contributors

amotl avatar gcushen avatar thijss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mezzanine-api's Issues

Add Support for Mezzanine 4.1.0

Apologies if this isn't really the place for this but I'm trying to get started with the api and just can't. I've followed the installation instructions (even added LOGIN_URL = "/api/auth/login/" to settings.py) but no matter what I do all /api/* urls 404 for me. Do you have any idea why this would happen?

beautifulsoup4 (4.4.1)
bleach (1.4.2)
chardet (2.3.0)
Django (1.9.1)
django-braces (1.8.1)
django-contrib-comments (1.6.2)
django-filter (0.12.0)
django-oauth-toolkit (0.8.1)
django-rest-swagger (0.3.5)
djangorestframework (3.3.2)
filebrowser-safe (0.4.1)
future (0.15.2)
grappelli-safe (0.4.2)
html5lib (0.9999999)
Mezzanine (4.1.0)
mezzanine-api (0.3.0)
oauthlib (1.0.3)
Pillow (3.1.0)
pip (7.1.2)
pytz (2015.7)
PyYAML (3.11)
requests (2.9.1)
requests-oauthlib (0.6.0)
setuptools (18.2)
six (1.10.0)
tzlocal (1.2)
wheel (0.24.0)

New release soon?

Currently, the API is readonly with the exception of the categories resource. Categories may be created or updated over the API by a superuser. The rest of the API will also gradually be opened up for write access over forthcoming releases.

When will you ship out a new release with the improvements? I really like your API, works awesome!

mezzanine_api - Could not import 'rest_framework.filters.DjangoFilterBackend'

Hi, I'm getting;

ImportError: Could not import 'rest_framework.filters.DjangoFilterBackend' for API setting 'DEFAULT_FILTER_BACKENDS'. AttributeError: 'module' object has no attribute 'DjangoFilterBackend'.

...after completing the installation re http://gcushen.github.io/mezzanine-api/
Appears DjangoFilterBackend is not longer supported in 'rest_framework' but is in 'rest_framework_filters'.
I've tried a number of options to reconfigure but cannot get it to work. How can I fix?

Mezzanine 4.2.3
Django 1.10.8
Python 2.7.6
SQLite 3.8.2

INSTALLED_APPS = [
    'mezzanine_api',
 #'rest_framework_filters',
    'rest_framework',
    'rest_framework_swagger',
    'oauth2_provider',

Performing system checks...

Unhandled exception in thread started by <function wrapper at 0x7fdb8fde8410>
Traceback (most recent call last):
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/mezzanine/core/management/commands/runserver.py", line 163, in inner_run
super(Command, self).inner_run(*args, **kwargs)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/mike1573/cart/cart/urls.py", line 13, in
from cart.apps.api.rest.v1 import views
File "/home/mike1573/cart/cart/apps/api/rest/v1/views.py", line 1, in
from rest_framework import generics
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/rest_framework/generics.py", line 26, in
class GenericAPIView(views.APIView):
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/rest_framework/generics.py", line 45, in GenericAPIView
filter_backends = api_settings.DEFAULT_FILTER_BACKENDS
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/rest_framework/settings.py", line 223, in getattr
val = perform_import(val, attr)
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/rest_framework/settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "/home/mike1573/cart-env/local/lib/python2.7/site-packages/rest_framework/settings.py", line 184, in import_from_string
raise ImportError(msg)
ImportError: Could not import 'rest_framework.filters.DjangoFilterBackend' for API setting 'DEFAULT_FILTER_BACKENDS'. AttributeError: 'module' object has no attribute 'DjangoFilterBackend'.

Thanks

Published blog posts queryset is not updating

I have been facing an issue regarding the /api/posts endpoint (at least), and it's the fact that saving a Blog Post in the Mezzanine administration page with no time specified will result in saving the article with the current UTC time. At this moment in time I would expect that /api/posts would return my newly published and created blog post, though it is missing. I have managed to work around this issue by providing an override to the get_queryset method in mezzanine_api.views.PostViewSet:

def get_queryset(self):
return Post.objects.published()

I have been debugging this issue and I've identified that rest framework, by default, does a queryset.all() to refresh the published posts set, though that .all() literally does not refresh anything and only Posts.objects.published() does the trick.

Add compatibility for Django v2

Installation instructions are break with release of Django 2.0

'pip install -U mezzanine-api' downloads Django 2.02, which no longer has the 'django.forms.extras' package, which throws an exception when running 'python manage.py createdb --noinput' in the installation instructions.

Either eliminating that dependency or adjusting the pip package to download Django 1.11 instead of the newest version should fix this (I imagine).

Documentation needs inclusion/update about managing endpoints

When installed, mezzanin_api exposes set of various fields/endpoints in single DB. It is unclear from documentation, how one can add/remove items in this set. Permissions sections says about how to control access to them, but not how to administrate availability of those endpoints. Also custom architectures covered next to none. It would be great to update documentation about it.

Fix API URL bug in CLI

I'm using Docker, so I'm not using the dev server.

Don't see any documentation on how to change the URL which is queried.

I'll go read the code, but it should be pretty obvious how to use e.g. your Docker machine's address instead of 127.0.0.1:8000.

KeyError with vanilla install?

I recently upgraded my mezzanine-api version to the latest, but got the following error:

request = kwargs['context']['request']
KeyError: 'context'

I originally thought it must be something with my setup, which is large and involves many customizations, so I created a new virtual environment, reinstalled all requirements, started with a fresh database, and this was the first error I got when accessing the root url localhost:8000/api/docs/. I don't know nearly enough about the inner workings of this app to begin troubleshooting, but could someone perhaps set me on the right track?

Support Mezzanine user account app

Hi,
I'm getting "NoReverseMatch: u'rest_framework' is not a registered namespace" with mezzanine.accounts and mezzanine_api in settings. Note I have seen a similar issue being raised in the mezzanine mailing-list with a response that the issue cannot be replicated with a vanilla install of mezzanine. For my scenario everything works up until mezzanine_api is installed, specifically when the # REST API SETTINGS #... are added to the main settings.py file. So mezzanine.accounts will fine without mezzanine_api and vice-versa... but all fail once enable in full together.
Versions installed:
Mezzanine 4.2.3
Django 1.10.8
Python 2.7.6
SQLite 3.8.2
mezzanine-api (0.6.1)
mezzanine-client (0.2.2)
Trace:
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x7f3fc934c668>
Traceback (most recent call last):
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/mezzanine/core/management/commands/runserver.py", line 163, in inner_run
super(Command, self).inner_run(*args, **kwargs)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check(display_num_errors=True)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/management/base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/mike1573/cart-root2/cart/cart/urls.py", line 93, in
url("^", include("mezzanine.urls")),
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/mezzanine/urls.py", line 64, in
url("^", include("mezzanine.accounts.urls")),
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/conf/urls/init.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/mezzanine/accounts/urls.py", line 29, in
url("^%s%s$" % (LOGIN_URL.strip("/"), _slash),
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/utils/functional.py", line 111, in wrapper
res = func(*self.__args, **self.__kw)
File "/home/mike1573/cart2-env/local/lib/python2.7/site-packages/django/urls/base.py", line 87, in reverse
raise NoReverseMatch("%s is not a registered namespace" % key)
django.urls.exceptions.NoReverseMatch: u'rest_framework' is not a registered namespace

Reverse for 'api-root' not found

requirements.txt
urls.txt
settings.txt

Hi George,

Kudos on the project its really really awesome, just a quick question. When I use your template for mezzanine-api ala

` mezzanine-project -a mezzanine_api project_name && cd $_

My new application works flawlessly. I am able to interact with the api and all that. However when I follow your instructions on how to insert into an existing project I receive the following error:

``Reverse for 'api-root' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []`

Attached are my virtualenv requirements, settings file and url config.

Could you point me in the right direction as to how to fix this?

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.