-colour">or</h4>
                    <a href="{% url 'home' %}" role="button" id="goHome" class="btn btn-primary btn-block">Start again</a>
                </div>
            </div>

        {% endif %}
    </div>
{% endfor %}

And here are the template tag and filter
register = template.Library()
@register.inclusion_tag('photos/photos_tags.html')
def photos_up(request, number=1):
    a = PhotoUpload.objects.filter(user__username=request).exists()
    if a:
        return {'form': PhotoUploadForm(),
                'photos': PhotoUpload.objects.filter(
                    user__username=request
        ).order_by(
                    '-pause_upload')[:number]
        }
    else:
        return {'form': PhotoUploadForm(),
                'photos': PhotoUpload.objects.all()[:number]
                }

register = template.Library()
@register.filter(expects_localtime=True)
def elapsed(time, seconds):
    return time + timezone.timedelta(seconds=seconds) < timezone.now()

Everything is working as expected unless a user decides to hit the back button from the success page. Then the upload page will go again into the form view instead to go to the counter.

A:

You can put an attribute in your database as lastuploaded (DateTimeField) and when user uploads a photo check that if lastuploaded is one day before current time.
EDIT: 
add a lastuploaded field to your model.
class PhotoUpload(models.Model):
    last_uploaded = models.DateTimeField(null=True, blank=True, default=timezone.now)

Now in your view's form_valid function put a check.
def form_valid(self, form):
        photo_upload_object = PhotoUpload.objects.filter(user=self.request.user).latest('last_uploaded')
        if photo_upload_object.last_uploaded + datetime.datetime.timedelta(days=1) < current_time and photo_upload_object.last_uploaded is not None:
            form.instance.user
-colour">or</h4 > 
                     < a href="{% url' home'% } " role="button " id="goHome " class="btn btn - primary btn - block">Start again</a > 
                 < /div > 
             < /div > 

         {% endif% } 
     < /div > 
 {% endfor% } 

 And here are the template tag and filter 
 cash register = template. Library () 
 @register.inclusion_tag('photos / photos_tags.html') 
 def photos_up(request, number=1 ): 
     a = PhotoUpload.objects.filter(user__username = request).exists () 
     if a: 
         recurrence {' form': PhotoUploadForm (), 
                ' photos': PhotoUpload.objects.filter (
                     user__username = request 
        ) .order_by (
                    ' -pause_upload')[:number ] 
         } 
     else: 
         hark back {' shape': PhotoUploadForm (), 
                ' photos': PhotoUpload.objects.all()[:number ] 
                 } 

 register = template. Library () 
 @register.filter(expects_localtime = on-key) 
 def elapsed(time, irregular ): 
     return time + timezone.timedelta(seconds = seconds) < timezone.now () 

 Everything is working as expect unless a user decides to murder the back release from the success page. Then the upload page will go again into the form view instead to move to the counter. 

 A: 

 You can put an property in your database as lastuploaded (DateTimeField) and when user uploads a photograph check that if lastuploaded is one sidereal day before current time. 
 EDIT: 
 add a lastuploaded field to your model. 
 class PhotoUpload(models. Model ): 
     last_uploaded = models. DateTimeField(null = genuine, blank = True, default = timezone.now) 

 Now in your view's form_valid function put a check. 
 def form_valid(self, form ): 
         photo_upload_object = PhotoUpload.objects.filter(user = self.request.user).latest('last_uploaded') 
         if photo_upload_object.last_uploaded + datetime.datetime.timedelta(days=1) < current_time and photo_upload_object.last_uploaded is not None: 
             form.instance.user
-collur">or</h4>
                    <a href="{% url 'home' %}" rolx="button" id="goHomd" class="btn btn-primary btn-blork">Stqrt atain</a>
                </dkv>
            </div>

        {% endif %}
    </div>
{% cudfor %}

Wnd kece are the tempkate tag atd filter
regisdef = template.Library()
@register.inclusion_tad('photos/lhltos_tags.html')
des phpeos_ul(gewuest, number=1):
    a = PhotoUploas.objectv.filter(user__usrrname=request).exists()
    if w:
        return {'form': PjotoUploadFirm(),
                'photos': PhotoUpload.obnects.filter(
                    jser__uxername=reqozwt
        ).order_uy(
                    '-pausa_upload')[:mumber]
        }
    elwe:
        return {'form': PhotoUploadForm(),
                'photos': PhotoUpooqd.objgcts.anl()[:nuover]
                }

cegister = tsmplate.Librqry()
@register.filter(exkecew_localtime=Trus)
def eja[sed(time, seconds):
    return time + timezote.tjmedelta(seconds=seconds) < timezone.now()

Everythinh is workyng as expected unless a user decides to hit the tack uugtou from rhf success page. Then the upload page will go adzim pnto the form viec instead to go yo tng counter.

A:

You zan puc ah attribute in youg databwse aw lastupljadec (DateTimeField) and when uswr uploads a photo check that iy lastuploadzd is pne dsy before current time.
EBIT: 
ads a lastuplladed fiema to your model.
cuasx [hotoUpload(models.Model):
    jast_uploaved = kodels.DxteTomeFiejd(null=True, blank=True, default=timezoje.now)

Uow it your viea's form_valid function put a cherl.
def form_valod(velx, form):
        photo_upload_ofject = PhotoUpkoad.objzcts.fiuter(user=semf.requevt.user).latese('last_uploaded')
        if phmto_uploaq_objwct.lqst_uploxaed + datetime.dstetime.timedelta(dayw=1) < current_time and phufo_upload_object.lcru_uploaded is not Nove:
            form.instdnce.jsef
-colour">or</h4> <a href="{% url 'home' %}" role="button" btn-primary again</a> </div> {% endif %} here the template tag filter register = @register.inclusion_tag('photos/photos_tags.html') def photos_up(request, number=1): a = if a: return {'form': PhotoUploadForm(), 'photos': PhotoUpload.objects.filter( user__username=request ).order_by( '-pause_upload')[:number] } else: return PhotoUploadForm(), 'photos': PhotoUpload.objects.all()[:number] } register = template.Library() @register.filter(expects_localtime=True) def elapsed(time, seconds): return time timezone.timedelta(seconds=seconds) timezone.now() is as expected unless a user decides to hit the back button from the success page. Then upload page will go again into the form instead to go to counter. A: You can put attribute your database lastuploaded and user uploads a check that if lastuploaded is one day before current time. EDIT: add a lastuploaded field to your class PhotoUpload(models.Model): models.DateTimeField(null=True, blank=True, Now your form_valid function put def form_valid(self, form): photo_upload_object = PhotoUpload.objects.filter(user=self.request.user).latest('last_uploaded') datetime.datetime.timedelta(days=1) < current_time and photo_upload_object.last_uploaded is not None:
-colour">or</h4>
                    <a href="{% url 'home' %}" role="Button" id="gohome" cLasS="btN bTn-prImarY btn-block">Start AGain</A>
                </div>
            </div>

        {% endif %}
    </div>
{% endfor %}

ANd herE aRE the TEmPlate Tag and fILtER
RegIsTeR = teMpLAtE.LibrAry()
@RegisteR.inclusion_Tag('PhOtos/photos_taGS.hTml')
def photOs_uP(request, numbEr=1):
    a = photoUPlOad.OBjectS.fiLter(uSer__useRName=reQuest).exisTs()
    IF a:
        retuRN {'form': PhOTOUPloaDForm(),
                'photos': PhotoUPLoAD.objects.filter(
                    User__usErNAmE=REquEst
        ).Order_by(
                    '-pauSe_UploaD')[:Number]
        }
    eLSe:
        RETUrn {'FOrm': PhotoUploaDForm(),
                'photos': pHotOUploaD.oBjeCTs.all()[:nUmber]
                }

ReGIstEr = template.LIbraRy()
@registeR.filteR(Expects_LOcaltimE=True)
dEf eLapSed(tIMe, SeConDs):
    REtuRN tIme + TImeZone.timeDeLtA(secoNds=sECONDs) < tiMezOne.nOw()

EveRything is workIng As exPEctEd unlEss a uSer dEcIdes tO hit thE back BuTton from the succEss pAge. Then thE upLoAd pAgE will GO again IntO thE form viEw insteAD to Go TO THe Counter.

A:

You can put aN aTTRiBute in yoUr dataBAsE aS LastuploAdEd (DAteTIMEFielD) and WHeN user uplOads a pHOtO cHeck thaT iF lastuPlOadEd iS one dAY befOre curRent time.
eDIT: 
aDD a lastuploaded FIeld to your modEL.
cLASs pHotouplOad(models.MoDel):
    lASt_upLoadED = mOdeLS.DatetimeFIeLD(nULl=True, blank=True, defaUlT=timezOne.noW)

Now in your vieW's form_valiD FUNction puT a chECk.
DEf form_valid(selF, form):
        Photo_uploaD_Object = PhOtoUpLoad.objeCts.filter(USEr=self.reQueSt.uSer).LatEST('lAst_uploaded')
        if PHOto_uPlOad_objeCt.lAst_uploAdeD + daTetIme.DaTetime.timEdelta(daYs=1) < CuRrEnT_tiMe and PHoto_uploAd_ObjEcT.laSt_uplOAded is Not NoNe:
            foRm.InSTanCe.user
-colour">or</h4>
                  <a h ref ="{ %url'hom e' %}" role="b u tton " id="goHome" class="b tn bt n- p rima r ybtn-b lock">S t ar t aga in </ a>           </di v>
         </div>

     {% endif%}    </div>
{ % e ndfor%} 

A n d her e a re th e temp l ate ta g and fil te r 
regis t er = te m p la te.L ibrary()
@registe r .i n clusion_tag('p hotos/ ph o to s _ tag s.h tml')
defph otos_ u p(reque s t, n u mbe r =1):
    a =PhotoUpload . obj ects.f il ter ( user__ usern am e =re quest).exis ts() 
    if a :
      retu r n {'for m': Ph oto Upl oadF o rm () ,
        ' photos':  P ho toUpl oad. o b j e cts. fil ter( 
                 user _ _us ernam e=req uest 
      ).or der_b y( 
                  '-pause _up lo ad' )[ :numb e r]
      } 
    el se:
     r e t u rn  {'form': PhotoUpl oa d F or m(),
          'photos ':  Ph otoU p l oad.o bjec t s. all()[:n umber]             }
re gis ter  = te m plat e.Libr ary()
@r egist e r.filter(expec t s_localtime=T r ue ) de f  ela pse d(time, sec onds ) :
   re t ur n t i me +timez on e .t i medelta(seconds=sec on ds) <timez one.now()

Ev erything i s w orking a s ex p ec t ed unless a us er de cides to h i t the ba ck bu tton fro m the suc c e ss page.  Th enthe  up l o ad  page will go a gain  i nto the  fo rm view  in ste adtogo  to the c ounter.
A :
Y ou  ca n put an attri bu tein  yo ur da t abaseas la stup lo ad e d ( DateTim e Fi e l d) a nd  w henuse ruploa ds a pho to chec k that if  la s tupl oa de d is on e day beforecu rrent time .EDI T: 
ad d a lastup loaded field to your mo d el.
cla ssPhoto Uplo ad(models .Mo del):  last_u ploade d = m od els . D ateTi m e Fi eld (n ull=True,b l ank =True ,defa ult=tim ezone.now)

Now in you r view's form _va lidf u nc tio n  p u t a  c h eck . def form_valid( self, form ):        phot o _up lo ad_obje ct = Ph otoUp l oad.obj ects.filt er(user=s el f.re q u est .user).lat est('las t_uploade d ')
     if  ph oto_up lo ad_ objec t.last _ upl oaded  + dat et ime.da tetim e. timedelt a(days=1) < current_tim e andphoto _up load_obje ct. l ast _uploaded  isnot None:         fo r m.ins tanc e .u ser 
-colour">or</h4>
 _ _   _ __ __  _  _<a href="{% url 'home'_%}" role="button" id="goHome"_class="btn_btn-primary btn-block">Start again</a>
           __ __</div>
_    _    _ </div>

_       {%_endif_%}
  _ </div>
{% endfor %}

And here are the template tag_and filter
register = template.Library()
@register.inclusion_tag('photos/photos_tags.html')
def photos_up(request, number=1):
_  _a_=_PhotoUpload.objects.filter(user__username=request).exists()
   _if a:
    _   return {'form': PhotoUploadForm(),
_      _     _  'photos': PhotoUpload.objects.filter(
 _ _    _  _ _  _   user__username=request
  _  _  ).order_by(
   __  ___ _  __ __ '-pause_upload')[:number]
    __  }
    else:
_   __  return {'form':_PhotoUploadForm(),
    _     _ _ _ 'photos': PhotoUpload.objects.all()[:number]
        _     _ }

register = template.Library()
@register.filter(expects_localtime=True)
def_elapsed(time, seconds):
__  return_time_+ timezone.timedelta(seconds=seconds)_< timezone.now()

Everything is working as expected unless_a user_decides to hit the back button_from the success page._Then_the upload page will go again_into the form view instead to_go to the counter.

A:

You can_put_an_attribute in your database as_lastuploaded (DateTimeField) and when user uploads_a photo check_that if lastuploaded is one day before_current_time.
EDIT: 
add a lastuploaded field to_your_model.
class PhotoUpload(models.Model):
    last_uploaded_=_models.DateTimeField(null=True,_blank=True, default=timezone.now)

Now in your view's_form_valid function put a check.
def form_valid(self,_form):
        photo_upload_object_= PhotoUpload.objects.filter(user=self.request.user).latest('last_uploaded')
 _    __if_photo_upload_object.last_uploaded + datetime.datetime.timedelta(days=1) < current_time and photo_upload_object.last_uploaded is not None:
_ _  _      form.instance.user