How to Show Login Prompt from Homepage?

61 views
Skip to first unread message

easypie

unread,
Mar 24, 2012, 1:24:43 PM3/24/12
to Satchmo users
How would it be possible to show login/password input prompt on
homepage without having to click the Login link? I'm trying to have
customers come to my site, login from homepage with username and
password, then hit login without having to be taken to the
registration/login.html page. I went through satchmoproject demos but
there wasn't an example of someone doing it that way. Here's the best
example I can find: http://www.yukiumi.com/en/

easypie

unread,
Mar 24, 2012, 4:16:01 PM3/24/12
to Satchmo users
Actually, here's a site listed on satchmo's demo that let's a user
login from the frontpage: http://rgmania.com/

Laszlo Antal

unread,
Mar 24, 2012, 4:17:05 PM3/24/12
to satchm...@googlegroups.com, Satchmo users
Hi

Couple simple way to accomplish it.
Copy the registration/login.html to your homepage html and point to it in your urls.py or do an auto redirect in your urls.py to the login page

LZAntal

> --
> You received this message because you are subscribed to the Google Groups "Satchmo users" group.
> To post to this group, send email to satchm...@googlegroups.com.
> To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
>

easypie

unread,
Mar 24, 2012, 5:11:43 PM3/24/12
to Satchmo users
Do you mean add {% include "registration/html" %} to base.html and
then use direct_to_template or redirect_to? I'm at a lost.

this is located in satchmo_store/accounts/urls.py:
(r'^login/$, 'emaillogin, {'template_name': 'registration/
login.html'}, 'auth_login') to (r'^$', direct_to_template,
{'template': "registration/template" }),

and this is the views.py for emaillogin:
https://bitbucket.org/benoitcsirois/bens-satchmo/src/ae1f0cf97e3a/satchmo/apps/satchmo_store/accounts/views.py

On Mar 24, 1:17 pm, Laszlo Antal <lzan...@gmail.com> wrote:
> Hi
>

hynekcer

unread,
Apr 19, 2012, 6:11:22 AM4/19/12
to Satchmo users
I answered something similar today on
http://stackoverflow.com/questions/9710677/satchmo-template-form-username-not-popping-up/10225614#10225614
It would have to answer at least half of your question.
Please, if you link to an unmodified source, do it to the original
tree https://bitbucket.org/chris1610/satchmo/
otherwise I search in vain, what and why you have modified.

--Hynek

On 24 bře, 23:11, easypie <program...@gmail.com> wrote:
> Do you mean add {% include "registration/html" %} to base.html and
> then use direct_to_template or redirect_to? I'm at a lost.
>
> this is located in satchmo_store/accounts/urls.py:
> (r'^login/$, 'emaillogin, {'template_name': 'registration/
> login.html'}, 'auth_login')  to  (r'^$', direct_to_template,
> {'template': "registration/template" }),
>
> and this is the views.py for emaillogin:https://bitbucket.org/benoitcsirois/bens-satchmo/src/ae1f0cf97e3a/sat...

easypie

unread,
Apr 22, 2012, 11:10:25 PM4/22/12
to satchm...@googlegroups.com
Thank you for helping me up to this point. I'm still very confused about how a person would be able to integrate a login field on the front page instead of having enter the username and password at /accounts/login/. I need to start back with a clean slate. How about I was to do a fresh project of satchmo. How would I be able to add the login and password field on the front page? Do I first copy the content of registration/login.html to base.html. Afterward, I change form to <form method="post" action="{% url auth_login %}?next={{ request.path }}">{% csrf_token %}. But it still takes me to /accounts/login/ after I submit the username and password on front page. Where would the problem be located at? Thanks.
> > > To unsubscribe from this group, send email to satchmo-users+unsubscribe@googlegroups.com.

hynekcer

unread,
Apr 23, 2012, 2:39:37 AM4/23/12
to Satchmo users
Use ...?next={{ request.path }}"> or ...?next=/"> to go to the
requested page after login as I wrote on http://stackoverflow.com/a/10225614/448474

If you have an acount on stackoverflow.com with reputation 15+, please
confirm by click or judge whether my answers for Satchmo are helpful
for you.

[1[ http://stackoverflow.com/questions/tagged/satchmo?sort=active
[2] http://stackoverflow.com/search?q=user:448474+[satchmo]

--Hynek

On 23 dub, 05:10, easypie <program...@gmail.com> wrote:
> Thank you for helping me up to this point. I'm still very confused about
> how a person would be able to integrate a login field on the front page
> instead of having enter the username and password at /accounts/login/. I
> need to start back with a clean slate. How about I was to do a fresh
> project of satchmo. How would I be able to add the login and password field
> on the front page? Do I first copy the content of registration/login.html
> to base.html. Afterward, I change form to <form method="post" action="{%
> url auth_login %}?next={{ request.path }}">{% csrf_token %}. But it still
> takes me to /accounts/login/ after I submit the username and password on
> front page. Where would the problem be located at? Thanks.
>
>
>
>
>
>
>
> On Thursday, April 19, 2012 3:11:22 AM UTC-7, hynekcer wrote:
>
> > I answered something similar today on
>
> >http://stackoverflow.com/questions/9710677/satchmo-template-form-user...
> > It would have to answer at least half of your question.
>
> > > and this is the views.py for emaillogin:
>
> >https://bitbucket.org/benoitcsirois/bens-satchmo/src/ae1f0cf97e3a/sat...
>
> > Please, if you link to an unmodified source, do it to the original
> > treehttps://bitbucket.org/chris1610/satchmo/
> > satchmo-user...@googlegroups.com.

cacc ccac

unread,
Apr 23, 2012, 3:38:27 AM4/23/12
to satchm...@googlegroups.com
That's what I'm stuck on. I have that in the template but it doesn't seem to work when I login from front page but it does in /accounts/login/. Here's the template where the code resides in. Code beings on line 28: dpaste.org/juY6w

hynekcer

unread,
Apr 23, 2012, 8:38:23 AM4/23/12
to Satchmo users
You forgot "=" after "next in:
.../login/?next{{ request_path }}

--Hynek

easypie

unread,
Apr 23, 2012, 12:12:36 PM4/23/12
to satchm...@googlegroups.com
I was substituting different inputs for action="...", and I made the typo before I posted the code. Here's the revision with "=" after "next" but still no luck: www.dpaste.org/juY6w

easypie

unread,
Apr 23, 2012, 12:13:36 PM4/23/12
to satchm...@googlegroups.com
wrong link. here's the new one: dpaste.org/1hdYY/
Reply all
Reply to author
Forward
0 new messages