Permalink
Browse files

more changes

  • Loading branch information...
1 parent f2120c9 commit e7b822a5c40daa70b9b1018b0eadc0ee945e8e0d @priestc committed Apr 17, 2012
Showing with 9 additions and 8 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 README.md
  3. +2 −5 scrobble/management/commands/lastfm_callback.py
  4. +1 −1 scrobble/models.py
  5. +1 −1 scrobble/urls.py
  6. +1 −1 scrobble/views.py
View
@@ -0,0 +1 @@
+.pyc
View
@@ -2,6 +2,9 @@
* `pip install django-scrobble`
* add to `INSTALLED_APPS`
* run `python manage.py syncdb`
+* add the scrobble urls somewhere to your projects urls:
+ url(r'scrobble/', include('scrobble.urls')),
+* enter your callback url into the last.fm callback field. To get your callback, run the management command `python manage.py lastfm_callback`
## Usage ##
Go to last.fm to sign up for an API account.
@@ -6,8 +6,5 @@ class Command(NoArgsCommand):
Print out the callback you should enter to the lastfm site.
"""
def handle(self, *args, **options):
- domain = Sites.objects.get_current()
- return "Your callback: {domain}{path}".format(
- path=reverse('lastfm_auth_callback'),
- domain=domain
- )
+ path = reverse('lastfm_auth_callback')
+ print "Your callback: {path}".format(path=path)
View
@@ -40,7 +40,7 @@ def make_url(self, method):
return "http://ws.audioscrobbler.com/2.0/?" + q
class LastFMAuthorization(models.Model):
- user = models.ForeignKey(User, related_name='lastfm_token', unique=True)
+ user = models.ForeignKey('auth.User', related_name='lastfm_token', unique=True)
session_key = models.CharField(max_length=255)
@classmethod
View
@@ -1,5 +1,5 @@
from django.conf.urls.defaults import *
-urlpatterns = patterns('scrobble',
+urlpatterns = patterns('scrobble.views',
url(r'^auth_callback/?$', 'lastfm_authentication_callback', name="lastfm_auth_callback")
)
View
@@ -1,4 +1,4 @@
-from scrobbing.models import LastFMAuthorization
+from scrobble.models import LastFMAuthorization
def lastfm_authentication_callback(request):
"""

0 comments on commit e7b822a

Please sign in to comment.