django - How can i combine login to all the site with template inheritance? -


1. have base.html template describe site (the basic simple base.html) 2. have split_screen.html template extends base,html file , this:

{% extends "base.html" %}  {% block content %} - part changes in base.     <div id="top">          here come login form , under logo , top nav pannel      </div>     <div id="right">         here come static right nav pannel never change, there no need block     </div>     <div id="main">         {% block main%}         main part, thing change every page in (all files) extend split_screen.html (every other page in site).         {% endblock %}     </div> {% endblock %} 

ok, guess time question... so, looking , can't find (or maybe can't understand how implement) way use template inheritance , still have login backend view built (using email instead of username) implemented....i can't figure 1 out because every example read referring login page of own, need embedded in page (or don't i?).

can 1 please this?

ok, i've solved problem, didn't want user middleware , didn't use it, combining fe tutorials , tips, think got all.

  1. build main template (extends base.html) have amonge other things, form
  2. build mamber template inherit that.
  3. create simple index view (in main directory of site, nothing in return render main template build (for loaing main page when site uploads
  4. second view backend login, authentication proccess "/backend.py" , return user instance of user did success loging or none of not
  5. create custom login view request.post both emain , password fields (after checking in post - not bad resuilts , might , bouble posting , stuff that) user instance backend auth method , check if not none , if is_valid, if both go memeber page, if not go same page (will default, not have put @ end of view redirect render case (same level reques.post if.

well, basicly it, now, every request thrue this, no matter becouse extends main template build in beginning rest of site...

for seem work perfectly, if 1 has question or remarks happy hear them...10x


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -