Re: PasswordResetConfirmView doesn't work through redirect in newest Safari

2019-01-29 Thread Henrik Ossipoff Hansen
Ah darn it - I didn't even think of checking the bug tracker first. Usually 
when we're experiencing things like this it's because we've messed up 
somehow :)

I guess for now we'll see if we can backport the old function based view 
which didn't do that redirect straight after landing on the page with the 
reset token, in order for the tracking prevention to not kick in.

Thanks!

tirsdag den 29. januar 2019 kl. 21.49.12 UTC+1 skrev Jason:
>
> You're not the only one with this issue.
>
> django-developer discussion at 
> https://groups.google.com/forum/#!topic/django-developers/RyDdt1TcH0c
> There's an open ticket on the django bug tracker at 
> https://code.djangoproject.com/ticket/29975
> and related on webkit:  https://bugs.webkit.org/show_bug.cgi?id=193502
>
> Unfortunately, doesn't seem to be much action on this.  It really is a 
> breaking change with Safari.
>

-- 
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/b99f7cab-f4a0-456d-977c-4234b1b11994%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin form_url breakout problem

2019-01-29 Thread Mike Dewhirst

Matthew

I looked for preventDefault and found it in lots of javascript scripts. 
So I decided instead to look at my python code which is slightly easier 
for me to understand. I sort of refactored it and cut large swags out to 
simplify and inserted lots of print statements. Then I thought I'd 
better read your advice again and try harder to understand it.


The bit which made sense to me was ...

'let the admin handle it from there'

... I noticed that I was returning the billing payment_view. As soon as 
I removed that 'return' and let the change_view return the super call it 
started working.


Thank you very much for persisting with me.

The Admin is fabulous! Nobel prize for something is warranted :)

Much appreciated

Mike

On 29/01/2019 2:31 am, Matthew Pava wrote:

Hi Mike,
When Stripe processes the payment, you need to preventDefault on the form 
submit, then add the token from Stripe to a hidden input in your form without 
affecting any other data in the form.  Then you can do form.submit() and let 
the admin handle it from there.  Check out the Stripe documentation for some 
good examples.  I've used it myself.

-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Mike Dewhirst
Sent: Friday, January 25, 2019 10:26 PM
To: django-users@googlegroups.com
Subject: Re: Admin form_url breakout problem

Matthew

I think I'll back everything out and start again. There must be a basic
blunder somewhere.

Just talking it through, I can definitely launch payment_view from the
Admin when all the ducks are in a line. That view populates the hidden
..._id fields and Stripe API fields in the form then calls the Stripe
API which initiates the  Stripe javascript in the Payment template which
resubmits the request with POST direct to Stripe so it can gather the
card detail and send back the json containing the token which proves the
card worked. At that point payment is made and my payment_view has lost
all the context because Stripe made the request not Django. payment_view
detects the Stripe response and must reconstruct the model instances
from the data pre-placed in the hidden form fields. Once the instances
are retrieved that payment_view code updates the subscription record,
creates a receipt record , assembles a message for the success_view and
sends an email to the user.

I am having trouble understanding the correct way to launch payment_view
so that Admin doesn't get confused wanting to add payment/ to the url
and thus keeping it all within the Admin.

Regarding your comment on using reverse to derive the link, I agree. I
was just being somewhat paranoid and skipping the reverse code which I
haven't taken the time to study. I will.

Thanks again

Mike


On 26/01/2019 1:59 am, Matthew Pava wrote:

Based on the error message, it looks like you’re trying to call
reverse(‘admin’) somewhere, but that’s not in the code you shared.
Actually, you probably want to use a reverse call when populating
content[‘link’].

*From:*django-users@googlegroups.com
[mailto:django-users@googlegroups.com] *On Behalf Of *Mike Dewhirst
*Sent:* Friday, January 25, 2019 3:35 AM
*To:* django-users@googlegroups.com
*Subject:* Re: Admin form_url breakout problem

On 25/01/2019 2:40 am, Matthew Pava wrote:

 Hi Mike,

 I'm not really seeing why this is throwing errors at you.  It seems like 
you've done everything right.  Could you provide the code (or the relevant 
parts) for the Substance Admin form?

 Thanks!


Matthew

I'm still in trouble and including some code. I'm not being precious
about it just hoping not to overwhelm you. Please ask for the next
instalment ...

class SubstanceAdmin(admin.ModelAdmin):

     def subscribe(self, sm2mi, fee_type, fullyear=False):
     """
     sm2mi is the substance<-ingredient m2m through record
     fee_type determines the subscription fee amount
     fullyear=False means calculate the fee pro-rata to 30 September

     We don't need a request here so this can be imported from
elsewhere.
     Only called if a fee is payable. Only returns a subscription
if no token or
         fullyear == True meaning a subscription renewal is due
     """
     subscription, new = Subscription.objects.get_or_create(
     licensee=sm2mi.substance.division.company,
     ingredient=sm2mi.ingredient,
     fee_type=fee_type,
     )
     if not subscription.token or fullyear:
     return subscription

     def change_view(self, request, object_id, form_url='',
extra_context=None):
     """
     For the billing system we want to include all the context data
so the
     change_form populates itself properly. See collect_content
     self = SubstanceAdmin
     request = wsgi request object
     object_id = substance
     form_url = no idea!
     extra_context = no_idea
     """
     sm2mis =

Work Opportunity

2019-01-29 Thread caleoroco
https://work.vendably.com/o/experienced-python-developer-remote-working

-- 
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/19561b48-3832-42a8-8c6d-f46e408d6074%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


base.html

2019-01-29 Thread Segun Gesture
Am trying to add a topic to my base.html and its telling me learning log is 
not a name space .
here is the code for the base.html modified 

learning log -
  Topics


{% block content %}{%endblock content %}

-- 
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/a03aa8b2-e08a-459e-823a-edc4f906fb0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PasswordResetConfirmView doesn't work through redirect in newest Safari

2019-01-29 Thread Jason
You're not the only one with this issue.

django-developer discussion at 
https://groups.google.com/forum/#!topic/django-developers/RyDdt1TcH0c
There's an open ticket on the django bug tracker at 
https://code.djangoproject.com/ticket/29975
and related on webkit:  https://bugs.webkit.org/show_bug.cgi?id=193502

Unfortunately, doesn't seem to be much action on this.  It really is a 
breaking change with Safari.

-- 
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/a9ecbb65-5103-4204-b227-49b62b881b6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: any good books for django2

2019-01-29 Thread omar ahmed
Django documentation is very good

بتاريخ ٢٠١٩/٠١/٢٩ ٦:٠٢ م، كتب "Lutalo Bbosa joseph" :

> guys can anyone assist me with a link to any django2 book because it seems
> its
> most are not free
>
> --
> 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/CAMz%3Dh%3DRdpm-MaeCG3d9Kf4tTQC5WS3BFXv9cF8S5n
> vCRtPN8Hg%40mail.gmail.com
> 
> .
> 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/CAOy9vcOc8f4qOkThONSy1rLBwxaw4-vVkEr3JN%3DP0o4XQwkbcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: any good books for django2

2019-01-29 Thread Vivek Jha
Just follow dango 2.1 documentation and visit website named
www.simpleisbetterthancomplex.com

On Wed, 30 Jan 2019, 00:48 Danylo K.  https://www.packtpub.com/application-development/django-2-example
> Great tutorial style-book.
>
> On Tue, Jan 29, 2019 at 11:02 AM Lutalo Bbosa joseph 
> wrote:
>
>> guys can anyone assist me with a link to any django2 book because it
>> seems its
>> most are not free
>>
>> --
>> 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/CAMz%3Dh%3DRdpm-MaeCG3d9Kf4tTQC5WS3BFXv9cF8S5nvCRtPN8Hg%40mail.gmail.com
>> 
>> .
>> 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/CADnU5JEDr%3DSi2Cn20QNTR8F%2BoxK73A5h6Ve6YQJQETD9bE1YUg%40mail.gmail.com
> 
> .
> 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/CAMriZeFpWNcMcKgWoOSPJ8Dz6Kk4CD3gqjY%2BKwX7Gb7%2BuOPbBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: any good books for django2

2019-01-29 Thread Danylo K.
https://www.packtpub.com/application-development/django-2-example
Great tutorial style-book.

On Tue, Jan 29, 2019 at 11:02 AM Lutalo Bbosa joseph 
wrote:

> guys can anyone assist me with a link to any django2 book because it seems
> its
> most are not free
>
> --
> 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/CAMz%3Dh%3DRdpm-MaeCG3d9Kf4tTQC5WS3BFXv9cF8S5nvCRtPN8Hg%40mail.gmail.com
> 
> .
> 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/CADnU5JEDr%3DSi2Cn20QNTR8F%2BoxK73A5h6Ve6YQJQETD9bE1YUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


PasswordResetConfirmView doesn't work through redirect in newest Safari

2019-01-29 Thread Henrik Ossipoff Hansen
Hi all,

Recently we've upgraded a project from Django 2.x to 2.1, which meant 
upgrading our old reset password functions based views to the newer class 
based models. However, since the change we're experiencing issues 
with PasswordResetConfirmView.

What we experiencing, in short, is that when we send our mails through 
Mandrill (the SMTP service from Mailchimp), and the user presses the reset 
password link, they get an error saying the link is invalid/expired. This 
happens only if the customer goes through the Mandrill redirect link AND 
uses the newest stable version of Safari shipping with macOS Mojave or the 
newest iOS versions.

I've been digging through the code, and it seems that the session 
framework/cookie framework simply isn't working when going through that 
particular redirect link. When the user lands on the first page in the 
confirmation view (which includes the full token), they get "None" as their 
sessionid. Just before the redirect (where the token is put into session, 
and replaced with "set password"), they get an actual sessionid - but when 
they're redirected to the "set-password" page, they now have a new 
sessionid, which of course means PasswordResetConfirmView cannot find their 
token in session storage, leading to the error message.

While I realise this might not be an issue with Django, and rather the way 
Mandrill deals with their redirection of links/some weird inner-workings in 
Safari, I'm wondering how other people have dealt with this issue.

Any help appreciated :)

-- 
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/6e017023-1fbd-4f22-8a03-53499c05497b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


any good books for django2

2019-01-29 Thread Lutalo Bbosa joseph
guys can anyone assist me with a link to any django2 book because it seems
its
most are not free

-- 
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/CAMz%3Dh%3DRdpm-MaeCG3d9Kf4tTQC5WS3BFXv9cF8S5nvCRtPN8Hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Limiting a SubQuery based on instance's OuterRef

2019-01-29 Thread Simon Charette
Hello Nick,

It isn't possible to reference columns in a LIMIT clause AFAIK.

I'd suggest you use a RowNumber[0] window function ordered by your number 
column in a
subquery and filter on the annotated value in the outer query.

Cheers,
Simon

[0] 
https://docs.djangoproject.com/en/2.1/ref/models/database-functions/#rownumber

Le mardi 29 janvier 2019 07:48:07 UTC-5, Nick Gashkov a écrit :
>
> Hello there!
>
> Is it possible to limit a SubQuery to a dynamic value of an instance in a 
> QuerySet? I.e. I'm looking for something like:
>
> queryset = 
> model.objects.filter(field=OuterRef('field')).values('another_field')[:OuterRef('number')]
>
> Sincerely,
> Nick Gashkov
>
>

-- 
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/113755a9-fe8e-40ec-866b-091ed3c2d381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Replicating a new database without using manage.py

2019-01-29 Thread pastrufazio
Hi all,

I'm creating multi-tenancy capabilities for out back-end application and I 
need to create a separate database for every current tenant.

Playing around with pg_dump and pg_restore, I noticed that a new restored 
PostgreSQL database is fully functional and I don't need to use the proper 
*makemigrations+migrate* procedure.

Then I can log in into the admin interface of the Django app and delete all 
the extraneous data leaving just the one related to the tenant.

Do you see any inconvenience in proceeding this way?

Below the procedure I use (cleansed of host, port and user options):

/usr/bin/pg_dump -Ft --no-acl --no-owner  -f /tmp/dump.tar
/usr/bin/pg_restore -n public -d  /tmp/dump.tar

Thank you very much.





-- 
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/af68cb61-01b4-44a0-9efc-faecb7c3f0fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
ok, pokušat ću. ak neuspijem posaljem ti sta god ti treba da pokusas sam
rekreirati...ovo je zaista zeznuto

uto, 29. sij 2019. u 13:56 Nebojsa Hajdukovic 
napisao je:

> To je greška zato što ne može da nađe url_id ajd ako ne uspeš pogledaću
> večeras detaljno šta si radio pa da vidim gde je greška
>
> уто, 29. јан 2019. у 13:51 Ivan Martić  је
> написао/ла:
>
>> napravio sam točno kako si rekao i dalje nece, isti error ...vec danima
>> se mucim sa ovime..nešto drugo je posrijedi.
>>
>>
>>
>>
>>
>> uto, 29. sij 2019. u 12:16 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> neće raditi ali ne zbog html već zbog greške u views
>>> probaj ovako
>>>
>>> def productsgrouping_update_view(request, url_id):
>>> assigned = get_object_or_404(Material, pk=url_id)
>>>
>>>
>>> naravno prvo moraš da importuješ get object or 404:
>>>
>>> from django.shortcuts import get_object_or_404
>>>
>>>
>>> уто, 29. јан 2019. у 12:00 Ivan Martić  је
>>> написао/ла:
>>>
 Bok Nebojša,

 mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
 jednom trenu je puknula veza. Neznam točno kada.
 Znači, da odem na url *productsgrouping *prikaze sve grupe, kad
 kliknem na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u
 url dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
 nastavi sve kako treba.
 Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku

 hvala ti za pomoć


 uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic <
 nebojsa.zero...@gmail.com> napisao je:

> A što ne uradiš update preko class based view daleko je lakše?
>
> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>
> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
> def productsgrouping_update_view(request, url_id):
> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>
>
> уто, 29. јан 2019. у 10:20 Ivan Martić  је
> написао/ла:
>
>> not sure what to say
>>
>> čet, 24. sij 2019. u 13:53 Ivan Martić 
>> napisao je:
>>
>>> Hi  Andréas,
>>> sorry for misspeling in codes. All is working ok except when i try
>>> to put url tag for 'update_productsgrouping'.
>>> I need to update group with new products but It does not argument
>>> for group id.
>>> What do you think i am doing wrong...?
>>>
>>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>>> napisao je:
>>>
 Hi,

 The reason you are getting this is that you are adding an argument
 to the productsgrouping url - which doesn't take any arguments.

 In your code you have:
 
 (Which by the way isn't correct either, I think you mean: >>> href="{% url 'productsgrouping' item.id%}">{{ item }} - {{item.id}}
 )

 If you look at the url for the producsgrouping view, you have:
 path('', views.productsgrouping_view, name='productsgrouping'),

 Which doesn't take any arguments, when you then add an argument
 django can't find the right URL.

 You may mean:
 {{ item }} -
 {{item.id}} 
 ?

 Regards,

 Andréas


 Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
 martic.i...@gmail.com>:

> Hi all,
>
> i am having issue with url tag, every time i put url tag like --{%
> url 'productsgrouping' item.id%}-- i get no reverse error.
> Can you help me figure it out on what am i doing wrong?
>
> view:
> def productsgrouping_view(request):
> queryset = MaterialGroup.objects.all()
> context = {"list" : queryset}
> return render(request, 'qif/productsgrouping/productsgroup.html',
> context)
>
> def productsgrouping_update_view(request, url_id):
> product_lista = MaterialGroup.objects.get(id=url_id)
> product_url_id = ProductgroupinputForm(request.POST or None,
> instance=product_lista)
> context1 = {'product_url_id': product_url_id, 'product_lista':
> product_lista}
>
> if product_url_id.is_valid():
> product_url_id.save()
>
> return render(request, 'productsgroup-update.html', context1)
>
> url:
> urlpatterns = [
> path('', views.productsgrouping_view, name='productsgrouping'),
> path('update//',
> views.productsgrouping_update_view, name='update_productsgrouping'),
> path('new/', views.creategroup_view, name='create_group'),
> ]
>
> html:
> {% extends 'base.html' %}
> {% block content %}
> 
> {% for item in list %}
> 
> 
> {{ item }} - {{item.id}}
> 
> {% endfor %}
> {% endblock %}

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Nebojsa Hajdukovic
To je greška zato što ne može da nađe url_id ajd ako ne uspeš pogledaću
večeras detaljno šta si radio pa da vidim gde je greška

уто, 29. јан 2019. у 13:51 Ivan Martić  је
написао/ла:

> napravio sam točno kako si rekao i dalje nece, isti error ...vec danima se
> mucim sa ovime..nešto drugo je posrijedi.
>
>
>
>
>
> uto, 29. sij 2019. u 12:16 Nebojsa Hajdukovic 
> napisao je:
>
>> neće raditi ali ne zbog html već zbog greške u views
>> probaj ovako
>>
>> def productsgrouping_update_view(request, url_id):
>>  assigned = get_object_or_404(Material, pk=url_id)
>>
>>
>> naravno prvo moraš da importuješ get object or 404:
>>
>> from django.shortcuts import get_object_or_404
>>
>>
>> уто, 29. јан 2019. у 12:00 Ivan Martić  је
>> написао/ла:
>>
>>> Bok Nebojša,
>>>
>>> mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
>>> jednom trenu je puknula veza. Neznam točno kada.
>>> Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem
>>> na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
>>> dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
>>> nastavi sve kako treba.
>>> Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku
>>>
>>> hvala ti za pomoć
>>>
>>>
>>> uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
>>> napisao je:
>>>
 A što ne uradiš update preko class based view daleko je lakše?

 https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/

 Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
 def productsgrouping_update_view(request, url_id):
 product_lista = get_object_or_404(MaterialGroup, pk=url_id)


 уто, 29. јан 2019. у 10:20 Ivan Martić  је
 написао/ла:

> not sure what to say
>
> čet, 24. sij 2019. u 13:53 Ivan Martić 
> napisao je:
>
>> Hi  Andréas,
>> sorry for misspeling in codes. All is working ok except when i try to
>> put url tag for 'update_productsgrouping'.
>> I need to update group with new products but It does not argument for
>> group id.
>> What do you think i am doing wrong...?
>>
>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>> napisao je:
>>
>>> Hi,
>>>
>>> The reason you are getting this is that you are adding an argument
>>> to the productsgrouping url - which doesn't take any arguments.
>>>
>>> In your code you have:
>>> 
>>> (Which by the way isn't correct either, I think you mean: >> href="{% url 'productsgrouping' item.id%}">{{ item }} - {{item.id}}
>>> )
>>>
>>> If you look at the url for the producsgrouping view, you have:
>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>
>>> Which doesn't take any arguments, when you then add an argument
>>> django can't find the right URL.
>>>
>>> You may mean:
>>> {{ item }} - {{
>>> item.id}} 
>>> ?
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
>>> martic.i...@gmail.com>:
>>>
 Hi all,

 i am having issue with url tag, every time i put url tag like --{%
 url 'productsgrouping' item.id%}-- i get no reverse error.
 Can you help me figure it out on what am i doing wrong?

 view:
 def productsgrouping_view(request):
 queryset = MaterialGroup.objects.all()
 context = {"list" : queryset}
 return render(request, 'qif/productsgrouping/productsgroup.html',
 context)

 def productsgrouping_update_view(request, url_id):
 product_lista = MaterialGroup.objects.get(id=url_id)
 product_url_id = ProductgroupinputForm(request.POST or None,
 instance=product_lista)
 context1 = {'product_url_id': product_url_id, 'product_lista':
 product_lista}

 if product_url_id.is_valid():
 product_url_id.save()

 return render(request, 'productsgroup-update.html', context1)

 url:
 urlpatterns = [
 path('', views.productsgrouping_view, name='productsgrouping'),
 path('update//',
 views.productsgrouping_update_view, name='update_productsgrouping'),
 path('new/', views.creategroup_view, name='create_group'),
 ]

 html:
 {% extends 'base.html' %}
 {% block content %}
 
 {% for item in list %}
 
 
 {{ item }} - {{item.id}}
 
 {% endfor %}
 {% endblock %}

 --
 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 

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
napravio sam točno kako si rekao i dalje nece, isti error ...vec danima se
mucim sa ovime..nešto drugo je posrijedi.





uto, 29. sij 2019. u 12:16 Nebojsa Hajdukovic 
napisao je:

> neće raditi ali ne zbog html već zbog greške u views
> probaj ovako
>
> def productsgrouping_update_view(request, url_id):
>   assigned = get_object_or_404(Material, pk=url_id)
>
>
> naravno prvo moraš da importuješ get object or 404:
>
> from django.shortcuts import get_object_or_404
>
>
> уто, 29. јан 2019. у 12:00 Ivan Martić  је
> написао/ла:
>
>> Bok Nebojša,
>>
>> mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
>> jednom trenu je puknula veza. Neznam točno kada.
>> Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem
>> na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
>> dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
>> nastavi sve kako treba.
>> Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku
>>
>> hvala ti za pomoć
>>
>>
>> uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
>> napisao je:
>>
>>> A što ne uradiš update preko class based view daleko je lakše?
>>>
>>> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>>>
>>> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
>>> def productsgrouping_update_view(request, url_id):
>>> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>>>
>>>
>>> уто, 29. јан 2019. у 10:20 Ivan Martić  је
>>> написао/ла:
>>>
 not sure what to say

 čet, 24. sij 2019. u 13:53 Ivan Martić  napisao
 je:

> Hi  Andréas,
> sorry for misspeling in codes. All is working ok except when i try to
> put url tag for 'update_productsgrouping'.
> I need to update group with new products but It does not argument for
> group id.
> What do you think i am doing wrong...?
>
> čet, 24. sij 2019. u 13:43 Andréas Kühne 
> napisao je:
>
>> Hi,
>>
>> The reason you are getting this is that you are adding an argument to
>> the productsgrouping url - which doesn't take any arguments.
>>
>> In your code you have:
>> 
>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>
>> If you look at the url for the producsgrouping view, you have:
>> path('', views.productsgrouping_view, name='productsgrouping'),
>>
>> Which doesn't take any arguments, when you then add an argument
>> django can't find the right URL.
>>
>> You may mean:
>> {{ item }} - {{
>> item.id}} 
>> ?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
>> martic.i...@gmail.com>:
>>
>>> Hi all,
>>>
>>> i am having issue with url tag, every time i put url tag like --{%
>>> url 'productsgrouping' item.id%}-- i get no reverse error.
>>> Can you help me figure it out on what am i doing wrong?
>>>
>>> view:
>>> def productsgrouping_view(request):
>>> queryset = MaterialGroup.objects.all()
>>> context = {"list" : queryset}
>>> return render(request, 'qif/productsgrouping/productsgroup.html',
>>> context)
>>>
>>> def productsgrouping_update_view(request, url_id):
>>> product_lista = MaterialGroup.objects.get(id=url_id)
>>> product_url_id = ProductgroupinputForm(request.POST or None,
>>> instance=product_lista)
>>> context1 = {'product_url_id': product_url_id, 'product_lista':
>>> product_lista}
>>>
>>> if product_url_id.is_valid():
>>> product_url_id.save()
>>>
>>> return render(request, 'productsgroup-update.html', context1)
>>>
>>> url:
>>> urlpatterns = [
>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>> path('update//', views.productsgrouping_update_view,
>>> name='update_productsgrouping'),
>>> path('new/', views.creategroup_view, name='create_group'),
>>> ]
>>>
>>> html:
>>> {% extends 'base.html' %}
>>> {% block content %}
>>> 
>>> {% for item in list %}
>>> 
>>> 
>>> {{ item }} - {{item.id}}
>>> 
>>> {% endfor %}
>>> {% endblock %}
>>>
>>> --
>>> 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/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
>>> 
>>> 

Limiting a SubQuery based on instance's OuterRef

2019-01-29 Thread Nick Gashkov
Hello there!

Is it possible to limit a SubQuery to a dynamic value of an instance in a 
QuerySet? I.e. I'm looking for something like:

queryset = 
model.objects.filter(field=OuterRef('field')).values('another_field')[:OuterRef('number')]

Sincerely,
Nick Gashkov

-- 
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/13c55e39-8d46-4828-b5f6-5d00c1795b50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django wagtial docker production and staging database

2019-01-29 Thread Tim Vogt
Hi I have a wagtail application running on digital ocean,
Deployed with ansibble and docker (separate)

When I used amazon I had staging and production branches in my git 
environment (for small flask projects). 
Now I user docker and try tor find a way to handle the settings.py for 
staging with local database sqllite and for production postgres.

I found out how to implement postgres. settings.dev.py 
settings.production.py, but how to trigger the settings.production.py and 
how to trigger the local settings.dev.py?

So that the local database is data is not passing over to the production 
postgres database?

Do I set it up in my yml file? Or do I use a cli command? 
Tim

-- 
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/83c44a37-9eb9-4f5b-85a9-dc3833c93637%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how to aasign id on forms.py and how to generates choices on the form of another models for individual id ,choices may be differenet for individual id

2019-01-29 Thread Suzan Bajracharya


class Medical_Meds(models.Model): medicines=models.CharField(max_length=250) 
amount=models.IntegerField(default=0) # 
is_purchase=models.BooleanField(default=False) 
p_date=models.DateTimeField(default=datetime.now) 
patient=models.ForeignKey(Patient) medical=models.ForeignKey(Medical) class 
Medical_Meds_Forms(forms.ModelForm): patient=4, opt = [] # my = 
Doctor_Patient_Med.objects.all() my = 
Doctor_Patient_Med.objects.filter(patient=patient) for x in my: 
opt.append([x.medicines,x.medicines]) total=len(opt) print(total) medicines 
=forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=opt) 
amount=forms.IntegerField(label='Amount',initial="0") 
p_date=forms.widgets.DateTimeInput(attrs={'type':'date'}) # p_date = 
forms.DateTimeField(label='Purchase-Date', 
widget=forms.DateTimeInput(attrs={'type':'date'})) class Meta: 
model=Medical_Meds exclude=['patient','doctor','medical']

-- 
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/61b2f836-49db-4d1b-973f-6676a8a734b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sending data from Python Web socket client to Django Channels

2019-01-29 Thread suleman . qutb
 

I am trying to send data to Django Channels (chat application 
) from Python 
web socket client  . I am 
able to do the handshake but my data (string) is not being populated in the 
chat web page.

*My consumers of django channels*

*consumers.py*

class EchoConsumer(WebsocketConsumer):

def connect(self):
self.room_name = self.scope['url_route']['kwargs']['room_name']
self.room_group_name = 'power_%s' % self.room_name

# Join room group
async_to_sync(self.channel_layer.group_add)(
self.room_group_name,
self.channel_name
)

self.accept()

def disconnect(self, close_code):
# Leave room group
async_to_sync(self.channel_layer.group_discard)(
self.room_group_name,
self.channel_name
)

# Receive message from WebSocket

def receive(self, text_data):
text_data_json = json.loads(text_data)
message = text_data_json['message']

# Send message to room group
async_to_sync(self.channel_layer.group_send)(
self.room_group_name,
{
'type': 'chat_message',
'message': message
}
)

# Receive message from room group

def chat_message(self, event):
message = event['message']

# Send message to WebSocket
self.send(text_data=json.dumps({
'message': message
}))

*My Python web socket client*

*my-websocket.py*

def on_message(ws, message):
print (message)
def on_error(ws, error):
print ("eroror:", error)
def on_close(ws):
print ("### closed ###")
# Attemp to reconnect with 2 seconds interval
time.sleep(2)
initiate()
def on_open(ws):
print ("### Initiating new websocket connectipython my-websocket.pyon ###")
def run(*args):
for i in range(3):
# Sending message with 1 second intervall
time.sleep(1)

ws.send("Hello %d" % i)
time.sleep(1)
ws.close()
print ("thread terminating...")
_thread.start_new_thread(run, ())
def initiate():
websocket.enableTrace(True)
ws = websocket.WebSocketApp("ws://localhost:8000/ws/power/room/",
on_message = on_message,
on_error = on_error,
on_close = on_close)
ws.on_open = on_open

ws.run_forever()
if __name__ == "__main__":
initiate()

*The error i am receiving at ASGI server is* 

WebSocket CONNECT /ws/power/room/ [127.0.0.1:50918]Exception inside 
application: Expecting value: line 1 column 1 (char 0)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\sessions.py",
 line 179, in __call__
return await self.inner(receive, self.send)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\middleware.py",
 line 41, in coroutine_call
await inner_instance(receive, send)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\consumer.py",
 line 59, in __call__
[receive, self.channel_receive], self.dispatch
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\utils.py",
 line 52, in await_many_dispatch
await dispatch(result)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asgiref\sync.py",
 line 108, in __call__
return await asyncio.wait_for(future, timeout=None)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\asyncio\tasks.py",
 line 388, in wait_for
return await fut
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\concurrent\futures\thread.py",
 line 57, in run
result = self.fn(*self.args, **self.kwargs)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\db.py",
 line 13, in thread_handler
return super().thread_handler(loop, *args, **kwargs)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\asgiref\sync.py",
 line 123, in thread_handler
return self.func(*args, **kwargs)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\consumer.py",
 line 105, in dispatch
handler(message)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\site-packages\channels\generic\websocket.py",
 line 60, in websocket_receive
self.receive(text_data=message["text"])
  File "C:\Users\Admin\PycharmProjects\power\myChannels\consumers.py", line 41, 
in receive
text_data_json = json.loads(text_data)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\json\__init__.py",
 line 348, in loads
return _default_decoder.decode(s)
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python37-32\lib\json\decoder.py", 
line 337, in decode
obj, end = 

Re: validator not working in serializers.ModelSerializer

2019-01-29 Thread Ayomide Onibokun
does python has a similar cms like wordpress?

On Tue, 29 Jan 2019 at 03:36, Maurya Allimuthu 
wrote:

> Hi  Andréas,
>
> I have fixed it. like subclassing the serializer field class and
> overriding the to_representation for per field.
> Thanks for the help once again.
>
> Thanks,
> Maurya
>
> On Fri, Jan 25, 2019 at 10:50 PM Andréas Kühne 
> wrote:
>
>> If you want to change the output, you can override the fields that you
>> output in your serializer. That's what the fields are for?
>>
>> I think it would be helpful if you provide more information because at
>> least I don't really understand your use-case.
>>
>> The way I would do it is to change the fields and format them the way I
>> wanted them to be on a get request.
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den fre 25 jan. 2019 kl 02:47 skrev Maurya Allimuthu <
>> catchmau...@gmail.com>:
>>
>>> Hi Andreas Kuhne,
>>>
>>> Thanks on the quick answer and great help. :-)
>>>
>>> Hi Andreas Kuhne/All,
>>>
>>> Is there a way or any kind of approach, I can use validators/anything in
>>> GET method to format/change the output of the data coming from database and
>>> before getting changed by serializer as stream of strings.
>>> Please let me know if any.
>>>
>>> Regards,
>>> Maurya
>>>
>>> On Thu, Jan 24, 2019 at 8:40 PM Andréas Kühne <
>>> andreas.ku...@hypercode.se> wrote:
>>>
 Hi,

 Validators are only called when you are updating something on the model
 - a get request doesn't update anything and the validators will not be
 called (there is no data sent to the server to validate). The validators
 will be called on a POST, PUT or PATCH request.

 Regards,

 Andréas


 Den tors 24 jan. 2019 kl 13:19 skrev Maurya Allimuthu <
 catchmau...@gmail.com>:

> Hi All,
>
> I use  serializers.ModelSerializer and viewset DetailViewset(APIView).
>
> The validators are not getting called on GET request of the viewset
> via URLS, but the GET request is working.
>
>
> def validate(self, attrs):
> if attrs.get('password') != attrs.get('confirm_password'):
> raise serializers.ValidationError("Those passwords don't match.")
> return attrs
>
> OR
>
>
> class Meta:
> model = *
> fields = ('***', )
> validators = [
> trigger_validator
> ]
>
>
> Thanks,
> Maurya
>
> --
> 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/ef2204c4-eed2-411c-a157-d8e1d1d63744%40googlegroups.com
> 
> .
> 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/CAK4qSCcnMq6jGwToc8cw4EZ1Ksg5pA-1g5KawF26R2AwB%3DXaAw%40mail.gmail.com
 
 .
 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/CAEqjY81wfmvchoQcNvz0G2s7mR2vk2B17-KA1XSLiLv%3D4Cnk%2Bg%40mail.gmail.com
>>> 
>>> .
>>> 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
>> 

Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-29 Thread Gundla Kumar
Hai,

Can you help me how to solve my problem, when launch project in my local,
it gives error as "ImportError: No module named copy_reg" and "ImportError:
No module named multiplearray"

On Tue, Jan 29, 2019 at 5:30 PM Binoy U  wrote:

> Hello Simon,
>
> Thank you for the reply. I have changed it as you mentioned and it's
> working now. I will raise an issue to update the documentation.
>
> On Monday, January 28, 2019 at 1:20:24 PM UTC+1, Binoy U wrote:
>>
>> Hello,
>>
>> I have created a django project with only one application. I haven't made
>> any changes in the application. Only added the application to the settings
>> and updated static and media urls.
>>
>> Migration is done and super user was created.
>>
>> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according
>> to Authenticating against Django’s user database from Apache
>> 
>> .
>>
>> But getting the following error in apache error log.
>>
>> Traceback (most recent call last):
>>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
>> 13, in 
>> from django.contrib.auth.handlers.modwsgi import check_password
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>>  line 5, in 
>> UserModel = auth.get_user_model()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>>  line 165, in get_user_model
>> return django_apps.get_model(settings.AUTH_USER_MODEL, 
>> require_ready=False)
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 197, in get_model
>> self.check_apps_ready()
>>   File 
>> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>>  line 132, in check_apps_ready
>> raise AppRegistryNotReady("Apps aren't loaded yet.")
>>
>> Please find files below wsgi.py
>>
>> import osimport mod_wsgi
>>
>> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
>> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
>> django.core.wsgi import get_wsgi_application
>> application = get_wsgi_application()
>>
>> Error is triggered from from django.contrib.auth.handlers.modwsgi import
>> check_password.
>>
>>
>> apache config file 000-defaults.conf
>> 
>>
>>
>> Authentication is enabled on the media url. So I hope the apache
>> configuration is working fine. I have create a github repository
>>  if you would like
>> to check.
>>
>> I got this issue from a bigger project with many application and other
>> django modules. But I could still reproduce the same issue with this simple
>> project. Can you please help me to resolve this issue, thanks in advance!
>>
> --
> 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/276e126a-6093-42b2-b6ce-9db77b919027%40googlegroups.com
> 
> .
> 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/CAN0qQEYQ8oTG8gLnWbG00a%2B97rcvPp77xh5zCtf57Sm-70ka_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

2019-01-29 Thread Binoy U
Hello Simon,

Thank you for the reply. I have changed it as you mentioned and it's 
working now. I will raise an issue to update the documentation.

On Monday, January 28, 2019 at 1:20:24 PM UTC+1, Binoy U wrote:
>
> Hello,
>
> I have created a django project with only one application. I haven't made 
> any changes in the application. Only added the application to the settings 
> and updated static and media urls.
>
> Migration is done and super user was created.
>
> I have configured apache(version:2.4.29) and mod_wsgi(4.5.17) according to 
> Authenticating 
> against Django’s user database from Apache 
> 
> .
>
> But getting the following error in apache error log.
>
> Traceback (most recent call last):
>   File "/home/User1/Documents/test/check_apache/check_apache/wsgi.py", line 
> 13, in 
> from django.contrib.auth.handlers.modwsgi import check_password
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/handlers/modwsgi.py",
>  line 5, in 
> UserModel = auth.get_user_model()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/contrib/auth/__init__.py",
>  line 165, in get_user_model
> return django_apps.get_model(settings.AUTH_USER_MODEL, 
> require_ready=False)
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 197, in get_model
> self.check_apps_ready()
>   File 
> "/home/User1/Documents/test/lib/python3.6/site-packages/django/apps/registry.py",
>  line 132, in check_apps_ready
> raise AppRegistryNotReady("Apps aren't loaded yet.")
>
> Please find files below wsgi.py
>
> import osimport mod_wsgi
>
> os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'check_apache.settings')from 
> django.contrib.auth.handlers.modwsgi import check_passwordfrom 
> django.core.wsgi import get_wsgi_application
> application = get_wsgi_application()
>
> Error is triggered from from django.contrib.auth.handlers.modwsgi import 
> check_password.
>
>
> apache config file 000-defaults.conf 
> 
>
>
> Authentication is enabled on the media url. So I hope the apache 
> configuration is working fine. I have create a github repository 
>  if you would like to 
> check.
>
> I got this issue from a bigger project with many application and other 
> django modules. But I could still reproduce the same issue with this simple 
> project. Can you please help me to resolve this issue, thanks in advance!
>

-- 
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/276e126a-6093-42b2-b6ce-9db77b919027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Nebojsa Hajdukovic
neće raditi ali ne zbog html već zbog greške u views
probaj ovako

def productsgrouping_update_view(request, url_id):
assigned = get_object_or_404(Material, pk=url_id)


naravno prvo moraš da importuješ get object or 404:

from django.shortcuts import get_object_or_404


уто, 29. јан 2019. у 12:00 Ivan Martić  је
написао/ла:

> Bok Nebojša,
>
> mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
> jednom trenu je puknula veza. Neznam točno kada.
> Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem
> na grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
> dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
> nastavi sve kako treba.
> Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku
>
> hvala ti za pomoć
>
>
> uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
> napisao je:
>
>> A što ne uradiš update preko class based view daleko je lakše?
>>
>> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>>
>> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
>> def productsgrouping_update_view(request, url_id):
>> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>>
>>
>> уто, 29. јан 2019. у 10:20 Ivan Martić  је
>> написао/ла:
>>
>>> not sure what to say
>>>
>>> čet, 24. sij 2019. u 13:53 Ivan Martić  napisao
>>> je:
>>>
 Hi  Andréas,
 sorry for misspeling in codes. All is working ok except when i try to
 put url tag for 'update_productsgrouping'.
 I need to update group with new products but It does not argument for
 group id.
 What do you think i am doing wrong...?

 čet, 24. sij 2019. u 13:43 Andréas Kühne 
 napisao je:

> Hi,
>
> The reason you are getting this is that you are adding an argument to
> the productsgrouping url - which doesn't take any arguments.
>
> In your code you have:
> 
> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>
> If you look at the url for the producsgrouping view, you have:
> path('', views.productsgrouping_view, name='productsgrouping'),
>
> Which doesn't take any arguments, when you then add an argument django
> can't find the right URL.
>
> You may mean:
> {{ item }} - {{
> item.id}} 
> ?
>
> Regards,
>
> Andréas
>
>
> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić <
> martic.i...@gmail.com>:
>
>> Hi all,
>>
>> i am having issue with url tag, every time i put url tag like --{%
>> url 'productsgrouping' item.id%}-- i get no reverse error.
>> Can you help me figure it out on what am i doing wrong?
>>
>> view:
>> def productsgrouping_view(request):
>> queryset = MaterialGroup.objects.all()
>> context = {"list" : queryset}
>> return render(request, 'qif/productsgrouping/productsgroup.html',
>> context)
>>
>> def productsgrouping_update_view(request, url_id):
>> product_lista = MaterialGroup.objects.get(id=url_id)
>> product_url_id = ProductgroupinputForm(request.POST or None,
>> instance=product_lista)
>> context1 = {'product_url_id': product_url_id, 'product_lista':
>> product_lista}
>>
>> if product_url_id.is_valid():
>> product_url_id.save()
>>
>> return render(request, 'productsgroup-update.html', context1)
>>
>> url:
>> urlpatterns = [
>> path('', views.productsgrouping_view, name='productsgrouping'),
>> path('update//', views.productsgrouping_update_view,
>> name='update_productsgrouping'),
>> path('new/', views.creategroup_view, name='create_group'),
>> ]
>>
>> html:
>> {% extends 'base.html' %}
>> {% block content %}
>> 
>> {% for item in list %}
>> 
>> 
>> {{ item }} - {{item.id}}
>> 
>> {% endfor %}
>> {% endblock %}
>>
>> --
>> 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/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
>> 
>> .
>> 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 

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
Bok Nebojša,

mislim da je stvar u HTML možda prije, jer mi je ranije sve radilo..u
jednom trenu je puknula veza. Neznam točno kada.
Znači, da odem na url *productsgrouping *prikaze sve grupe, kad kliknem na
grupu (dodam joj a=href) no reverse mathc, ako maknem atribute u url
dobijem #, a ako ručno upišem productsgrouping/update/1 onda prikaze i
nastavi sve kako treba.
Znaci samo nemogu povezati ta dva linkapogledaj htmlove u privitku

hvala ti za pomoć


uto, 29. sij 2019. u 11:35 Nebojsa Hajdukovic 
napisao je:

> A što ne uradiš update preko class based view daleko je lakše?
>
> https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/
>
> Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
> def productsgrouping_update_view(request, url_id):
> product_lista = get_object_or_404(MaterialGroup, pk=url_id)
>
>
> уто, 29. јан 2019. у 10:20 Ivan Martić  је
> написао/ла:
>
>> not sure what to say
>>
>> čet, 24. sij 2019. u 13:53 Ivan Martić  napisao
>> je:
>>
>>> Hi  Andréas,
>>> sorry for misspeling in codes. All is working ok except when i try to
>>> put url tag for 'update_productsgrouping'.
>>> I need to update group with new products but It does not argument for
>>> group id.
>>> What do you think i am doing wrong...?
>>>
>>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>>> napisao je:
>>>
 Hi,

 The reason you are getting this is that you are adding an argument to
 the productsgrouping url - which doesn't take any arguments.

 In your code you have:
 
 (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )

 If you look at the url for the producsgrouping view, you have:
 path('', views.productsgrouping_view, name='productsgrouping'),

 Which doesn't take any arguments, when you then add an argument django
 can't find the right URL.

 You may mean:
 {{ item }} - {{
 item.id}} 
 ?

 Regards,

 Andréas


 Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić >>> >:

> Hi all,
>
> i am having issue with url tag, every time i put url tag like --{% url
> 'productsgrouping' item.id%}-- i get no reverse error.
> Can you help me figure it out on what am i doing wrong?
>
> view:
> def productsgrouping_view(request):
> queryset = MaterialGroup.objects.all()
> context = {"list" : queryset}
> return render(request, 'qif/productsgrouping/productsgroup.html',
> context)
>
> def productsgrouping_update_view(request, url_id):
> product_lista = MaterialGroup.objects.get(id=url_id)
> product_url_id = ProductgroupinputForm(request.POST or None,
> instance=product_lista)
> context1 = {'product_url_id': product_url_id, 'product_lista':
> product_lista}
>
> if product_url_id.is_valid():
> product_url_id.save()
>
> return render(request, 'productsgroup-update.html', context1)
>
> url:
> urlpatterns = [
> path('', views.productsgrouping_view, name='productsgrouping'),
> path('update//', views.productsgrouping_update_view,
> name='update_productsgrouping'),
> path('new/', views.creategroup_view, name='create_group'),
> ]
>
> html:
> {% extends 'base.html' %}
> {% block content %}
> 
> {% for item in list %}
> 
> 
> {{ item }} - {{item.id}}
> 
> {% endfor %}
> {% endblock %}
>
> --
> 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/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
> 
> .
> 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/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com
 
 .
 For more options, 

Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Nebojsa Hajdukovic
A što ne uradiš update preko class based view daleko je lakše?
https://docs.djangoproject.com/en/2.1/ref/class-based-views/generic-editing/

Ako hoćeš preko funkcije ja radim sa get_object_or_404, ovako:
def productsgrouping_update_view(request, url_id):
product_lista = get_object_or_404(MaterialGroup, pk=url_id)


уто, 29. јан 2019. у 10:20 Ivan Martić  је
написао/ла:

> not sure what to say
>
> čet, 24. sij 2019. u 13:53 Ivan Martić  napisao je:
>
>> Hi  Andréas,
>> sorry for misspeling in codes. All is working ok except when i try to put
>> url tag for 'update_productsgrouping'.
>> I need to update group with new products but It does not argument for
>> group id.
>> What do you think i am doing wrong...?
>>
>> čet, 24. sij 2019. u 13:43 Andréas Kühne 
>> napisao je:
>>
>>> Hi,
>>>
>>> The reason you are getting this is that you are adding an argument to
>>> the productsgrouping url - which doesn't take any arguments.
>>>
>>> In your code you have:
>>> 
>>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>>
>>> If you look at the url for the producsgrouping view, you have:
>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>>
>>> Which doesn't take any arguments, when you then add an argument django
>>> can't find the right URL.
>>>
>>> You may mean:
>>> {{ item }} - {{
>>> item.id}} 
>>> ?
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>>
>>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić >> >:
>>>
 Hi all,

 i am having issue with url tag, every time i put url tag like --{% url
 'productsgrouping' item.id%}-- i get no reverse error.
 Can you help me figure it out on what am i doing wrong?

 view:
 def productsgrouping_view(request):
 queryset = MaterialGroup.objects.all()
 context = {"list" : queryset}
 return render(request, 'qif/productsgrouping/productsgroup.html',
 context)

 def productsgrouping_update_view(request, url_id):
 product_lista = MaterialGroup.objects.get(id=url_id)
 product_url_id = ProductgroupinputForm(request.POST or None,
 instance=product_lista)
 context1 = {'product_url_id': product_url_id, 'product_lista':
 product_lista}

 if product_url_id.is_valid():
 product_url_id.save()

 return render(request, 'productsgroup-update.html', context1)

 url:
 urlpatterns = [
 path('', views.productsgrouping_view, name='productsgrouping'),
 path('update//', views.productsgrouping_update_view,
 name='update_productsgrouping'),
 path('new/', views.creategroup_view, name='create_group'),
 ]

 html:
 {% extends 'base.html' %}
 {% block content %}
 
 {% for item in list %}
 
 
 {{ item }} - {{item.id}}
 
 {% endfor %}
 {% endblock %}

 --
 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/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
 
 .
 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/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com
>>> 
>>> .
>>> 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/CAFab_C8HUsxdpqz-MGqcpw0ZwgFOvrYZ-RJte6-H5x38b97ciQ%40mail.gmail.com
> 

Re: Logging of full trace with Debug set to False

2019-01-29 Thread Kevin Olbrich
Hi!

Seems like things were improved since then:
https://docs.sentry.io/platforms/python/celery/

There is an integration that I can enable which should take care of things.

I realy like Sentry. Currently I use the free tier while I check how to 
setup my own node.
Some of my Apps already send Exceptions (broke some things to test it).

Thanks for the hint to this excellent tool!

Kevin

Am Montag, 28. Januar 2019 13:55:29 UTC+1 schrieb Michal Petrucha:
>
> -BEGIN PGP SIGNED MESSAGE- 
> Hash: SHA512 
>
> On Mon, Jan 28, 2019 at 04:45:44AM -0800, Kevin Olbrich wrote: 
> > Hi Anirudh, 
> > 
> > I am using uWSGI and not Gunicorn. At least for uWSGI, with Debug = 
> False, 
> > it only logs the HTTP status code but not exception (might be the same 
> with 
> > Gunicorn). 
> > I will try Sentry which provides a clean GUI and notification of new 
> > problems. This also seems to work for my Celery tasks and Django admin 
> > commands. 
>
> Since you're mentioning Celery, I thought it might be worth mentioning 
> that Celery performs some black magic ritual on the Python logging 
> config in its default configuration, which interferes with the way 
> Sentry handles errors – or at least that's been my experience. At one 
> point I noticed that errors happening inside Celery tasks didn't have 
> all the stack values, like ones from the regular request/response had. 
> I don't remember exactly how, and I don't have access to that code 
> base anymore, but I remember that we had to explicitly disable as much 
> of Celery's custom logging as we could in order to get that to work. 
> (Might be that things have improved since then, though.) 
>
> Good luck, 
>
> Michal 
> -BEGIN PGP SIGNATURE- 
> Version: GnuPG v1 
>
> iQIcBAEBCgAGBQJcTvuFAAoJEHA7T/IPM/kltD8P/0MfET5/KylfZM/BWHDz4+vn 
> 8U7hr4Zraz5R+zzr4yq7Ow0tom4zWE0EqpYREv87A4tX7dHGITTQLbU+bCce/MNQ 
> tIVD2D498XsEBGRsNav0kOr6ATuWoPuJlLLSFYGbGHedCKz6UB+ftmwYhL7WOQgr 
> zE8LeLS37jbm02/z6DD25intYUpRbKeeSRjyqkc+6esUz2IAXVQQ1NcUtJjPbmvi 
> zJtyWUX/RXS3Wulrp8lwLJ7rThcFAh3wVmC/nJCHeBQFLDmmLZx08EEnV1w7uxwv 
> AcowzfrGPOYv7VcOK9K9KvUPCrIj3KovU4DPlffuX6xxy8FZTvIyDptJAaMnh9C+ 
> i8So48kPL1TxBk1lPuWx8TLr+RR1y4LIy7KVwMgRyeFC5zGIdBiAFIwo9X5utdc9 
> 1uuO07bGn9224vpk87zyizA8Q88Qeee7kco+a0v0f8+Xxz6oAKg9uf3broJ9nl99 
> jp6Pp9QTzlpYFnw0bjMDMI3KRLkAxbWmeuGtBt7tELKFfHoae3RtfCqNitvEhN07 
> rz44xC2dbwPvQdV2UMElX+jS9omk+8oEwgMNvOPXyAsf3NexwcuN0lzoo5MS2OpY 
> kkwbNCD0aeHtreY5BJrXgONmXd58OswZhsCbcvZXqhIJ1MxreCzasXVvF7ZNHp6z 
> daRHSphHWV6/sDLFFfGw 
> =6WLZ 
> -END PGP SIGNATURE- 
>

-- 
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/bac79f70-487f-45dd-9d66-c9f397cb3785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django, mod_wsgi and apache2.4 = 403 forbidden

2019-01-29 Thread Mohammad Etemaddar
I have no experience in configure apache. But these two lines have conflict.

DocumentRoot 
C:\Frontier_Website\FATWebsite\FrontierWebApp\zigview\templates\FrounterWeb
and:
WSGIScriptAlias / 
C:\Frontier_Website\FATWebsite\FrontierWebApp\FrounterWeb\wsgi.py

Both of these lines tell apache how to handle the 
*/ *
But for the first one you did not grant access to it's folder and you 
shouldn't
So you should remove the first line. I mean DocumentRoot. You do not need 
it when you are configure your django site at root ( / )

On Tuesday, January 29, 2019 at 11:12:22 AM UTC+3:30, Rookies DJ wrote:
>
> I'm sorry if I'm asking the repetitive but i really need assistance I been 
> trying to setup a server for my company system but I had no progress. 
>
> As the tile subject mention the I'm Using Mod_wsgi 4.6.5 and Apache 2.4
>
> for my Django is 2.1 and python 3.7
>
> When try to run on my local machine I get 403 and I did many google search 
> and the only answer I get is add in Require all granted which I had already 
> add in. you could see below for particle section for my Apache http
>
> LoadModule wsgi_module 
> "C:\users\user\appdata\local\programs\python\python37\lib\site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd"
> WSGIScriptAlias / "C:\Frontier_Website\FrounterWebApp\FrounterWeb\wsgi.py"\
> WSGIPythonPath "C:\Frontier_Website\FrounterWebApp\zigview"
> WSGIPythonHome "C:\Users\user\AppData\Local\Programs\Python\Python37"
>
> 
> Require all granted
> 
>
> 
> 
> Require all granted
> 
> 
>
>
> for more detail you can look at at code in stackoverflow.com:
>  
>
> https://stackoverflow.com/questions/54249683/django-mod-wsgi-and-apache2-4-problems
>   
> I had try to run the system in virtualenv but I get no result as well and 
> when I try to start the server, I get this error: *The system cannot find 
> the path specified.*
> The virtualenv code is below;
>
> #python and mod_wsgi setting 
> 
>  ServerName Localhost.com 
>  DocumentRoot 
> C:\Frontier_Website\FATWebsite\FrontierWebApp\zigview\templates\FrounterWeb
> LoadModule wsgi_module 
> C:\users\user\appdata\local\programs\python\python37\lib\site-packages/mod_wsgi/server/mod_wsgi.cp37-win_amd64.pyd
> WSGIScriptAlias / 
> C:\Frontier_Website\FATWebsite\FrontierWebApp\FrounterWeb\wsgi.py
> WSGIPythonHome C:\Frontier_Website\FATWebsite\Lib
> WSGIPythonPath C:\Frontier_Website\FrounterWebApp\zigview
>
> Alias /static \Frontier_Website\FATWebsite\FrounterWebApp\zigview\static
> 
> Require all granted
> 
>
>  C:\Frontier_Website\FATWebsite\FrounterWebApp\FronterWeb\wsgi-script>
> 
>Require all granted
> 
>
> 
>  
>  
> Please help I had been trying to solve this problem for month now
>

-- 
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/aba38722-89e1-455a-a536-8713b79c39c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /someurlname/ - Reverse for 'htmlname' with arguments '('1',)' not found. 1 pattern(s) tried: ['somehtmlname/$']

2019-01-29 Thread Ivan Martić
not sure what to say

čet, 24. sij 2019. u 13:53 Ivan Martić  napisao je:

> Hi  Andréas,
> sorry for misspeling in codes. All is working ok except when i try to put
> url tag for 'update_productsgrouping'.
> I need to update group with new products but It does not argument for
> group id.
> What do you think i am doing wrong...?
>
> čet, 24. sij 2019. u 13:43 Andréas Kühne 
> napisao je:
>
>> Hi,
>>
>> The reason you are getting this is that you are adding an argument to the
>> productsgrouping url - which doesn't take any arguments.
>>
>> In your code you have:
>> 
>> (Which by the way isn't correct either, I think you mean: {{ item }} - {{item.id}} )
>>
>> If you look at the url for the producsgrouping view, you have:
>> path('', views.productsgrouping_view, name='productsgrouping'),
>>
>> Which doesn't take any arguments, when you then add an argument django
>> can't find the right URL.
>>
>> You may mean:
>> {{ item }} - {{
>> item.id}} 
>> ?
>>
>> Regards,
>>
>> Andréas
>>
>>
>> Den tors 24 jan. 2019 kl 13:28 skrev Ivan Martić :
>>
>>> Hi all,
>>>
>>> i am having issue with url tag, every time i put url tag like --{% url
>>> 'productsgrouping' item.id%}-- i get no reverse error.
>>> Can you help me figure it out on what am i doing wrong?
>>>
>>> view:
>>> def productsgrouping_view(request):
>>> queryset = MaterialGroup.objects.all()
>>> context = {"list" : queryset}
>>> return render(request, 'qif/productsgrouping/productsgroup.html',
>>> context)
>>>
>>> def productsgrouping_update_view(request, url_id):
>>> product_lista = MaterialGroup.objects.get(id=url_id)
>>> product_url_id = ProductgroupinputForm(request.POST or None,
>>> instance=product_lista)
>>> context1 = {'product_url_id': product_url_id, 'product_lista':
>>> product_lista}
>>>
>>> if product_url_id.is_valid():
>>> product_url_id.save()
>>>
>>> return render(request, 'productsgroup-update.html', context1)
>>>
>>> url:
>>> urlpatterns = [
>>> path('', views.productsgrouping_view, name='productsgrouping'),
>>> path('update//', views.productsgrouping_update_view,
>>> name='update_productsgrouping'),
>>> path('new/', views.creategroup_view, name='create_group'),
>>> ]
>>>
>>> html:
>>> {% extends 'base.html' %}
>>> {% block content %}
>>> 
>>> {% for item in list %}
>>> 
>>> 
>>> {{ item }} - {{item.id}}
>>> 
>>> {% endfor %}
>>> {% endblock %}
>>>
>>> --
>>> 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/ca1ef95d-166a-40ef-91bc-16f2d704f2ee%40googlegroups.com
>>> 
>>> .
>>> 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/CAK4qSCcnxCFkss1b8sOTDW3Kb6Vc1fFst4MO024%2BEq%3DwXLGjcg%40mail.gmail.com
>> 
>> .
>> 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/CAFab_C8HUsxdpqz-MGqcpw0ZwgFOvrYZ-RJte6-H5x38b97ciQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.