Comments (3)
hi @ahsan-kamal-sdq
thank you for this catch
fixed,
Please use latest version
pip install django-ninja==0.6.0
from django-ninja.
Hi @vitalik thanks for quick fix.
from django-ninja.
Sorry, I still have the same problem, only diff is
api = NinjaAPI(version="1.0.0", auth=django_auth)
what returned is:
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run
self.check(display_num_errors=True)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 412, in check
for pattern in self.url_patterns:
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 598, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
return import_module(self.urlconf_name)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/zhi/Code/cliche/Cliche/urls.py", line 22, in <module>
path('api/', api.urls),
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/ninja/main.py", line 314, in urls
self._validate()
File "/Users/zhi/Code/cliche/venv/lib/python3.8/site-packages/ninja/main.py", line 398, in _validate
raise ConfigError("\n".join(msg))
ninja.errors.ConfigError: Looks like you created multiple NinjaAPIs
To let ninja distinguish them you need to set either unique version or url_namespace
- NinjaAPI(..., version='2.0.0')
- NinjaAPI(..., urls_namespace='otherapi')
Already registered: ['api-1.0.0']
If I remove auth=django_auth
, then will be ok, I do the searching and read the doc on routers, can't figure out why.
from django-ninja.
Related Issues (20)
- [BUG] cdn error. HOT 3
- [BUG] paginate decorator with custom HTTP status `response={200: ..., 201: ...}` doesn't work HOT 3
- [BUG] Bearer authentication example from documentation doesn't work HOT 1
- `get_openapi_schema` outputs types using `anyOf` style - doesn't work with the Swift OpenAPI generator HOT 1
- Error when trying to do django runserver -> pydantic.errors.PydanticSchemaGenerationError HOT 1
- [BUG] Using `pydantic.Json[SomeModel]` in a query param fails
- [BUG] Async Error Handlers Return Unawaited Coroutines Instead of HttpResponse in Django Ninja
- Dependency Injection support with `anydi`
- [BUG] `models.URLField` serialized & validated as `str` HOT 1
- Exceptions log level HOT 1
- [BUG] CustomParser request header issue when sending json and file
- [BUG] `ModelSchema` produces `id > (integer | null)` openapi HOT 1
- How to set query param for test.
- When are we getting a new release? HOT 3
- How to detect client disconnects on StreamingHttpResponse (Server Side Events)? HOT 4
- Support "Accept" & "Content-Type" Headers
- [BUG] no Response object generated for ASGI api route HOT 1
- Change settings access to support FastAPI-style single file apps
- How to test api.exception_handler HOT 1
- Not required fields in FilterSchema
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-ninja.