Re: Static files won't match the path given

2019-05-10 Thread Rookies DJ
Dear Anirudh Jain

Thank you for reply 

Really, apprentice it

Yes we run collectstaitc command 

And we try within setting.py files

Set path static_root/url as the same

As for web server software we using apache not nigx.

I apologize for not including this information

Really appreciate if you could help.

-- 
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/efd7bdbc-4c67-4166-88f0-c6e9b245b267%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static files won't match the path given

2019-05-10 Thread Mike Dewhirst
Have you used manage.py collectstatic?

Connected by Motorola

Rookies DJ  wrote:

>I apologise, I'm a hardware engineer, I'm not very familiar with coding; I'm 
>only on Django for the past 5 months. (under my boss order)
>
>
>I had managed to develop and establish a Django App, and manage to upload it 
>to remote server NameCheap. There on the server, the issue is unable to locate 
>the static files. Even when we directed the path to static files folder.
>
>This static files, infrequently work and load the static, that's how we 
>concluded the static error was caused by the misdirection of the path.
>
>
>But reading over the Django documentary multiple time didn't help resolve 
>
>
>Please help our team had been trying resolve this issue for past 2months 
>
>-- 
>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/e2f33470-0ad3-4387-9fbe-cd20b40eee82%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/lk6dkclesxxw66c9iw4i1a28.1557554762271%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static files won't match the path given

2019-05-10 Thread Anirudh Jain
On server you will have to run - python manage.py collectstatic
and this is after you have setup nginx for serving static files on the
server. Have you set it up yet?

On Sat, 11 May 2019, 10:54 Rookies DJ,  wrote:

> I apologise, I'm a hardware engineer, I'm not very familiar with coding;
> I'm only on Django for the past 5 months. (under my boss order)
>
> I had managed to develop and establish a Django App, and manage to upload
> it to remote server *NameCheap*. There on the server, the issue is unable
> to locate the static files. Even when we directed the path to static files
> folder.
>
> This static files, infrequently work and load the static, that's how we
> concluded the static error was caused by the misdirection of the path.
>
> But reading over the Django documentary multiple time didn't help resolve
>
> Please help our team had been trying resolve this issue for past 2months
>
> --
> 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/e2f33470-0ad3-4387-9fbe-cd20b40eee82%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/CAC3mK7erauz13RupUXr9gW_ppGWkuhMVA7XTLUhzTwikSSpVKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email Django app.

2019-05-10 Thread carlos
maybe you try functionality used

EMAIL_BACKEND = (

"django.core.mail.backends.console.EmailBackend"
)


On Fri, May 10, 2019 at 9:53 PM salimon jamiu olashile <
tunedae1shi...@gmail.com> wrote:

> The functionality should work on localhost.
>
> On Fri, 10 May 2019 at 11:17 PM, Marvelous Ikechi 
> wrote:
>
>> Hello guys,
>>
>> I'm creating an third party app that can send and read users emails using
>> Django. How possible would it be to connect to the internet from my local
>> host, to send and receive these emails. Or do I need to host the site first
>> before these functionalities can come alive?
>>
>> --
>> 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/CAG%3D1guxen0%2BR%2BmCxz7JuFZR3Hef5-AkpCzP8yb-j2jaLfKVSxQ%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/CAFhdOCMwSX9eQ50OWr96cppMMZgu6%2Bt_aWwuH1wQ_8H9PfQoGg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
att.
Carlos Rocha

-- 
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/CAM-7rO2N1jFS4TifXojdYU%3DCLNe4q1fmsfFvN%2BC0dtK%2B%3D0DEWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Static files won't match the path given

2019-05-10 Thread Rookies DJ
I apologise, I'm a hardware engineer, I'm not very familiar with coding; 
I'm only on Django for the past 5 months. (under my boss order)

I had managed to develop and establish a Django App, and manage to upload 
it to remote server *NameCheap*. There on the server, the issue is unable 
to locate the static files. Even when we directed the path to static files 
folder.

This static files, infrequently work and load the static, that's how we 
concluded the static error was caused by the misdirection of the path.

But reading over the Django documentary multiple time didn't help resolve 

Please help our team had been trying resolve this issue for past 2months 

-- 
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/e2f33470-0ad3-4387-9fbe-cd20b40eee82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email Django app.

2019-05-10 Thread salimon jamiu olashile
The functionality should work on localhost.

On Fri, 10 May 2019 at 11:17 PM, Marvelous Ikechi 
wrote:

> Hello guys,
>
> I'm creating an third party app that can send and read users emails using
> Django. How possible would it be to connect to the internet from my local
> host, to send and receive these emails. Or do I need to host the site first
> before these functionalities can come alive?
>
> --
> 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/CAG%3D1guxen0%2BR%2BmCxz7JuFZR3Hef5-AkpCzP8yb-j2jaLfKVSxQ%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/CAFhdOCMwSX9eQ50OWr96cppMMZgu6%2Bt_aWwuH1wQ_8H9PfQoGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can not render dynamic changing string from views.py to template form page

2019-05-10 Thread Samaresh Singh
I can print the prod_name inside the views.py but cannot pass that
prod_name to the form page of selected product text filed. Main goal is to
throw the dropdown value received from form page to views.py and send the
same back to the form page from views.py. Hence I will be able to see the
changing product name when I select different value from the dropdown.

I am new to Django and would appreciate if you can help me with the working
code.

Thanks,
Samaresh


On Fri, May 10, 2019 at 6:57 AM Najmath Ummer  wrote:

> Hey,
> Try to print the prod_name in viewsand if it is undefined or null try
> using post instead of get.
> Thanks and Regards,
>
> Najmath Ummer
> Perleybrook Labs LLC
> Mob:8075314478
>
>
> On Fri, 10 May 2019 at 02:04, Samaresh Singh  wrote:
>
>> Hi All,
>>
>> I am working on internal django project where, i select the option from
>> dropdown in the form page and pass that value to the views.py using AJAX.
>> in views.py i use the text from dropdown and want to throw the text into
>> same form pages text field but that does not work. When i try to pass some
>> constant string from views.py to template form page that works. Below is
>> the code snippet
>>
>> form.html
>> ---
>>
>> New Hot Fix Request
>>   
>> Product * 
>> 
>> 
>> Product1
>> Product2
>> 
>> 
>> $(document).ready(function(){
>>
>> $('#dropdown').on('change',function(e){
>> var e = document.getElementById("dropdown");
>> var productName = e.options[e.selectedIndex].value;
>> console.log("Dropdown Product Name: "+productName);
>> $.ajax({
>> url:"",
>> method:'GET',
>> // send selected data to the newHPReq method which is in 
>> views.py
>> data : {'product' : $(this).val()}, // 'product' will be 
>> used in request.GET.get('product') which is in views.py, $(this).val() is 
>> selected item,
>> success:function(data){
>> //console.log(data);
>> }
>> });
>> });
>> });
>> 
>>
>>
>> views.py
>> ---
>>
>> def newHPReq(request):
>> # name = request.session['requestor']
>>
>> if request.method == 'GET':
>> prod_name = request.GET.get('product')  # we are getting selected 
>> item with this line. we defined 'product' in ajax file
>> print("Product name from dropdown: %s " % prod_name)
>>
>> context_dict = {'product_name': prod_name}
>>
>> print("Product Name is:  %s " % context_dict['product_name'])
>>
>>
>> return render(request, 'FormPage/form.html', (context_dict)) # 
>> Expecting product1 to be sent to form.html but doesnt.
>>
>>
>> I want to capture 'Product1' from dropdown to below text field of fom.html
>>
>> Selected Product
>> > value="">
>> 
>> $(document).change(function() {
>> console.log('I am here');  // This gets printed every time when 
>> I change the dropdown value
>> getSelectValue();
>> });
>> 
>> 
>> function getSelectValue() {
>> field = document.querySelector('#productName');
>> var name = "{{product_name}}";   // This always 
>> gives None when select product from dropdown
>> console.log("Received name from view: " + name);
>> field.value = name;
>> }
>> 
>>
>>
>>
>> I need some help, how can I propagate the dynamic change text from
>> views.py to template form.html page.
>>
>> Thank you 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/be482944-edeb-4fa6-a414-a1f8d2c4b290%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/CAP0JBPvTh%2Bxg0NozR9bHTGfM6b4q6B3bVZzgJJoN9e_31MZv6Q%40mail.gmail.com
> 

Email Django app.

2019-05-10 Thread Marvelous Ikechi
Hello guys,

I'm creating an third party app that can send and read users emails using
Django. How possible would it be to connect to the internet from my local
host, to send and receive these emails. Or do I need to host the site first
before these functionalities can come alive?

-- 
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/CAG%3D1guxen0%2BR%2BmCxz7JuFZR3Hef5-AkpCzP8yb-j2jaLfKVSxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-05-10 Thread Lucas G. Navarro
Hi Soumen, i think that what you need is this  [1]


Regards!

El vie., 10 may. 2019 a las 11:59, Soumen Khatua ()
escribió:

> Hi Folks,
>
> I have one existing table in my database then how I can use the same table
> in my models.py.
>
> 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/CAPUw6WakznFSEwPXtisj9rz782HEKxEDVE10GC1nNtEL7dGMOg%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/CABomRVUHmLMbMXXhN4bD7WxzgrmmB2Kt2M3A6p7_1nwNk6SdEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and AJAX

2019-05-10 Thread DEEPAK RAGHAV
Mention not😎


On Sat, May 11, 2019 at 12:16 AM Karan Mittal 
wrote:

> Thanks Deepak it was really helpful
>
> On Fri, May 10, 2019 at 11:57 PM DEEPAK RAGHAV <
> deepaksinghragh...@gmail.com> wrote:
>
>>
>> https://steemit.com/utopian-io/@ajmaln/part-1-creating-a-simple-chat-app-with-djangorestframework
>>
>> On Fri, May 10, 2019 at 11:27 PM Karan Mittal 
>> wrote:
>>
>>> Hey Guys can someone tell me some nice AJAX Django tutorials? I searched
>>> a lot and didn't found anything that was actually good.
>>> Thanks in Advance, it will be a great help.
>>> Thanks
>>> Karan Mittal
>>> Technical Writer
>>> DataFlair
>>>
>>> --
>>> 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/CAO24gqyCvZ4pu50O4knyQXAf9dNxcYaZYO2ueuFqGM8%2BbjxuFw%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/CACzRgKiMs9s75k77ffTXE7iLsdM0GK8e-r0oQW2eoo9j2b414A%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/CAO24gqwiG%3DVjLwQoidy9DUHOwjLaazhNpdDNSFa3KN4%3DeOCyjA%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/CACzRgKiWBuxb%3DFV7q_83TxDfozbo7nB3MuETCc-SDtZbJzFuGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and AJAX

2019-05-10 Thread Karan Mittal
Thanks Deepak it was really helpful

On Fri, May 10, 2019 at 11:57 PM DEEPAK RAGHAV 
wrote:

>
> https://steemit.com/utopian-io/@ajmaln/part-1-creating-a-simple-chat-app-with-djangorestframework
>
> On Fri, May 10, 2019 at 11:27 PM Karan Mittal 
> wrote:
>
>> Hey Guys can someone tell me some nice AJAX Django tutorials? I searched
>> a lot and didn't found anything that was actually good.
>> Thanks in Advance, it will be a great help.
>> Thanks
>> Karan Mittal
>> Technical Writer
>> DataFlair
>>
>> --
>> 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/CAO24gqyCvZ4pu50O4knyQXAf9dNxcYaZYO2ueuFqGM8%2BbjxuFw%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/CACzRgKiMs9s75k77ffTXE7iLsdM0GK8e-r0oQW2eoo9j2b414A%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/CAO24gqwiG%3DVjLwQoidy9DUHOwjLaazhNpdDNSFa3KN4%3DeOCyjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django and AJAX

2019-05-10 Thread DEEPAK RAGHAV
https://steemit.com/utopian-io/@ajmaln/part-1-creating-a-simple-chat-app-with-djangorestframework

On Fri, May 10, 2019 at 11:27 PM Karan Mittal 
wrote:

> Hey Guys can someone tell me some nice AJAX Django tutorials? I searched a
> lot and didn't found anything that was actually good.
> Thanks in Advance, it will be a great help.
> Thanks
> Karan Mittal
> Technical Writer
> DataFlair
>
> --
> 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/CAO24gqyCvZ4pu50O4knyQXAf9dNxcYaZYO2ueuFqGM8%2BbjxuFw%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/CACzRgKiMs9s75k77ffTXE7iLsdM0GK8e-r0oQW2eoo9j2b414A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django and AJAX

2019-05-10 Thread Karan Mittal
Hey Guys can someone tell me some nice AJAX Django tutorials? I searched a
lot and didn't found anything that was actually good.
Thanks in Advance, it will be a great help.
Thanks
Karan Mittal
Technical Writer
DataFlair

-- 
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/CAO24gqyCvZ4pu50O4knyQXAf9dNxcYaZYO2ueuFqGM8%2BbjxuFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Database setup

2019-05-10 Thread Soumen Khatua
Hi Folks,

I have one existing table in my database then how I can use the same table
in my models.py.

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


Re: How to use Django with python-requests to fetch data from google api?

2019-05-10 Thread Joe Reitman
Krystian,

I got this work by changing the template tag name variables and removing 
the if statement. Since 'authors' is a list, you could send the entire list 
to the template and do a for-loop to render all the authors.

def api(request):
 query = request.GET
 response = requests.get('https://www.googleapis.com/books/v1/volumes/' + 
query['book'])
 book = response.json()
 return render(request, 'books/api.html', {
 'title': book['volumeInfo']['title'],
 'authors': book['volumeInfo']['authors'][0]
 })



{% block content %}
Google books API

 
 search on google books api


 {{ title }} - {{ authors }} 

{% endblock %}


Output

[image: Screen Shot 2019-05-10 at 9.47.13 AM.png]

On Thursday, May 9, 2019 at 11:46:46 PM UTC-5, Krystian wrote:
>
> Hey Joe,
>
> There was a spelling mistake :D i've been sitting so long on this and 
> didn't saw it 
>
> W dniu czwartek, 9 maja 2019 22:35:12 UTC+2 użytkownik Krystian napisał:
>>
>> Hi there,
>>
>> I was trying today just for myself learning to get data from google books 
>> api https://www.googleapis.com/books/v1/volumes/ without needed auth key 
>> but the point is that I'm getting no results. I've tried with single book 
>> (like below), tried to get books that title contains "something" but django 
>> is giving me key errors when I'm trying to display it on view. Could you 
>> please tell me how to make this work with Django? I know it should be 
>> simple but still gettings those errors
>>
>> Exception Type: KeyError
>> Exception Value: 
>>
>> 'title'
>>
>>
>> import requests
>>
>> def api(request):
>> response = requests.get('
>> https://www.googleapis.com/books/v1/volumes/YyXoCAAJ')
>> book = response.json()
>> return render(request, 'books/api.html', {
>> 'title': book['title'],
>> 'authors': book['authors']
>> })
>>
>> and here is html
>>
>> {% block content %}
>>   Google books API
>>   
>> 
>> search on google books api
>>   
>>   {% if book %}
>>   
>> {{ book.title }} {{ book.authors }}
>>   
>>   {% endif %}
>> {% 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/d41b1a3e-c42b-4644-b086-dcf703f3acb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Give advice on data migrations

2019-05-10 Thread Vinicius Assef
You should update your views and forms **before** removing old fields.

On Fri, 10 May 2019 at 10:43, Victor Porton  wrote:

> Give advice: After migrating data, should I remove old fields immediately
> or after I change the views and forms to use new models instead of old ones?
>
> --
> 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/e57c03da-b34e-4e67-8dcf-369e8b20a57b%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/CAFmXjSCd%2BZv5%3DyAPF%3DkAPYCALf2bs%3DxbcWxRWvP0%3DdtFXbTtbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need urgent help on Django project

2019-05-10 Thread Phako Perez
You could use a dictionary with cities as keys and in first drop down get keys 
and an if condition for second where it checks first for city if nothing 
selected then make second disable

Sent from my iPhone

> On May 10, 2019, at 07:35, avdesh sharma  wrote:
> 
> Hi Django Users,
> 
> 
> I have a registration form in which I wanted to enter only Indian Cities in 
> one fields as a dropdown and their respective states in another field 
> dropdown.
> Could you please help me and provide me step by step guidance how to achieve 
> that as I am an intermediate level programmer.
> 
> 
> Thanks in advance !
> 
> -- 
> Warm Regards,
> Avdesh Kumar Sharma
> 9650031844
> -- 
> 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/CAF5Nfo4c8%2Bcj6yDzOE9eAWqoRH_7OA5TUo14FL9SEZhJem%2BXuA%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/7EA1C65E-3786-4A9F-962F-6B1B6DECFB9D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need urgent help on Django project

2019-05-10 Thread Krystian
Hi,

follow this tutorial to achieve this

https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html

W dniu piątek, 10 maja 2019 15:41:54 UTC+2 użytkownik Avdesh Kumar Sharma 
napisał:
>
> Hi Django Users,
>
>
> I have a registration form in which I wanted to enter only Indian Cities 
> in one fields as a dropdown and their respective states in another field 
> dropdown.
> Could you please help me and provide me step by step guidance how to 
> achieve that as I am an intermediate level programmer.
>
>
> Thanks in advance !
>
> -- 
> Warm Regards,
> Avdesh Kumar Sharma
> 9650031844
>

-- 
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/b1a93e8b-0091-4c78-90f8-8f27c9ac8fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Give advice on data migrations

2019-05-10 Thread Victor Porton
Give advice: After migrating data, should I remove old fields immediately 
or after I change the views and forms to use new models instead of old ones?

-- 
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/e57c03da-b34e-4e67-8dcf-369e8b20a57b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need urgent help on Django project

2019-05-10 Thread avdesh sharma
Hi Django Users,


I have a registration form in which I wanted to enter only Indian Cities in
one fields as a dropdown and their respective states in another field
dropdown.
Could you please help me and provide me step by step guidance how to
achieve that as I am an intermediate level programmer.


Thanks in advance !

-- 
Warm Regards,
Avdesh Kumar Sharma
9650031844

-- 
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/CAF5Nfo4c8%2Bcj6yDzOE9eAWqoRH_7OA5TUo14FL9SEZhJem%2BXuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different database types use in a single Django project

2019-05-10 Thread Szabolcs Hodossy
Hi Bbake,

You can also use a multi DB setup
 (I suggest
routers), and follow this guide to integrate a Mongo backend:
https://medium.freecodecamp.org/using-django-with-mongodb-by-adding-just-one-line-of-code-c386a298e179

One drawback that you lose relationships across DBs, but I think you
already prepared for that.

Hope this helps,
Szabolcs

On Fri, May 10, 2019 at 2:10 PM Chetan Ganji  wrote:

> Hi Bbake,
>
> Django Class Based Views and Models are wired for relational databases
> only. If you want to use MongoDB with django you have to say bye bye to CBV
> and Django ORM. There are some third party libraries to map django models
> to mongo, but IDK how good they are for production use.
>
> One way to solve this problem is use Function Based Views for views where
> MongoDB will be used.
> You will have to access mongo db using a database driver like pymongo.
>
> If you just need to store the json data, another way to solve this problem
> is to use django and postgres database.
> PostgreSQL has JSON field, django also supports that. Check the official
> documents for more info.
> https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/
>
> If you find any more solutions, please let me know, as I also want to
> explore the options of using mongo with django.
> Thanks in advance.
>
>
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji.che...@gmail.com
> http://ryucoder.in
>
>
> On Fri, May 10, 2019 at 5:27 PM Bbake Waikhom  wrote:
>
>> Is there any way that I can use different database type in a single
>> Django project like some model A will use SQL and some model B will use
>> MongoDB? Because in my project some data are better to store in a
>> relational database and some are better to store in a NoSQL database. I've
>> been searching for a while to achieve this but I couldn't find any
>> solution. Please let me know if there is a way. 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/b3776d83-18c9-47a0-9a8a-e3e7cb2e849a%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/CAMKMUjvwPcizHF%3DRrdJai9j8C2BakWj7XpMMK_O%2BbntuByHrTw%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/CAFp9oi9ZCeLQWQu6hmXvJdy%3Df6KWhDTQuaS79SrP45U%2Bo1ToCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different database types use in a single Django project

2019-05-10 Thread Chetan Ganji
Hi Bbake,

Django Class Based Views and Models are wired for relational databases
only. If you want to use MongoDB with django you have to say bye bye to CBV
and Django ORM. There are some third party libraries to map django models
to mongo, but IDK how good they are for production use.

One way to solve this problem is use Function Based Views for views where
MongoDB will be used.
You will have to access mongo db using a database driver like pymongo.

If you just need to store the json data, another way to solve this problem
is to use django and postgres database.
PostgreSQL has JSON field, django also supports that. Check the official
documents for more info.
https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/

If you find any more solutions, please let me know, as I also want to
explore the options of using mongo with django.
Thanks in advance.


Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Fri, May 10, 2019 at 5:27 PM Bbake Waikhom  wrote:

> Is there any way that I can use different database type in a single Django
> project like some model A will use SQL and some model B will use MongoDB?
> Because in my project some data are better to store in a relational
> database and some are better to store in a NoSQL database. I've been
> searching for a while to achieve this but I couldn't find any solution.
> Please let me know if there is a way. 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/b3776d83-18c9-47a0-9a8a-e3e7cb2e849a%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/CAMKMUjvwPcizHF%3DRrdJai9j8C2BakWj7XpMMK_O%2BbntuByHrTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Different database types use in a single Django project

2019-05-10 Thread Bbake Waikhom
Is there any way that I can use different database type in a single Django 
project like some model A will use SQL and some model B will use MongoDB? 
Because in my project some data are better to store in a relational 
database and some are better to store in a NoSQL database. I've been 
searching for a while to achieve this but I couldn't find any solution. 
Please let me know if there is a way. 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/b3776d83-18c9-47a0-9a8a-e3e7cb2e849a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Referencing a model from another app in admin.py

2019-05-10 Thread 'dimkouv' via Django users
I'm facing a problem while trying to reference a model from a different app 
inside admin.py


Let's say for example that inside App1 we have a model called Sensor

#app1 > models.py 
>
> class Sensor(models.Model):
>...
>


And inside App2 we've referenced Sensor as a FK using 'app1.Sensor'

#app2 > models.py
>
> class Measurement(models.Model):
> device = models.ForeignKey('app1.Sensor')
> 
>


Now if we try to reference that model in App2 > admin.py.
We're getting:   *...app1.Sensor has not ForeignKey to app2.Measurement...*

#app2 > admin.py
>
> from app1 import models as app1_models
>  
>
class SensorInline(admin.TabularInline):
> model = app1_models.Sensor
>


How to add as an Inline a FK from another app?


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/c1d1be08-34d8-4c94-a11f-5e8c8552ff8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to generate UserID and password for users upon registration?

2019-05-10 Thread Najmath Ummer
Hey,
Try using django-allauth. It includes everything related to accounts. For
more information:
django-allauth

django-allauth-tutorial

Thanks and Regards,

Najmath Ummer
Perleybrook Labs LLC
Mob:8075314478


On Thu, 9 May 2019 at 18:09, MUHAMMAD AFZAL  wrote:

> Hello Django People,
>
> I'm building an app in which I need to generate UserID and passwords for
> users automatically up signing up to the app.
>
> And ID and password will be sent to email or phone number.
>
> I'm checking out for full solution in Django.
>
> Thanks
> Muhammad Afzal
>
> --
> 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/CAAKmAQqZFC9QVb67LhD2OWgQfGgjqPftpA6WDYLCxxPkVG0spg%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/CAP0JBPvMYWHA-yBDH%2BpehB3BLXNwN55g20pD9%3DJOPzJ9jYFhjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can not render dynamic changing string from views.py to template form page

2019-05-10 Thread Najmath Ummer
Hey,
Try to print the prod_name in viewsand if it is undefined or null try using
post instead of get.
Thanks and Regards,

Najmath Ummer
Perleybrook Labs LLC
Mob:8075314478


On Fri, 10 May 2019 at 02:04, Samaresh Singh  wrote:

> Hi All,
>
> I am working on internal django project where, i select the option from
> dropdown in the form page and pass that value to the views.py using AJAX.
> in views.py i use the text from dropdown and want to throw the text into
> same form pages text field but that does not work. When i try to pass some
> constant string from views.py to template form page that works. Below is
> the code snippet
>
> form.html
> ---
>
> New Hot Fix Request
>   
> Product * 
> 
> 
> Product1
> Product2
> 
> 
> $(document).ready(function(){
>
> $('#dropdown').on('change',function(e){
> var e = document.getElementById("dropdown");
> var productName = e.options[e.selectedIndex].value;
> console.log("Dropdown Product Name: "+productName);
> $.ajax({
> url:"",
> method:'GET',
> // send selected data to the newHPReq method which is in 
> views.py
> data : {'product' : $(this).val()}, // 'product' will be 
> used in request.GET.get('product') which is in views.py, $(this).val() is 
> selected item,
> success:function(data){
> //console.log(data);
> }
> });
> });
> });
> 
>
>
> views.py
> ---
>
> def newHPReq(request):
> # name = request.session['requestor']
>
> if request.method == 'GET':
> prod_name = request.GET.get('product')  # we are getting selected 
> item with this line. we defined 'product' in ajax file
> print("Product name from dropdown: %s " % prod_name)
>
> context_dict = {'product_name': prod_name}
>
> print("Product Name is:  %s " % context_dict['product_name'])
>
>
> return render(request, 'FormPage/form.html', (context_dict)) # 
> Expecting product1 to be sent to form.html but doesnt.
>
>
> I want to capture 'Product1' from dropdown to below text field of fom.html
>
> Selected Product
> 
> 
> $(document).change(function() {
> console.log('I am here');  // This gets printed every time when I 
> change the dropdown value
> getSelectValue();
> });
> 
> 
> function getSelectValue() {
> field = document.querySelector('#productName');
> var name = "{{product_name}}";   // This always gives 
> None when select product from dropdown
> console.log("Received name from view: " + name);
> field.value = name;
> }
> 
>
>
>
> I need some help, how can I propagate the dynamic change text from
> views.py to template form.html page.
>
> Thank you 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/be482944-edeb-4fa6-a414-a1f8d2c4b290%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/CAP0JBPvTh%2Bxg0NozR9bHTGfM6b4q6B3bVZzgJJoN9e_31MZv6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.