Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
priestc committed Apr 17, 2012
1 parent f2120c9 commit e7b822a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.pyc
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down
7 changes: 2 additions & 5 deletions scrobble/management/commands/lastfm_callback.py
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion scrobble/models.py
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scrobble/urls.py
@@ -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")
)
2 changes: 1 addition & 1 deletion scrobble/views.py
@@ -1,4 +1,4 @@
from scrobbing.models import LastFMAuthorization
from scrobble.models import LastFMAuthorization

def lastfm_authentication_callback(request):
"""
Expand Down

0 comments on commit e7b822a

Please sign in to comment.