Re: Redirect after Form

2016-10-30 Thread Moreplavec
I found in Django Tutorial solution: https://docs.djangoproject.com/en/1.10/intro/tutorial04/ : Now i have: return HttpResponseRedirect(reverse('crm:company_detail', args=(company.pk,))) #return redirect('views.company_detail', pk=company.pk) And it works fine! -- You received this message

Re: Redirect after Form

2016-10-31 Thread Moreplavec
Many thanks, works fine and looks much better to me. Dne pondělí 31. října 2016 10:21:37 UTC+1 Michal Petrucha napsal(a): > > On Sun, Oct 30, 2016 at 06:39:19AM -0700, Moreplavec wrote: > > I found in Django Tutorial solution: > > https://docs.djangoproject.com/en/1.1

One template for multiple views

2016-11-02 Thread Moreplavec
Greetings, i'm creating template for simple table report. Data shown are for current month. Than i realised i need same report for previous month. I can copy created template and modify texts, but i don't like. Is it possible to use same template for more views and only controll differences ba

Re: One template for multiple views

2016-11-07 Thread Moreplavec
x27;c' >variabletwo = 'd' >return response(yourtemplate, {'c':variableone, 'd' :variabletwo}) > > Also, if you have a repetitive section in your template, you could just > write it once and use the {% include %} tag to use it in each o

Let's Encrypt installation fails with WSGI on Ubuntu 14 LTS

2017-03-24 Thread Moreplavec
I'm trying to install SSL certificate with Let's encrypt on my VPS running Apache + WSGI. I'm following guide: https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04 It works fine for all PHP sites, but i get an error when trying to install SS

Show HTML tags in list in Django template

2017-04-15 Thread Moreplavec
Greetings, i'm trying to parse HTML website and present same basic info about it. I'm using BeuatifulSoup4 and Python3. Code is simple, but i have problem to force Django template show variables in my list. For example this simple code in template: {{ tags_hx }} > Tags H1 - H7 >

Email validation in form

2017-09-12 Thread Moreplavec
saved to model. So Django wont validate, but form takes it. How to make form to use same rules as Django? When i use email "t...@test.com" all works fine and data are in model saved. Thanks for help, maybe it's to much things together while using pop-up + validation and i'm mix

Re: Email validation in form

2017-09-12 Thread Moreplavec
"asdf@asdf" is not a valid email so form.is_valid returns False and > form.save is never called > > > > On Tue, Sep 12, 2017 at 4:52 AM, Moreplavec > wrote: > >> Greetings, >> >> i have strange problem with my model form. I have simple form f

Re: Email validation in form

2017-09-12 Thread Moreplavec
12 September 2017 08:52:37 UTC+1, Moreplavec wrote: >>> >>> >>> >>>> {% csrf_token %} >>>> {{ form.non_field_errors }} >>>> {% for hidden in form.hidden_fields %}

Re: Email validation in form

2017-09-13 Thread Moreplavec
Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote: >>> >>> >>> >>>> {% csrf_token %} >>>> {{ form.non_field_errors }} >>>> {% for hidden in form.hidden_fields %}

Django + hosted videos and user rights

2020-04-03 Thread Moreplavec
Greetings, i'd like to have online courses in my website. I found it quite difficult to serve and protect videos (i'm not so skilled in Django), so i'd like to try to use some service like Vimeo to make my life easier and solve serving/playing and video protection. Right now i have website bas

Django model object filter with empty values

2018-10-09 Thread Moreplavec
Hello, I have DB with courses and each course has many dates (with starting and ending date). I'm trying to make report with starting and ending course dates in 10 days. The problem is, that one day courses usually don't have ending date (date_stop) filled. Right now i'm using query: coursedat

Re: Django model object filter with empty values

2018-10-09 Thread Moreplavec
ust use X.objects.filter(...). > > Notice: This answer was removed and edited. > > W dniu wtorek, 9 października 2018 18:23:38 UTC+2 użytkownik Moreplavec > napisał: >> >> Hello, >> >> I have DB with courses and each course has many dates (with starting and >&