Re: Disable count admin

2019-06-08 Thread Derek
Can you use:

https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.show_full_result_count


On Monday, 3 June 2019 14:48:23 UTC+2, Michele Gatti wrote:
>
> Hi i need to disable paginato on django admin with not managed model.
> Is possible?
>

-- 
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/565da33a-3b81-4055-8677-d856f2591154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: my file uploads missing/deleted

2019-06-08 Thread omar ahmed
ok joe  how can i use Dropbox for this issue ..

On Saturday, June 8, 2019 at 2:59:20 AM UTC+2, Joe Reitman wrote:
>
> Omar,
>
> I use Dropbox which is free up to 2GB. I installed django-storages library 
> to make setting up Dropbox easy.  
>
> On Friday, June 7, 2019 at 6:32:21 PM UTC-5, omar ahmed wrote:
>>
>> hii ..
>> i deployed my first django app on Heroku https://arena3.herokuapp.com/
>> but my media files ( like club logo ) disappear or deleted ... 
>> i found this article on Heroku 
>> https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted  
>>
>> that means The Heroku filesystem is ephermal and i should use aws but 
>> it's not free ?
>> is there any solution ?
>> how can i use Heroku postgres (addons) to upload my files permanently .. 
>> 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/b0f9c35d-c9f2-4cc3-9b8a-049127f22d10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: my file uploads missing/deleted

2019-06-08 Thread Joe Reitman
Follow the django-storages documentation. 
https://django-storages.readthedocs.io/en/latest/backends/dropbox.html

It's easy to setup.

On Saturday, June 8, 2019 at 8:23:17 AM UTC-5, omar ahmed wrote:
>
> ok joe  how can i use Dropbox for this issue ..
>
> On Saturday, June 8, 2019 at 2:59:20 AM UTC+2, Joe Reitman wrote:
>>
>> Omar,
>>
>> I use Dropbox which is free up to 2GB. I installed django-storages 
>> library to make setting up Dropbox easy.  
>>
>> On Friday, June 7, 2019 at 6:32:21 PM UTC-5, omar ahmed wrote:
>>>
>>> hii ..
>>> i deployed my first django app on Heroku https://arena3.herokuapp.com/
>>> but my media files ( like club logo ) disappear or deleted ... 
>>> i found this article on Heroku 
>>> https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted  
>>>
>>> that means The Heroku filesystem is ephermal and i should use aws but 
>>> it's not free ?
>>> is there any solution ?
>>> how can i use Heroku postgres (addons) to upload my files permanently .. 
>>> 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/f24cf69a-96e3-4d8f-b32b-3c5ec7bd604d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Login page is still visible for already logged in user

2019-06-08 Thread Gaurav Sahu
Hy everyone,
When a person is already logged in he/she can still be able to access login 
form in my login Django functionality by typing the login URL. I am using 
Django's default LoginView as my login view.  This is the URL of my login 
page.

re_path(r'login/$', auth_views.LoginView.as_view(template_name=
'accounts/login.html'), name='login')



-- 
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/3029e41c-fd96-4e48-b945-a9a66243bf0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--fake-initial does not follow PostgreSQL search_path schema list

2019-06-08 Thread Axel Rau
The database user sets a search_path to a,b
In schema b exists a set of tables corresponding to models and inital_migration.
Running
migrate --fake-initial app inital_migration
recreates all table in schema a.
Documentation says "--fake-initial does nothing if tables already exist.

Is this a bug in 2.2?
Any workaround?

Any help appreciated,
Axel
---
PGP-Key:29E99DD6  ☀  computing @ chaos claudius

-- 
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/0A4BC5B1-7C07-4E2E-9185-97606B16B47E%40Chaos1.DE.
For more options, visit https://groups.google.com/d/optout.


Django question.

2019-06-08 Thread Bhashkar Bisht
HI there is there any best way to create django helper class 

-- 
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/e0df3308-455f-4f4b-8870-9e7da90677cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to print a value on page obtained from a user in Django form?

2019-06-08 Thread Majid Rafiee
I am trying to create a form which asks user to input a value, do some 
calculations on it and show the results back to the user. Here is what I've 
done: I have created an app called QMarcum. Inside this app I have this 
views.py, forms.py and urls.py:

views.py

from django.shortcuts import render
from scipy.integrate import quad
import scipy, numpy, math
from scipy import integrate
from django.http import HttpResponse
from .forms import Calculate

def integrand(x):
Q_y = (1/(math.sqrt(2*math.pi)))*math.exp((-x**2)/2)
return Q_y
y = Calculate.y
ans, err = quad(integrand, float(y), math.inf)
print(ans)
return render(request, 'test.html', {'form': Q_y})
forms.py

from django import forms

class Calculate(forms.Form):
y = forms.FloatField()
urls.py

from django.urls import path
from . import views

urlpatterns = [
path('form', views.integrand),
]
form.html





Title



{% csrf_token %}
{{ form }}
Submit



The form asks user to input a value (y) (y is printed on terminal 
successfully), however, print(ans) doesn't print the value AND also I don't 
know how to show the calculated result (ans) to user.

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/b77e2ebd-a440-4eb5-bd9d-a6635edd56a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to print a value on page obtained from a user in Django form?

2019-06-08 Thread Anirudh Jain
First save the form after the user has input values using -
`userform.save()`
Then get that value using - val = userform.CharField
Now send the `val` in the context and show it to user wherever you want

PS- `CharField` would be whatever varuable name you have used in
form/ModelForm

On Sun, 9 Jun 2019, 02:39 Majid Rafiee,  wrote:

> I am trying to create a form which asks user to input a value, do some
> calculations on it and show the results back to the user. Here is what I've
> done: I have created an app called QMarcum. Inside this app I have this
> views.py, forms.py and urls.py:
>
> views.py
>
> from django.shortcuts import render
> from scipy.integrate import quad
> import scipy, numpy, math
> from scipy import integrate
> from django.http import HttpResponse
> from .forms import Calculate
>
> def integrand(x):
> Q_y = (1/(math.sqrt(2*math.pi)))*math.exp((-x**2)/2)
> return Q_y
> y = Calculate.y
> ans, err = quad(integrand, float(y), math.inf)
> print(ans)
> return render(request, 'test.html', {'form': Q_y})
> forms.py
>
> from django import forms
>
> class Calculate(forms.Form):
> y = forms.FloatField()
> urls.py
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('form', views.integrand),
> ]
> form.html
>
> 
> 
> 
> 
> Title
> 
> 
> 
> {% csrf_token %}
> {{ form }}
> Submit
> 
> 
> 
> The form asks user to input a value (y) (y is printed on terminal
> successfully), however, print(ans) doesn't print the value AND also I don't
> know how to show the calculated result (ans) to user.
>
> 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/b77e2ebd-a440-4eb5-bd9d-a6635edd56a8%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/CAC3mK7cZ_y_C2B9kY3rukQMAXT9LohEk1cgBzxg_zzAKihW9ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


pass a variable from another site to your django site

2019-06-08 Thread Danny Blaker
Scenario: You have built a chat bot (RASA-NLU for chat page + django for 
the rest of the site) that helps people with advice on gardening products. 
A major gardening retailer has approached you and asked if you could put a 
button on their product detail view pages, so that when a user clicks it, 
it re-directs to the chat bot page on your website and automatically passes 
the product text to the chat bot to begin the dialogue.
How would you approach this?

we were considering a solution using django API and AJAX, that involves 
adding jquery to their site and its a bit intrusive. 
we could use an iframe - then ofcourse you get the issues of iframes - 
responsiveness, security etc

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/c319ddc3-41dc-45f5-8e2b-fc28e9d0d9b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels: can ApplicationCommunicator get events from my channel layer?

2019-06-08 Thread Chris
I am writing an integration test that loads a page, which somewhere 
internally calls get_channel_layer().send() to my ChannelNameRouter. I want 
the event to be consumed and then make various assertions.

I think that I need to instantiate an ApplicationCommunicator with my 
application instance from routing.py, and then cause the message to be 
consumed by calling .receive_output(), but when I do that I get a timeout. 
I can also see the ApplicationCommunicator's input_queue is empty, so it 
seems like the message never reaches the ApplicationCommunicator. I can see 
the message sitting in the channel layer (InMemoryChannelLayer.channels), 
and my application works fine when I test it manually. But is the 
ApplicationCommunicator supposed to get the message from the channel layer? 
How can I troubleshoot where the message gets stuck?

Thank you!

-- 
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/73c8e574-4fd9-4c9b-8141-945c2dd59ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.