Confliict with django_authopenid app

Anonymous avatarAnonymous created an issue

An error "The model Nonce is already registered" is displayed due to conflict with django_authopenid application (both django_authopenid and django-piston has model named Nonce so it is impossible to do 'admin.site.register(Nonce)' in the piston/models.py

Comments (4)

  1. Anonymous

    Well, I have got same error (The model <> is already registered) to all models in models.py: Token, Consumer, Resource...

  2. Anonymous

    Hi,

    The solution to this is to add a file called "admin.py" to the piston directory. In there, it should read:

    from django.conf import settings from django.contrib import admin from piston.models import Nonce, Resource, Consumer, Token

    admin.site.register(Nonce) admin.site.register(Resource) admin.site.register(Consumer) admin.site.register(Token)

    You should then remove the lines that also make these statements from the models.py file.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.