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 based on Django 2.x with Wagtail CMS to easy 
manage website content. I'd like to add pages with type Online course, 
which will be accessible only to users with purchase (access will be 
granted after Orders table check and only to bought courses). Videos will 
be inserted in Online course page. The only problem is, how to "hide" or 
modify video urls to prevent from download/publish/bookmark or direct 
access. The main purpose is to hide/protect video urls, secondary is to 
prevent downloading. So users with expired membership can't access course 
anymore or can't send links to other people. I know i can't protect videos 
100%, but i want to hide it for "regular" users. 

So, to make my life easier i hope Vimeo (paid membership) or other services 
should be able to help me. I have few question as Django beginner and 
looking for your help:

1. is my solution fine or i should change something?
2. is Vimeo good choice to serve videos? Do you have any experiences with 
Vimeo?
3. if i insert Vimeo videos to pages, is it somehow protected? Or it's like 
YT videos and anybody can simply download?
4. are there any other problems to be considered?

Many thanks for help or tips!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/af1fe937-b7bc-4b37-85f4-37a3c9b4b516%40googlegroups.com.


Re: Django model object filter with empty values

2018-10-09 Thread Moreplavec
Thank you, i will solve it with Q, it makes sense and will make it clear in 
future edits.

On Tuesday, 9 October 2018 21:50:50 UTC+2, Mateusz wrote:
>
> There are many ways to resolve your problem. According to 
> https://stackoverflow.com/questions/769843/how-do-i-use-and-in-a-django-filter
>  this 
> should work:
> from django.db.models import Q
> date_range = Q(date_stop__range=[today, today_plus_ten])
> date_none = Q(date_start=today, date_stop=None)
> coursedates_ending = CourseDate.objects.filter(date_range & date_none)
>
> You can also consider populating your date_stop with the same day as 
> date_start if it's not specified. Personally, I get take that as the best 
> answer. You can do that either with pre_save signal, which would do it even 
> if that's added from Django Admin page or shell (docs 
> <https://docs.djangoproject.com/en/2.1/ref/signals/#django.db.models.signals.pre_save>)
>  
> or form validation only for form(s) (docs 
> <https://docs.djangoproject.com/pl/2.1/ref/forms/validation/>).
>
> BTW: Notice, there is no need for X.objects.all().filter(...), you can 
> just 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 
>> 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:
>>
>> coursedates_ending = 
>> CourseDate.objects.all().filter(date_stop__range=[today, 
>> today_plus_ten]).order_by('date_stop')
>>
>> to get courses ending in 10 days. But is it possible to include courses 
>> without ending date and for this courses to look at the date_start? Or is 
>> it possible to update coursedates_ending with such courses?
>>
>> Thanks for help or tips how to do it django-way.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6ae4aa5-d105-4a4f-a860-d7639f4c9706%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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:

coursedates_ending = 
CourseDate.objects.all().filter(date_stop__range=[today, 
today_plus_ten]).order_by('date_stop')

to get courses ending in 10 days. But is it possible to include courses 
without ending date and for this courses to look at the date_start? Or is 
it possible to update coursedates_ending with such courses?

Thanks for help or tips how to do it django-way.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e8017c8f-b741-4763-990c-2dd19fb24223%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email validation in form

2017-09-13 Thread Moreplavec
Thanks. I made it as needed and wrote simple JS to call popup if there is 
an error to rise modal again after reload.

Thanks!

Dne úterý 12. září 2017 15:18:58 UTC+2 Daniel Roseman napsal(a):
>
>
> On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>>
>> On Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote:
>>>
>>> 
>>>
>>>> {% csrf_token %}
>>>> {{ form.non_field_errors }}
>>>> {% for hidden in form.hidden_fields %}
>>>> {{ hidden }}
>>>> {% endfor %}
>>>> {% for field in form.visible_fields %}
>>>> 
>>>> {% if field.field.required %}
>>>> {{ field.errors }}
>>>> {{ field.label }}>>> class="special_class">*{{ field }}
>>>> {% else  %}
>>>> {{ field.label }} {{ field }}
>>>> {% endif %}
>>>> 
>>>> {% endfor %}
>>>
>>>
>> 
>>>>
>>>
>> For some reason, you only show `{{ form.errors }}` if the field is 
>> required; and your email is not (becase you have blank=True in the model 
>> for that field). 
>>
>> Move the form.errors element out of that if block.
>> --
>> DR.
>>
>
> Sorry, that should have been `{{ field.errors }}`. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4e09e9ad-768a-464f-a4b8-83a63c9531a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email validation in form

2017-09-12 Thread Moreplavec
I have {{ field.errors }}  im my template. I changed model to not contain 
blank=True, but problem is still the same.


Dne úterý 12. září 2017 15:18:58 UTC+2 Daniel Roseman napsal(a):
>
>
> On Tuesday, 12 September 2017 14:18:29 UTC+1, Daniel Roseman wrote:
>>
>> On Tuesday, 12 September 2017 08:52:37 UTC+1, Moreplavec wrote:
>>>
>>> 
>>>
>>>> {% csrf_token %}
>>>> {{ form.non_field_errors }}
>>>> {% for hidden in form.hidden_fields %}
>>>> {{ hidden }}
>>>> {% endfor %}
>>>> {% for field in form.visible_fields %}
>>>> 
>>>> {% if field.field.required %}
>>>> {{ field.errors }}
>>>> {{ field.label }}>>> class="special_class">*{{ field }}
>>>> {% else  %}
>>>> {{ field.label }} {{ field }}
>>>> {% endif %}
>>>> 
>>>> {% endfor %}
>>>
>>>
>> 
>>>>
>>>
>> For some reason, you only show `{{ form.errors }}` if the field is 
>> required; and your email is not (becase you have blank=True in the model 
>> for that field). 
>>
>> Move the form.errors element out of that if block.
>> --
>> DR.
>>
>
> Sorry, that should have been `{{ field.errors }}`. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/14a999b0-7bfc-4f5c-9215-b739e1ebf5e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email validation in form

2017-09-12 Thread Moreplavec
I understand, but why while using model form it's not cought by form itself 
same as missing or incorect field like "asdf" for email? This is my 
problem. I need to show error and not to try to save :)



Dne úterý 12. září 2017 12:47:16 UTC+2 Vijay Khemlani napsal(a):
>
> "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 <stanisl...@gmail.com 
> > wrote:
>
>> Greetings,
>>
>> i have strange problem with my model form. I have simple form for taking 
>> orders, model looks like:
>>
>> class Order(models.Model):
>>> name = models.CharField(max_length=50, blank=False, 
>>> verbose_name='Jméno')
>>> surname = models.CharField(max_length=50, blank=False, 
>>> verbose_name='Příjmení')
>>> email = models.EmailField(max_length=254, blank=True)
>>> phone = models.CharField(max_length=50, verbose_name='Telefon', 
>>> blank=True)
>>> coursedate = models.ForeignKey(CourseDate, verbose_name='Termín')
>>> note = models.CharField(max_length=500, blank=True, 
>>> verbose_name='Poznámka')
>>> created = models.DateTimeField(auto_now_add=True)
>>> updated = models.DateTimeField(auto_now=True)
>>> def __str__(self):
>>> return '%s, %s' % (self.surname, self.coursedate.course.name)
>>
>>
>> and template (bootstrap, modal):
>>
>>  
>>
>>> {{ form.non_field_errors }}
>>
>> {% csrf_token %}
>>> {{ form.non_field_errors }}
>>> {% for hidden in form.hidden_fields %}
>>> {{ hidden }}
>>> {% endfor %}
>>> {% for field in form.visible_fields %}
>>> 
>>> {% if field.field.required %}
>>> {{ field.errors }}
>>> {{ field.label }}>> class="special_class">*{{ field }}
>>> {% else  %}
>>> {{ field.label }} {{ field }}
>>> {% endif %}
>>> 
>>> {% endfor %}
>>> 
>>> 
>>> 
>>> Close
>>> Send
>>> 
>>>  
>>
>>
>> And in model:
>>
>> def serve(self, request):
>>> from crm.forms import OrderFormNew
>>> if request.method == 'POST':
>>> form = OrderFormNew(request.POST)
>>> if form.is_valid():
>>> form.date_changed = datetime.date.today()
>>> form.save()
>>> return render(request, 'courses/course_web.html', {
>>> 'page': self,
>>> 'form': form,
>>> })
>>> else:
>>> form = OrderFormNew()
>>> form.fields["coursedate"].queryset = 
>>> CourseDate.objects.filter(course=self.course).order_by('date_start')
>>> return render(request, 'courses/course_web.html', {
>>> 'page': self,
>>> 'form': form,
>>> })
>>
>>
>>  
>> All fields work fine, but when i insert email, for example "asdf@asdf" 
>> form is taken away but not 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 "te...@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 mixing things together and error is shown somewhere, but 
>> lost in code :)
>>
>> Moreplavec
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.googl

Email validation in form

2017-09-12 Thread Moreplavec
Greetings,

i have strange problem with my model form. I have simple form for taking 
orders, model looks like:

class Order(models.Model):
> name = models.CharField(max_length=50, blank=False, 
> verbose_name='Jméno')
> surname = models.CharField(max_length=50, blank=False, 
> verbose_name='Příjmení')
> email = models.EmailField(max_length=254, blank=True)
> phone = models.CharField(max_length=50, verbose_name='Telefon', 
> blank=True)
> coursedate = models.ForeignKey(CourseDate, verbose_name='Termín')
> note = models.CharField(max_length=500, blank=True, 
> verbose_name='Poznámka')
> created = models.DateTimeField(auto_now_add=True)
> updated = models.DateTimeField(auto_now=True)
> def __str__(self):
> return '%s, %s' % (self.surname, self.coursedate.course.name)


and template (bootstrap, modal):

 

> {{ form.non_field_errors }}

{% csrf_token %}
> {{ form.non_field_errors }}
> {% for hidden in form.hidden_fields %}
> {{ hidden }}
> {% endfor %}
> {% for field in form.visible_fields %}
> 
> {% if field.field.required %}
> {{ field.errors }}
> {{ field.label }} class="special_class">*{{ field }}
> {% else  %}
> {{ field.label }} {{ field }}
> {% endif %}
> 
> {% endfor %}
> 
> 
> 
> Close
> Send
> 
>  


And in model:

def serve(self, request):
> from crm.forms import OrderFormNew
> if request.method == 'POST':
> form = OrderFormNew(request.POST)
> if form.is_valid():
> form.date_changed = datetime.date.today()
> form.save()
> return render(request, 'courses/course_web.html', {
> 'page': self,
> 'form': form,
> })
> else:
> form = OrderFormNew()
> form.fields["coursedate"].queryset = 
> CourseDate.objects.filter(course=self.course).order_by('date_start')
> return render(request, 'courses/course_web.html', {
> 'page': self,
> 'form': form,
> })


 
All fields work fine, but when i insert email, for example "asdf@asdf" form 
is taken away but not 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 mixing things together and error is shown somewhere, but 
lost in code :)

Moreplavec

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fabad5ea-8535-483c-895f-ebb0d90e5c1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
> 
> {% for tag in tags_hx %}
> 
> {% autoescape off %}{{ tag|safe }}{% endautoescape 
> %}
> 
> {% endfor %}
> 


 while {{ tags_hx }} prints lists exactly i have:

[Beginners English Tests 1, Grammar, 
> Beginners ESL, For Kids, Reading Skills, 
> Major Exams, Writing  Vocab]


but i can't get or force Django template to show each tag in table. All i 
get is:

Tags H1 - H7
> [Beginners English Tests 1]
> []
> []
> []
> []
> []
> [] 


I know, when i insert html code in template it will be used by browser, but 
just makes me mad i can't get to work it :) Autoescape or |safe doesn't 
help. Please, can you help me how to force simple output tags in cycle 
regardless of the consequences?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/23ba36b8-b550-4eb8-acda-382f0cd7e481%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
SSL for Django app. I think the problem is, that SSL cert conf is made as 
duplicate or currect conf file, so apache configtest fails and whole 
instalation is reverted:

command: *certbot-auto --apache -d django.my-domain.cz*

Created an SSL vhost at /etc/apache2/sites-available/my-domain.cz_crm-le-ssl
.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/my-domain.
cz_crm-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/my-domain.cz_crm-le-
ssl.conf
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/my-domain.
cz_crm.conf:
Name duplicates previous WSGI daemon definition.

Rolling back to previous server configuration...
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

AH00526: Syntax error on line 26 of /etc/apache2/sites-enabled/my-domain.
cz_crm.conf:
Name duplicates previous WSGI daemon definition.

Lines about WSGI config looks like:

WSGIDaemonProcess vkcrm python-path=/var/www/virtual/django/vkcrm:/var/www/
virtual/django/lib/python3.4/site-packages
WSGIProcessGroup vkcrm
WSGIScriptAlias / /var/www/virtual/django/vkcrm/vkcrm/wsgi.py

Does anybody know how to fix installation process or my config about WSGI 
daemon? Thanks! 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/28d67630-cfc8-4d06-a213-a3c6e305dfe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: One template for multiple views

2016-11-07 Thread Moreplavec
Yes, i know i can pass data (variables) from view to template. But my 
question is, if i have report, for example with headline "This month" and 
same report for previous with headline "Previous month", if i can such 
things solve directly in template, based on view which is calling template. 
I don't like the way to put texts into template just to be specific for 
view.

But thanks for answer, it's django-way and i have to respect it :/

Dne středa 2. listopadu 2016 20:28:22 UTC+1 Lekan Wahab napsal(a):
>
> Hi,  
> I'm not sure I completely understand what you need but if I do,  I think 
> passing different contexts to the same template would help you achieve 
> that. 
>
> You could easily have something like :
>
> def initial_view(request) :
>variableone = 'a' 
>variabletwo = 'b' 
>return response(yourtemplate, {'a':variableone, 'b' :variabletwo}) 
>
> Then you can also have another view using the same template but with 
> different contexts. 
> Something like, 
>
> def final_view(request) :
>variableone = '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 of your other 
> templates. 
>
> I hope that helps. 
>
> Lekan.
> Python is the "most powerful language you can still read".
>
> On 2 Nov 2016 19:48, "Moreplavec" <stanisl...@gmail.com > 
> wrote:
>
> 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 based on view, 
> which is template calling? For example, i need to show "Current month" or 
> "Previous month". I can put these texts into variable, but i hope there is 
> better way to controll directly in template.
>
> Please, can you help me or point me to some good article? Thanks!
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/a61a7a9d-06a2-4749-bf71-f6d2351396af%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/a61a7a9d-06a2-4749-bf71-f6d2351396af%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08ec103b-8f35-414e-9c94-a3ee5e398cc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 based on view, 
which is template calling? For example, i need to show "Current month" or 
"Previous month". I can put these texts into variable, but i hope there is 
better way to controll directly in template.

Please, can you help me or point me to some good article? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a61a7a9d-06a2-4749-bf71-f6d2351396af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.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! 
>
> Just for the record, you should also be able to use this:: 
>
> return redirect('crm:company_detail', company.pk) 
>
> (That should be equivalent to the explicit HttpResponseRedirect with 
> reverse().) 
>
> Cheers, 
>
> Michal 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/914fbb8f-9568-4f06-8e7d-6a6d7ade3da5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/020ebfa1-2bd0-4cba-91bc-5797dee25e5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.