ponyriders / django-amazon-price-monitor

Monitors prices of Amazon products via Product Advertising API
Other
156 stars 36 forks source link

no login page, api can't authenticate #107

Closed tbaker4802 closed 7 years ago

tbaker4802 commented 7 years ago

On front end, there seems to be no login page, it looks like you have it in glue in the docker image but i have this running on my pc locally...

When i go to my site this is what i get:


Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1/login
Using the URLconf defined in amaprice.urls, Django tried these URL patterns, in this order:
^$ [name='angular_view']
^api/
The current URL, login, didn't match any of these.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
tbaker4802 commented 7 years ago

Sorry this shouldn't have been an issue. I realize now that I must create a login page, and there are a number of work arounds for this... the quickest way I found to do it was by doing the following:

python manage.py createsuperuser

then create a user...

then add to your root urlsconf (inside of your other regex's)

url(r'^api-auth/', include('rest_framework.urls')), After that, you should be able to login using the created superuser account by going to http://your.application.url/api-auth/login/

hope it helps someone, i'm sort of new on django so yeah... took a minute to figure out