Giter Club home page Giter Club logo

Comments (29)

jadianes avatar jadianes commented on July 22, 2024

The tutorial says LOGIN_REDIRECT_URL and not LOGIN_REDIRECTORY. Does that fix your problem?

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

ER.....Actually, I wrote it correctly on my code. So the problem still exists. Sorry......

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

Have you missed any procedures? Because there are no urls map to user_review_list.html .
By the way, that should be registration_form.html and registration_complete.html.

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Ok! So I can just repeat here the steps in the tutorial:

  • Check what URL does your browser points to when you get the error.
  • Check that you have defined the proper mapping in the urls.py file.
  • Check that you have defined the user_review_list function in views.py.
  • Check that you have defined the user_review_list.html file as the tutorial says.

If you still have problems after checking out the tutorial as is at stage-1.1 and following from the section on the User profile page, I would suggest jumping to the stage-1.2 after understanding that section and check if everything works there. If not, it's probably something related with your development envionrment?

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Actually the tutorial says that you need to define that procedure that points to user_review_list.html as follows:

def user_review_list(request, username=None):
    if not username:
        username = request.user.username
    latest_review_list = Review.objects.filter(user_name=username).order_by('-pub_date')
    context = {'latest_review_list':latest_review_list, 'username':username}
    return render(request, 'reviews/user_review_list.html', context)

And the mapping is also described in the tutorial as:

url(r'^review/user/(?P<username>\w+)/$', views.user_review_list, name='user_review_list'),
url(r'^review/user/$', views.user_review_list, name='user_review_list'),  

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

And I don't really get what you mean with "that should be registration_form.html and registration_complete.html". Could you explain a bit more what you mean with that?

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

"They are `templates/registration/registrationform.html' and 'templates/registration/registrationcomplete.html'."
In the section of decorating the registration form

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

I'm a bit lost. Sorry. These templates are defined correctly and this is because the tutorial works and you can register in the deployment version of the app at http://jadianes.koding.io:8000/accounts/register/

An the tutorial here says:

We need to provide two templates that will replace the default ones. We want ours to be more in line with our site's style. They are `templates/registration/registration_form.html' and 'templates/registration/registration_complete.html'. The first one looks like this.

Hope that helps, and thanks for giving the tutorial a try!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

That's so strange. Because I read your tutorial on codementor.io and the "_" is lost.
By the way, your tutorial is really cool.
By the way, I know what the problem is now. I forgot to map the urls for user_review_list.
But now, I can visit my own user_profile, but I can't see the link on the front page given that I have written the link on the base.html.

Now I can see it. Thank you.

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

I'm afraid Codementor.io very often does a horrible formatting with our tutorials. Too bad! I'm happy to hear you're making progress.

The base.html should look like this one at that stage. It might be that it doesn't got your updates? Try to refresh, restart the server, etc.

Let me know how it goes!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

It works now! But here is another problem, why can I still visit the login page when I have already logged in? The same thing happens when it comes to the registration page.

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

If you followed the tutorial, you should not be able to do that. The base template I've pointed you to (here) contains code the prevents that.

{% if user.is_authenticated %}
    <li><a href="{% url 'reviews:user_review_list' user.username %}">Hello {{ user.username }}</a></li>
    <li><a href="{% url 'auth:logout' %}">Logout</a></li>
{% else %}
    <li><a href="{% url 'auth:login' %}">Login</a></li>
{% endif %}

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

Yes, but when I input the url in the browser, I still can do that.

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

By the way, will you write the third part of tutorial?

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

It is already written actually. And is my favourite part!

https://github.com/jadianes/winerama-recommender-tutorial/blob/master/tutorials/tutorial_3.md

And at Codementor.io as well:

https://www.codementor.io/python/tutorial/build-data-products-django-machine-learning-clustering-user-preferences

Please, share the repo it if you like it!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

Great!
How can I share the repo?

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Just share the link (
https://github.com/jadianes/winerama-recommender-tutorial) in whatever
social networks or blogs you like :)

Btw, I will be very happy if you like to show me your results once you
complete the three parts!

Thanks!

On 9 November 2015 at 05:38, rylanchiu [email protected] wrote:

Great!
How can I share the repo?


Reply to this email directly or view it on GitHub
#5 (comment)
.

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

I have shared it on my miniblog! Actually, my work is a little different with yours. I am building a web app like a social network for rappers. And they can share their lyrics(like reviews in your app) and then there is a algorithm(maybe LDA etc.) measuring the style of their lyrics. Finally it will make a Top-N recommendation. If goes well, I want to add another function that can calculate the rhyme density of each rappers(referenced to this paper : http://arxiv.org/pdf/1505.04771v1.pdf) and produce a ranking list.

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Sounds like a really cool machine learning + web development problem to me!. Keep me updated with your progress :)

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

The paper is very original by the way...

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

@jadianes Yes, but luckily they have code open sourced on Github: https://github.com/ekQ/raplysaattori.
By the way, I will share with you as soon as I finish it :)

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Cool :)

On 9 November 2015 at 09:08, rylanchiu [email protected] wrote:

@jadianes https://github.com/jadianes Yes, but luckily they have code
open sourced on Github: https://github.com/ekQ/raplysaattori.
By the way, I will share with you as soon as I finish it :)


Reply to this email directly or view it on GitHub
#5 (comment)
.

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

@jadianes Hi Jadianes! Sorry for disturbing you again. In the tutorial 3 you preprocess the data by running the python script additionally, but I wonder if there is any way to automatically do it so that the application is totally web-based?

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

I have another problem now:
'User' object has no attribute 'cluster_set'.
I wonder when did you define the attribute: cluster_set?
Thank you!

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Hey @rylanchiu !

Thanks for keep working in the tutorial. The cluster_set attribute is automatically generated by Python since there is a reference in the class Cluster to a User instance. You can check the class models.py in the stage-2.4.

Hope that helps!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

Thanks a lot! It works! Now the website can automatically generate the topic words! But I am still doing some adjusting as the result is not so good. Anyway, thank you very much!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

Hi @jadianes , my work is near the ending. But here is a question, how can I add the UserProfile model so that each user can have a picture generating from the topic words of their lyrics? Thank you very much!

from winerama-recommender-tutorial.

jadianes avatar jadianes commented on July 22, 2024

Hi @rylanchiu

I've intentionally left the default auth.User object as it is, without adding any additional fields, so we don't need to define our own User model. In order to implement your use case, you need to define your own User class, add the fields that you need, and make it the default for authentication in your security config.

Al this should be explained in the Django documentation: https://docs.djangoproject.com/en/1.8/topics/auth/

Sorry I can't help you more with this. As I said I intentionally avoided that in the tutorial in order to make it simpler since I wanted to tackle the machine learning part. But hopefully you will learn a lot by trying yourself :)

Good luck!

from winerama-recommender-tutorial.

 avatar commented on July 22, 2024

@jadianes Got it! Thanks a lot!

from winerama-recommender-tutorial.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.