Re: Why I can't pass anything to my html? Django 2.1

2018-11-13 Thread Rookies DJ


On Monday, 12 November 2018 21:26:48 UTC+8, Cuneyt Mertayak wrote:
>
> The content for the `render` method is supposed to be a dictionary: 
> https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments
>
> So change it to this render(requset, "FrounterWeb/body.html",{'tank': 
> tank})
>
> Also in the template file you want to display the properties of the ORM 
> (tank_system) object I guess, change them to {{tank.EC}}, 
> {{tank. temp}}, respectively.
>
> Hope it helps!
>

Thx for help
Cuneyt Mertayak

 but it didn't work, appreciate the reply, but suspect that the whiten the 
request to return there nothing, is the whole code become empty, that my 
believes 
 

-- 
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/45d9f4af-4807-4692-8d6e-dcc7ab14818a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why I can't pass anything to my html? Django 2.1

2018-11-13 Thread Omar Abou Mrad
We would require more information;
What errors do you get?
What are you seeing?

Either way, this is not correct: tank = tank_system.object.get(id(5))
It should be: tank = tank_system.object.get(id=5)

I suggest going through the django tutorial if you haven't already.

On Tue, Nov 13, 2018 at 10:29 AM Rookies DJ 
wrote:

>
>
> On Monday, 12 November 2018 21:26:48 UTC+8, Cuneyt Mertayak wrote:
>>
>> The content for the `render` method is supposed to be a dictionary:
>> https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments
>>
>> So change it to this render(requset, "FrounterWeb/body.html",{'tank':
>> tank})
>>
>> Also in the template file you want to display the properties of the ORM
>> (tank_system) object I guess, change them to {{tank.EC}}, 
>> {{tank. temp}}, respectively.
>>
>> Hope it helps!
>>
>
> Thx for help
> Cuneyt Mertayak
>
>  but it didn't work, appreciate the reply, but suspect that the whiten the
> request to return there nothing, is the whole code become empty, that my
> believes
>
>
> --
> 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/45d9f4af-4807-4692-8d6e-dcc7ab14818a%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/CAFwtXp1aegZkZBNXqMXZfqs%2Bo_YhJonxd%2BN4P4ecRahEuqsqrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: makemigrations makes migration even if no changes in model

2018-11-13 Thread Michał Redmerski
Thanks for Your response,
The project is a part of our internal erp system. I'll try to make it
executable on external enviornment and then provide a code.

I have updated the gist to provide generated migrations.

Regards,

W dniu sob, 10.11.2018 o godzinie 15∶34 -0800, użytkownik Tim Graham
napisał:
> I think you'll need to provide a sample project that reproduces the
> problem. I tried with the models you gave (and removed references to
> the models that you didn't provide) but can't reproduce.
> 
> On Friday, November 9, 2018 at 6:51:49 AM UTC-5, Michał Redmerski
> wrote:
> > Hello! 
> > 
> > All issues with this I googled, are with the opposite problem. 
> > 
> > I have models: Record, Stage, StageFetch 
> > here is my code: 
> > https://gist.github.com/redmeros/bd70481cae2e4471eee0501146b2945c 
> > 
> > After every use of (no matter if there changes in any models) 
> > 
> > python manage.py makemigrations 
> > 
> > I've got such result 
> > 
> > - Alter field stage on record 
> > - Alter field stage on stagesfetch 
> > 
> > 
> > I'm using django 2.1.3 running on debian. 
> > 
> > Any ideas? 
> > 
> > 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/71d98102-ec92-4e6a-91f9-9f9bbf9932f6%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/8dc41adfe99d209527c0d23785b698474c3a4729.camel%40zaaps.pl.
For more options, visit https://groups.google.com/d/optout.


I'm new in Django. please help me out

2018-11-13 Thread talkdkg
Hi All,

can you please solve this.

1) Create a simple Category model using DRF with following fields :
Id,name,parent,is_featured,image,is_active,description
2) Create CRUD APIs for the same.
3) Validate input at every event/API.
4) Implement ordering and filtering.
5) GET API should take params to return :
Ex. /abc.com?params=id|name|is_featured : this should return Array of JSON
object with specified keys, along with an authenticated key mentioning user
authentication status.

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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread amit pant
hey, you need to pay for that.

On Tue, Nov 13, 2018 at 2:55 PM  wrote:

> Hi All,
>
> can you please solve this.
>
> 1) Create a simple Category model using DRF with following fields :
> Id,name,parent,is_featured,image,is_active,description
> 2) Create CRUD APIs for the same.
> 3) Validate input at every event/API.
> 4) Implement ordering and filtering.
> 5) GET API should take params to return :
> Ex. /abc.com?params=id|name|is_featured
>  : this should return
> Array of JSON
> object with specified keys, along with an authenticated key mentioning user
> authentication status.
>
> 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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%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/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread PASCUAL Eric
> hey, you need to pay for that.


Seen quite frequently : some of the visitors of community groups such as this 
one confuse them with "do_my_job_for_free.com" or "do_my_homework.com" 😊


Eric


From: django-users@googlegroups.com  on behalf 
of amit pant 
Sent: Tuesday, November 13, 2018 10:27:13 AM
To: django-users@googlegroups.com
Subject: Re: I'm new in Django. please help me out

hey, you need to pay for that.

On Tue, Nov 13, 2018 at 2:55 PM mailto:talk...@gmail.com>> 
wrote:
Hi All,

can you please solve this.

1) Create a simple Category model using DRF with following fields :
Id,name,parent,is_featured,image,is_active,description
2) Create CRUD APIs for the same.
3) Validate input at every event/API.
4) Implement ordering and filtering.
5) GET API should take params to return :
Ex. 
/abc.com?params=id|name|is_featured
 : this should return Array of JSON
object with specified keys, along with an authenticated key mentioning user
authentication status.

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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%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/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%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/VI1P193MB043255EC430059412851527A8CC20%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread amit pant
 sometimes

On Tue, Nov 13, 2018 at 3:23 PM PASCUAL Eric  wrote:

> > hey, you need to pay for that.
>
>
> Seen quite frequently : some of the visitors of community groups such as
> this one confuse them with "do_my_job_for_free.com" or "do_my_homework.com"
> 😊
>
>
> Eric
> --
> *From:* django-users@googlegroups.com  on
> behalf of amit pant 
> *Sent:* Tuesday, November 13, 2018 10:27:13 AM
> *To:* django-users@googlegroups.com
> *Subject:* Re: I'm new in Django. please help me out
>
> hey, you need to pay for that.
>
> On Tue, Nov 13, 2018 at 2:55 PM  wrote:
>
> Hi All,
>
> can you please solve this.
>
> 1) Create a simple Category model using DRF with following fields :
> Id,name,parent,is_featured,image,is_active,description
> 2) Create CRUD APIs for the same.
> 3) Validate input at every event/API.
> 4) Implement ordering and filtering.
> 5) GET API should take params to return :
> Ex. /abc.com?params=id|name|is_featured
>  : this should return
> Array of JSON
> object with specified keys, along with an authenticated key mentioning user
> authentication status.
>
> 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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%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/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%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/VI1P193MB043255EC430059412851527A8CC20%40VI1P193MB0432.EURP193.PROD.OUTLOOK.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/CAF2Ah_Et%3DhoYJnBVhzXCaHRO%2B_iyRS4x1-6vrPaOYPUGTxjS2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread Dheeraj Kumar
if you guys do not help ,plz ignore it insist of trying to be over
smart.this is home work or any thing else you are not authorized to comment
like this.

just stop it.

On Tue, 13 Nov 2018 at 15:30, amit pant  wrote:

>  sometimes
>
> On Tue, Nov 13, 2018 at 3:23 PM PASCUAL Eric  wrote:
>
>> > hey, you need to pay for that.
>>
>>
>> Seen quite frequently : some of the visitors of community groups such as
>> this one confuse them with "do_my_job_for_free.com" or "
>> do_my_homework.com" 😊
>>
>>
>> Eric
>> --
>> *From:* django-users@googlegroups.com  on
>> behalf of amit pant 
>> *Sent:* Tuesday, November 13, 2018 10:27:13 AM
>> *To:* django-users@googlegroups.com
>> *Subject:* Re: I'm new in Django. please help me out
>>
>> hey, you need to pay for that.
>>
>> On Tue, Nov 13, 2018 at 2:55 PM  wrote:
>>
>> Hi All,
>>
>> can you please solve this.
>>
>> 1) Create a simple Category model using DRF with following fields :
>> Id,name,parent,is_featured,image,is_active,description
>> 2) Create CRUD APIs for the same.
>> 3) Validate input at every event/API.
>> 4) Implement ordering and filtering.
>> 5) GET API should take params to return :
>> Ex. /abc.com?params=id|name|is_featured
>>  : this should return
>> Array of JSON
>> object with specified keys, along with an authenticated key mentioning
>> user
>> authentication status.
>>
>> 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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%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/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%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/VI1P193MB043255EC430059412851527A8CC20%40VI1P193MB0432.EURP193.PROD.OUTLOOK.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/CAF2Ah_Et%3DhoYJnBVhzXCaHRO%2B_iyRS4x1-6vrPaOYPUGTxjS2Q%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/CANwUEV8BLm6eT27wsvKjiHCp86u2%3Dutn

Re: PDF extarcting

2018-11-13 Thread swathi2801 Yadhav
by using resular we can only extract  doc files but to for extracting the
data from pdf we need to import any package or not

On Tue, Nov 13, 2018 at 10:33 AM Manjunath  wrote:

> I think regular expression would be a better option for your requirements.
> If you provide some sample resume docs, we can help better.
>
> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801 Yadhav
> wrote:
>>
>> Hi everyone, there is a project given to us to develop an application
>> I need to extract data from resume only specific fields like name, mail,
>> dob, phone number   by importing a package pyPdf2 I can only extract a data
>> to text the whole part but there is no need of whole data only specific
>> data need to extract
>> if any were are familiar with pdPdf2 extracting the data please help me
>> .!!
>>
>>
>> thanks
>> Swathi
>>
> --
> 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Redesign

2018-11-13 Thread brian hopkins
You can override them check out this page in the docs

https://docs.djangoproject.com/en/2.1/ref/contrib/admin/

Sent from my iPhone

> On Nov 12, 2018, at 9:14 PM, Phako Perez <13.phak...@gmail.com> wrote:
> 
> If I remember correctly you can define your own templates under the template 
> directory
> 
> Regards
> 
> Sent from my iPhone
> 
>> On Nov 12, 2018, at 4:49 PM, Zakriya Bilal  wrote:
>> 
>> I am starting a project in which one of the requirements is to have a custom 
>> designed Admin panel. 
>> 
>> So my question is: Is it possible to redesign the Django Admin panel? 
>> Majority of the requirements are related to Front-end design? Is it a good 
>> idea to redesign the front-end or just create a new admin area from scratch?
>> 
>> I ask because the design of the admin panel is important. 
>> 
>> Just to put it out there, I am coming from Laravel World. 
>> -- 
>> 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/5544f0cd-5be7-4c91-a2ae-83c4b77dcfa7%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/CD14A672-D2B0-477A-8CBE-85E2D6A1417F%40gmail.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/17B44F98-14B5-4AC1-BBF4-2B56EA99536D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Redesign

2018-11-13 Thread ANi
Yes, you can redesign how it looks like, but I am not sure about how much 
you can do. 
You can check out the project Django JET.


-- 
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/609836fb-a7a1-40ea-be79-2baad96436ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


using a foreign key with multiple choices

2018-11-13 Thread 'Christian' via Django users

Hello

I need to use a model form to create a new instance of Recette, using 
multiple choices list instead of the foreign_key


/class Recette(models.Model)://
//  ..//
//    categoriederecette = models.ForeignKey(Categorie, 
on_delete=models.CASCADE) //

/

/class Categorie(models.Model)://
//    SOUPE = 'SP'//
//    DESSERTS ='DS'//
//    PLATUNIQUE ='PU'//
//    LISTE_CHOIX =  ((SOUPE,'Soupe'), (DESSERTS,'Desserts'), 
(PLATUNIQUE,'Plat unique'),)//

//   .//
//    categorierecette = models.CharField(db_column='Categorierecette', 
max_length=15, choices=LISTE_CHOIX, blank=True, null=True)  # Field name 
made lowercase/


I use a Modelform/:
/

/class RecettesForm(forms.ModelForm)://
//    categoriederecette = forms.ChoiceField(choices = 
Categorie.LISTE_CHOIX)//


//    class Meta://
//    model = Recette//
//    fields = (..//,'categoriederecette')/

/
/

The form is displayed correctly,  but cannot be saved. In the test /if 
form.is_valid():/  I get a value error -


/ValueError: Cannot assign "'SP'": "Recette.categoriederecette" must be 
a "Categorie" instance./


Any help would be greatly 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/524c62ab-2454-7746-ec6a-9c7daeed775d%40yahoo.fr.
For more options, visit https://groups.google.com/d/optout.


Foreign key data saving issue

2018-11-13 Thread mohit basantani
Hello I am new to django i have two tables namely Mastertable and Partlist

Partlist columns:

1. id
2. partlist_name

I am using the imort-export plugin to import the data in the mastertable 
where i have created a foreign key referred to partlist table, I want 
whenever i import any xls file first data would save to the partlist table 
and i will get the id of the inserted row and then the data should be saved 
in the mastertable. Please 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/fd74c2ec-9969-493e-b0c9-2aa05f6f1cc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I'm new in Django. please help me out

2018-11-13 Thread Joel
You're bound to be trolled if you post a question which clearly looks like
an assignment, with zero effort on your part. Where's your code? What did
you try?

On Tue, 13 Nov, 2018, 3:38 PM Dheeraj Kumar  if you guys do not help ,plz ignore it insist of trying to be over
> smart.this is home work or any thing else you are not authorized to comment
> like this.
>
> just stop it.
>
> On Tue, 13 Nov 2018 at 15:30, amit pant  wrote:
>
>>  sometimes
>>
>> On Tue, Nov 13, 2018 at 3:23 PM PASCUAL Eric 
>> wrote:
>>
>>> > hey, you need to pay for that.
>>>
>>>
>>> Seen quite frequently : some of the visitors of community groups such as
>>> this one confuse them with "do_my_job_for_free.com" or "
>>> do_my_homework.com" 😊
>>>
>>>
>>> Eric
>>> --
>>> *From:* django-users@googlegroups.com 
>>> on behalf of amit pant 
>>> *Sent:* Tuesday, November 13, 2018 10:27:13 AM
>>> *To:* django-users@googlegroups.com
>>> *Subject:* Re: I'm new in Django. please help me out
>>>
>>> hey, you need to pay for that.
>>>
>>> On Tue, Nov 13, 2018 at 2:55 PM  wrote:
>>>
>>> Hi All,
>>>
>>> can you please solve this.
>>>
>>> 1) Create a simple Category model using DRF with following fields :
>>> Id,name,parent,is_featured,image,is_active,description
>>> 2) Create CRUD APIs for the same.
>>> 3) Validate input at every event/API.
>>> 4) Implement ordering and filtering.
>>> 5) GET API should take params to return :
>>> Ex. /abc.com?params=id|name|is_featured
>>>  : this should return
>>> Array of JSON
>>> object with specified keys, along with an authenticated key mentioning
>>> user
>>> authentication status.
>>>
>>> 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/dfdb2b20-66a3-4e56-b548-45c0f59a48ee%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/CAF2Ah_FcL0UEGVFhJBE_nCdCHXFTQyWbzmqPbPV5v13k04r_6A%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/VI1P193MB043255EC430059412851527A8CC20%40VI1P193MB0432.EURP193.PROD.OUTLOOK.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/CAF2Ah_Et%3DhoYJnBVhzXCaHRO%2B_iyRS4x1-6vrPaOYPUGTxjS2Q%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, s

Re: PDF extarcting

2018-11-13 Thread m1chael
i recently achieved this by using pdf2text tool, and then using regular
expressions to parse out what I want.

VERY DIFFICULT



On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
swathi2801yad...@gmail.com> wrote:

> by using resular we can only extract  doc files but to for extracting the
> data from pdf we need to import any package or not
>
> On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
> wrote:
>
>> I think regular expression would be a better option for your requirements.
>> If you provide some sample resume docs, we can help better.
>>
>> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801 Yadhav
>> wrote:
>>>
>>> Hi everyone, there is a project given to us to develop an application
>>> I need to extract data from resume only specific fields like name, mail,
>>> dob, phone number   by importing a package pyPdf2 I can only extract a data
>>> to text the whole part but there is no need of whole data only specific
>>> data need to extract
>>> if any were are familiar with pdPdf2 extracting the data please help me
>>> .!!
>>>
>>>
>>> thanks
>>> Swathi
>>>
>> --
>> 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%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/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PDF extarcting

2018-11-13 Thread swathi2801 Yadhav
please can ping me the code if u have done soo

On Tue, Nov 13, 2018 at 6:30 PM m1chael  wrote:

> i recently achieved this by using pdf2text tool, and then using regular
> expressions to parse out what I want.
>
> VERY DIFFICULT
>
>
>
> On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
> swathi2801yad...@gmail.com> wrote:
>
>> by using resular we can only extract  doc files but to for extracting the
>> data from pdf we need to import any package or not
>>
>> On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
>> wrote:
>>
>>> I think regular expression would be a better option for your
>>> requirements.
>>> If you provide some sample resume docs, we can help better.
>>>
>>> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801 Yadhav
>>> wrote:

 Hi everyone, there is a project given to us to develop an application
 I need to extract data from resume only specific fields like name,
 mail, dob, phone number   by importing a package pyPdf2 I can only extract
 a data to text the whole part but there is no need of whole data only
 specific data need to extract
 if any were are familiar with pdPdf2 extracting the data please help me
 .!!


 thanks
 Swathi

>>> --
>>> 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%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/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%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/CAGnx2uMfxFy6KV9uTTXLfMm0bVptMoBb%2BkmgOJL8yR2-f_-r1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PDF extarcting

2018-11-13 Thread swathi2801 Yadhav
pdf text tool not installing in this version what to do next?


On Tue, Nov 13, 2018 at 6:41 PM swathi2801 Yadhav <
swathi2801yad...@gmail.com> wrote:

> please can ping me the code if u have done soo
>
> On Tue, Nov 13, 2018 at 6:30 PM m1chael  wrote:
>
>> i recently achieved this by using pdf2text tool, and then using regular
>> expressions to parse out what I want.
>>
>> VERY DIFFICULT
>>
>>
>>
>> On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
>> swathi2801yad...@gmail.com> wrote:
>>
>>> by using resular we can only extract  doc files but to for extracting
>>> the data from pdf we need to import any package or not
>>>
>>> On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
>>> wrote:
>>>
 I think regular expression would be a better option for your
 requirements.
 If you provide some sample resume docs, we can help better.

 On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801 Yadhav
 wrote:
>
> Hi everyone, there is a project given to us to develop an application
> I need to extract data from resume only specific fields like name,
> mail, dob, phone number   by importing a package pyPdf2 I can only extract
> a data to text the whole part but there is no need of whole data only
> specific data need to extract
> if any were are familiar with pdPdf2 extracting the data please help
> me .!!
>
>
> thanks
> Swathi
>
 --
 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%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/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%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/CAGnx2uOc74528nMVPUq7CkHOMqgsJy-eq_PAQZgb6rxikFEMQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: PDF extarcting

2018-11-13 Thread Joel
use pip3.
It would be nice if you could keep the non django discussion out of this
group.

On Tue, 13 Nov, 2018, 6:47 PM swathi2801 Yadhav  pdf text tool not installing in this version what to do next?
>
>
> On Tue, Nov 13, 2018 at 6:41 PM swathi2801 Yadhav <
> swathi2801yad...@gmail.com> wrote:
>
>> please can ping me the code if u have done soo
>>
>> On Tue, Nov 13, 2018 at 6:30 PM m1chael  wrote:
>>
>>> i recently achieved this by using pdf2text tool, and then using regular
>>> expressions to parse out what I want.
>>>
>>> VERY DIFFICULT
>>>
>>>
>>>
>>> On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
>>> swathi2801yad...@gmail.com> wrote:
>>>
 by using resular we can only extract  doc files but to for extracting
 the data from pdf we need to import any package or not

 On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
 wrote:

> I think regular expression would be a better option for your
> requirements.
> If you provide some sample resume docs, we can help better.
>
> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801
> Yadhav wrote:
>>
>> Hi everyone, there is a project given to us to develop an application
>> I need to extract data from resume only specific fields like name,
>> mail, dob, phone number   by importing a package pyPdf2 I can only 
>> extract
>> a data to text the whole part but there is no need of whole data only
>> specific data need to extract
>> if any were are familiar with pdPdf2 extracting the data please help
>> me .!!
>>
>>
>> thanks
>> Swathi
>>
> --
> 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%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/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%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/CAGnx2uOc74528nMVPUq7CkHOMqgsJy-eq_PAQZgb6rxikFEMQQ%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, 

How to do arthimetic operations on database values in django

2018-11-13 Thread Mohan Goud


I have Prof:AssociateProf:AssistantProf = x:y:z in database and I have to 
do these operations x/(x+y+z) : y/(x+y+z) : z/(x+y+z) in django. Can anyone 
help me on this and models.py is

class Show(models.Model) :Total = models.IntegerField(default = 0)Prof = 
models.IntegerField(default = 0)AssociateProf = models.IntegerField(default = 
0)AssistantProf = models.IntegerField(default = 0)ResearchScholar = 
models.IntegerField(default = 0)MTech = models.IntegerField(default = 0)

-- 
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/f40baf24-ffb0-418a-bd5e-269dc32ed45f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: PDF extarcting

2018-11-13 Thread swathi2801 Yadhav
OK sure
If u have code please send me

On Tue, 13 Nov 2018, 7:05 p.m. Joel  use pip3.
> It would be nice if you could keep the non django discussion out of this
> group.
>
> On Tue, 13 Nov, 2018, 6:47 PM swathi2801 Yadhav <
> swathi2801yad...@gmail.com wrote:
>
>> pdf text tool not installing in this version what to do next?
>>
>>
>> On Tue, Nov 13, 2018 at 6:41 PM swathi2801 Yadhav <
>> swathi2801yad...@gmail.com> wrote:
>>
>>> please can ping me the code if u have done soo
>>>
>>> On Tue, Nov 13, 2018 at 6:30 PM m1chael  wrote:
>>>
 i recently achieved this by using pdf2text tool, and then using regular
 expressions to parse out what I want.

 VERY DIFFICULT



 On Tue, Nov 13, 2018 at 6:45 AM swathi2801 Yadhav <
 swathi2801yad...@gmail.com> wrote:

> by using resular we can only extract  doc files but to for extracting
> the data from pdf we need to import any package or not
>
> On Tue, Nov 13, 2018 at 10:33 AM Manjunath 
> wrote:
>
>> I think regular expression would be a better option for your
>> requirements.
>> If you provide some sample resume docs, we can help better.
>>
>> On Tuesday, November 13, 2018 at 7:04:06 AM UTC+5:30, swathi2801
>> Yadhav wrote:
>>>
>>> Hi everyone, there is a project given to us to develop an
>>> application
>>> I need to extract data from resume only specific fields like name,
>>> mail, dob, phone number   by importing a package pyPdf2 I can only 
>>> extract
>>> a data to text the whole part but there is no need of whole data only
>>> specific data need to extract
>>> if any were are familiar with pdPdf2 extracting the data please help
>>> me .!!
>>>
>>>
>>> thanks
>>> Swathi
>>>
>> --
>> 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/cf376fbd-4b81-4e73-a7b0-d9d9a7a0a516%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/CAGnx2uOv_0Qh6gN6qBNqxCVR_6cEisYbzH1XF%3DUeyCX41_r4mQ%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/CAAuoY6PHSj06s5tA-%3DTRwPrWHLJ5_8boxLLoG-3hrXvSsMVtuw%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/CAGnx2uOc74528nMVPUq7CkHOMqgsJy-eq_PAQZgb6rxikFEMQQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received th

Re: Embedding pdfs in Django

2018-11-13 Thread C. Kirby
I'm pretty sure that you can't render pdf to the browser. You can either 
provide links for the users to download and view the pdfs, or extract the 
content from the pdfs and put that in your templates.

You may be able to get what you want with javascript. I can't vouch for 
this, but I found it searching - 
https://pspdfkit.com/blog/2018/render-pdfs-in-the-browser-with-pdf-js/

good luck

On Sunday, November 11, 2018 at 1:09:48 PM UTC-5, Vikas Sri wrote:
>
> I am preparing learning tutorial application in Django, which will contain 
> PDF's  that I need to display in my templates. I tried ,  
> etc but nothing worked. Do I need to install something to make it work?
>

-- 
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/c9aae107-7deb-46e7-b1db-8c35592049de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embedding pdfs in Django

2018-11-13 Thread Siim Märtmaa
> On Sunday, November 11, 2018 at 1:09:48 PM UTC-5, Vikas Sri wrote:
>>
>> I am preparing learning tutorial application in Django, which will contain 
>> PDF's  that I need to display in my templates. I tried ,  etc 
>> but nothing worked. Do I need to install something to make it work?

Here is example and demo with pdf and  tag
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object

It should also work with iframe
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

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


Re: Django Admin Redesign

2018-11-13 Thread Ezequiel Bertti
https://github.com/darklow/django-suit

On Tue, Nov 13, 2018 at 10:44 AM ANi  wrote:

> Yes, you can redesign how it looks like, but I am not sure about how much
> you can do.
> You can check out the project Django JET.
>
>
> --
> 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/609836fb-a7a1-40ea-be79-2baad96436ee%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Ezequiel Bertti

https://telegram.me/ebertti
https://twitter.com/ebertti
https://github.com/ebertti

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


Re: Embedding pdfs in Django

2018-11-13 Thread gibsonal2026
that is nice

On Sunday, November 11, 2018 at 12:09:48 PM UTC-6, Vikas Sri wrote:
>
> I am preparing learning tutorial application in Django, which will contain 
> PDF's  that I need to display in my templates. I tried ,  
> etc but nothing worked. Do I need to install something to make it work?
>

-- 
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/5b1793c1-e620-45ae-8878-b94c037fd6d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embedding pdfs in Django

2018-11-13 Thread gibsonal2026
great 

On Sunday, November 11, 2018 at 12:09:48 PM UTC-6, Vikas Sri wrote:
>
> I am preparing learning tutorial application in Django, which will contain 
> PDF's  that I need to display in my templates. I tried ,  
> etc but nothing worked. Do I need to install something to make it work?
>

-- 
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/08abdd6b-2fd1-495f-9bb8-85f724a0cff7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: Test case fails on async.sleep(X>0)

2018-11-13 Thread Andrew Godwin
Couple of points:

- Did you install pytest-django? That should help the settings thing.
- There's a default 1-second timeout on get_response; pass timeout=4 to it
and you should see that error go away.

We have a default timeout because otherwise we can't tell if an async app
has died/crashed and it'd hang forever!

Andrew

On Mon, Nov 12, 2018 at 3:43 PM Zhiyu (Drew) Li  wrote:

> Hi there,
>
> I was trying to write a test for a consumer. It is just a very simply
> AsyncHttpConsumer subclass that awaits on asyncio.sleep(3) and returns a
> "OK" in plain text.
>
> The test case is:
> @pytest.mark.asyncio
> async def test_my_consumer():
> communicator = HttpCommunicator(BasicHttpConsumer, "GET", "asynchttp")
> response = await communicator.get_response()
> assert response["status"] == 200
> assert response["body"] == b"OK"
>
> 1) Error 1:
> I run it with command "pytest .py"
> The first error I got was:
> django.core.exceptions.ImproperlyConfigured: Requested settings, but
> settings are not configured. You must either define the environment
> variable DJANGO_SETTINGS_MODULE or call settings.configure() before
> accessing settings.
>
> I google online and found this fix:
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "MODULE_PATH_TO.settings")
>
>
> 2) Error 2:
> The new error I am getting is:
> self = , exc_type =  'concurrent.futures._base.CancelledError'>
>
> def _do_exit(self, exc_type: Type[BaseException]) -> None:
> if exc_type is asyncio.CancelledError and self._cancelled:
> self._cancel_handler = None
> self._task = None
> >   raise asyncio.TimeoutError
> E   concurrent.futures._base.TimeoutError
>
> But If I change async.sleep(3) to  async.sleep(0) the test passed. Not
> sure why
>
> Also how to test url mapping works correctly?
>
> Thanks
> Drew
>
>
> --
> 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/CAMmsbUk-3AemjcTxxidf4GBvKeWG7b72qwfUcs5owReTeOEMiw%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/CAFwN1uq02V6p53P84z0kJo13jrVWDtAr7_qoZ69L1cntQXww6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Redesign

2018-11-13 Thread Zakriya Bilal
Thanks for the much-needed help! (:

On Tuesday, November 13, 2018 at 5:45:06 PM UTC+5, brian hopkins wrote:
>
> You can override them check out this page in the docs
>
> https://docs.djangoproject.com/en/2.1/ref/contrib/admin/ 
> 
>
> Sent from my iPhone
>
> On Nov 12, 2018, at 9:14 PM, Phako Perez <13.ph...@gmail.com > 
> wrote:
>
> If I remember correctly you can define your own templates under the 
> template directory
>
> Regards
>
> Sent from my iPhone
>
> On Nov 12, 2018, at 4:49 PM, Zakriya Bilal  > wrote:
>
> I am starting a project in which one of the requirements is to have a 
> custom designed Admin panel. 
>
> So my question is: Is it possible to redesign the Django Admin panel? 
> Majority of the requirements are related to Front-end design? Is it a good 
> idea to redesign the front-end or just create a new admin area from scratch?
>
> I ask because the design of the admin panel is important. 
>
> Just to put it out there, I am coming from Laravel World. 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5544f0cd-5be7-4c91-a2ae-83c4b77dcfa7%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...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CD14A672-D2B0-477A-8CBE-85E2D6A1417F%40gmail.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/a44fba57-37e3-4340-b667-5afcc001d234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin Redesign

2018-11-13 Thread Zakriya Bilal
Thanks for the much-needed help! (:

On Tuesday, November 13, 2018 at 9:15:39 AM UTC+5, Phako Perez wrote:
>
> If I remember correctly you can define your own templates under the 
> template directory
>
> Regards
>
> Sent from my iPhone
>
> On Nov 12, 2018, at 4:49 PM, Zakriya Bilal  > wrote:
>
> I am starting a project in which one of the requirements is to have a 
> custom designed Admin panel. 
>
> So my question is: Is it possible to redesign the Django Admin panel? 
> Majority of the requirements are related to Front-end design? Is it a good 
> idea to redesign the front-end or just create a new admin area from scratch?
>
> I ask because the design of the admin panel is important. 
>
> Just to put it out there, I am coming from Laravel World. 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/5544f0cd-5be7-4c91-a2ae-83c4b77dcfa7%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/ff05a55d-c1c0-473e-b78b-9bb79a4bdd43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels group_send hangs in extrenal process

2018-11-13 Thread Yaro Kifor
Hello,

I am a little new to channels, but I can't seem to figure out this issue. I 
am trying to use group_send from an external process and I am using Redis 
as my channel backend. Here is what my process code looks like:
 

from channels.layers import get_channel_layer
from multiprocessing import Process
from asgiref.sync import AsyncToSync, SyncToAsync

class GenericAgent(Process):
def __init__(self, *args, **kwargs):
self.channel_layer = get_channel_layer()
self.send_message = AsyncToSync(self.channel_layer.group_send)
super().__init__(*args, **kwargs)

def run(self):
while True:
print("Sending data")
self.send_message('test', {'test': 0})
   time.sleep(1)


Anytime I run the process it will print out "Sending data" once and do 
nothing else. Any channel that is part of the test group will not receive 
anything as well. If anyone has a clue to what the issue might be please 
let know your help is greatly appreciated. 

Here is my pip freeze:

aioredis==1.2.0
asgiref==2.3.2
async-timeout==3.0.1
attrs==18.2.0
autobahn==18.11.1
Automat==0.7.0
certifi==2018.4.16
channels==2.1.5
channels-redis==2.3.1
chardet==3.0.4
constantly==15.1.0
daphne==2.2.3
Django==2.0.6
easy-thumbnails==2.5
future==0.15.2
hiredis==0.2.0
hyperlink==18.0.0
idna==2.7
imageio==2.3.0
incremental==17.5.0
interop==0.0.0
LatLon23==1.0.7
monotonic==1.2
msgpack==0.5.6
numpy==1.14.4
Pillow==5.1.0
psycopg2-binary==2.7.5
PyHamcrest==1.9.0
pyproj==1.9.5.1
pytz==2018.4
rawpy==0.10.1
requests==2.19.1
six==1.11.0
sorl-thumbnail==12.4.1
Twisted==18.9.0
txaio==18.8.1
urllib3==1.23
zope.interface==4.6.0


Thanks in advance,
Yaro  

-- 
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/4916f184-9db9-4d34-a9cd-3d6ff5238aff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels + django-tenants

2018-11-13 Thread lorinkoz
Django-tenants is a package to provide multi-tenancy in Django through 
Postgres schemas (https://github.com/tomturner/django-tenants/)

Django-tenants relies on setting the schema on the connection in order to 
make queries to the right Postgres schema. When you want to secure your 
consumers with user permissions, django-tenants needs to be properly routed 
in order to retrieve the right users from database, otherwise the user in 
scope is not properly populated for permission checking.

In order to overcome this, I have redefined (in a not DRY way, aka 
copy/paste) `get_user`, `TenantAuthMiddleware` and 
`TenantAuthMiddlewareStack`, just because I basically need to wrap 
`get_user` inside `with scope["tenant"]` (provided I put the tenant in the 
scope before, in a custom router.)

Is there any way to provide a hook so this can be achieved in a DRY way?

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


Re: Channels group_send hangs in extrenal process

2018-11-13 Thread Andrew Godwin
I've never tried using the async-to-sync stuff with multiprocessing -
first, I'd try removing that and see if it still works (just run from a
management command or script directly).

If it still fails, I'd suggest running a redis MONITOR to see if any
traffic makes it to Redis at all.

Andrew

On Tue, Nov 13, 2018 at 2:07 PM Yaro Kifor  wrote:

> Hello,
>
> I am a little new to channels, but I can't seem to figure out this issue.
> I am trying to use group_send from an external process and I am using Redis
> as my channel backend. Here is what my process code looks like:
>
>
> from channels.layers import get_channel_layer
> from multiprocessing import Process
> from asgiref.sync import AsyncToSync, SyncToAsync
>
> class GenericAgent(Process):
> def __init__(self, *args, **kwargs):
> self.channel_layer = get_channel_layer()
> self.send_message = AsyncToSync(self.channel_layer.group_send)
> super().__init__(*args, **kwargs)
>
> def run(self):
> while True:
> print("Sending data")
> self.send_message('test', {'test': 0})
>time.sleep(1)
>
>
> Anytime I run the process it will print out "Sending data" once and do
> nothing else. Any channel that is part of the test group will not receive
> anything as well. If anyone has a clue to what the issue might be please
> let know your help is greatly appreciated.
>
> Here is my pip freeze:
>
> aioredis==1.2.0
> asgiref==2.3.2
> async-timeout==3.0.1
> attrs==18.2.0
> autobahn==18.11.1
> Automat==0.7.0
> certifi==2018.4.16
> channels==2.1.5
> channels-redis==2.3.1
> chardet==3.0.4
> constantly==15.1.0
> daphne==2.2.3
> Django==2.0.6
> easy-thumbnails==2.5
> future==0.15.2
> hiredis==0.2.0
> hyperlink==18.0.0
> idna==2.7
> imageio==2.3.0
> incremental==17.5.0
> interop==0.0.0
> LatLon23==1.0.7
> monotonic==1.2
> msgpack==0.5.6
> numpy==1.14.4
> Pillow==5.1.0
> psycopg2-binary==2.7.5
> PyHamcrest==1.9.0
> pyproj==1.9.5.1
> pytz==2018.4
> rawpy==0.10.1
> requests==2.19.1
> six==1.11.0
> sorl-thumbnail==12.4.1
> Twisted==18.9.0
> txaio==18.8.1
> urllib3==1.23
> zope.interface==4.6.0
>
>
> Thanks in advance,
> Yaro
>
> --
> 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/4916f184-9db9-4d34-a9cd-3d6ff5238aff%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/CAFwN1upK-iXuxbZNTcPu78OzPnDAfS8-E%3DfOHnPUio0u1dppRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels + django-tenants

2018-11-13 Thread Andrew Godwin
What sort of hook would you be imagining? The DB connection stuff is deep
inside Django itself, rather than in Channels, so I'm not sure what
sensible top-level thing we could provide that would make sense.

Andrew

On Tue, Nov 13, 2018 at 2:16 PM  wrote:

> Django-tenants is a package to provide multi-tenancy in Django through
> Postgres schemas (https://github.com/tomturner/django-tenants/)
>
> Django-tenants relies on setting the schema on the connection in order to
> make queries to the right Postgres schema. When you want to secure your
> consumers with user permissions, django-tenants needs to be properly routed
> in order to retrieve the right users from database, otherwise the user in
> scope is not properly populated for permission checking.
>
> In order to overcome this, I have redefined (in a not DRY way, aka
> copy/paste) `get_user`, `TenantAuthMiddleware` and
> `TenantAuthMiddlewareStack`, just because I basically need to wrap
> `get_user` inside `with scope["tenant"]` (provided I put the tenant in the
> scope before, in a custom router.)
>
> Is there any way to provide a hook so this can be achieved in a DRY way?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c547563c-a8a6-416c-bf59-54907f512c77%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/CAFwN1uraywimYgY4BmsqxMf8n921WJ0-ZZLLLNJYcd%3D%3Dpaz%3DOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels group_send hangs in extrenal process

2018-11-13 Thread Yaro Kifor
Huh that's weird. I've removed the async-to-sync stuff and now the script
doesn't hang. I've checked redis MONITOR and I do see traffic now which
nice, but for some reason my consumer isn't seeing any of it. Maybe I
messed up the group_add method. Here's the redis MONITOR output.

1542149506.032331 [0 172.19.0.4:45506] "BRPOPLPUSH"
> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
> 1542149512.043776 [0 172.19.0.4:45506] "EVAL" "\nlocal
> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
> backed_up[i])\nend\nredis.call('DEL',
> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
> "asgi:specific.eYdlWGyC!$inflight"
> 1542149512.043867 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
> "-1"
> 1542149512.043884 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
> 1542149512.044194 [0 172.19.0.4:45506] "BRPOPLPUSH"
> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
> 1542149518.056667 [0 172.19.0.4:45506] "EVAL" "\nlocal
> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
> backed_up[i])\nend\nredis.call('DEL',
> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
> "asgi:specific.eYdlWGyC!$inflight"
> 1542149518.056757 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
> "-1"
> 1542149518.056773 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
> 1542149518.057120 [0 172.19.0.4:45506] "BRPOPLPUSH"
> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
> 1542149524.068806 [0 172.19.0.4:45506] "EVAL" "\nlocal
> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
> backed_up[i])\nend\nredis.call('DEL',
> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
> "asgi:specific.eYdlWGyC!$inflight"
> 1542149524.068919 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
> "-1"
> 1542149524.068935 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
> 1542149524.069345 [0 172.19.0.4:45506] "BRPOPLPUSH"
> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
> 1542149530.080909 [0 172.19.0.4:45506] "EVAL" "\nlocal
> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
> backed_up[i])\nend\nredis.call('DEL',
> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
> "asgi:specific.eYdlWGyC!$inflight"
> 1542149530.080999 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
> "-1"
> 1542149530.081015 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
> 1542149530.081372 [0 172.19.0.4:45506] "BRPOPLPUSH"
> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>
>
I'll let you know where I get with this. Thanks for the help so far.

Yaro

On Tue, Nov 13, 2018 at 5:34 PM Andrew Godwin  wrote:

> I've never tried using the async-to-sync stuff with multiprocessing -
> first, I'd try removing that and see if it still works (just run from a
> management command or script directly).
>
> If it still fails, I'd suggest running a redis MONITOR to see if any
> traffic makes it to Redis at all.
>
> Andrew
>
> On Tue, Nov 13, 2018 at 2:07 PM Yaro Kifor  wrote:
>
>> Hello,
>>
>> I am a little new to channels, but I can't seem to figure out this issue.
>> I am trying to use group_send from an external process and I am using Redis
>> as my channel backend. Here is what my process code looks like:
>>
>>
>> from channels.layers import get_channel_layer
>> from multiprocessing import Process
>> from asgiref.sync import AsyncToSync, SyncToAsync
>>
>> class GenericAgent(Process):
>> def __init__(self, *args, **kwargs):
>> self.channel_layer = get_channel_layer()
>> self.send_message = AsyncToSync(self.channel_layer.group_send)
>> super().__init__(*args, **kwargs)
>>
>> def run(self):
>> while True:
>> print("Sending data")
>> self.send_message('test', {'test': 0})
>>time.sleep(1)
>>
>>
>> Anytime I run the process it will print out "Sending data" once and do
>> nothing else. Any channel that is part of the test group will not receive
>> anything as well. If anyone has a clue to what the issue might be please
>> let know your help is greatly appreciated.
>>
>> Here is my pip freeze:
>>
>> aioredis==1.2.0
>> asgiref==2.3.2
>> async-timeout==3.0.1
>> attrs==18.2.0
>> autobahn==18.11.1
>> Automat==0.7.0
>> certifi==2018.4.16
>> channels==2.1.5
>> channels-redis==2.3.1
>> chardet==3.0.4
>> constantly==15.1.0
>> daphne==2.2.3
>> Django==2.0.6
>> easy-thumbnails==2.5
>> future==0.15.2
>> hiredis==0.2.0
>> hyperlink==18.0.0
>> idna==2.7
>> imageio==2.3.0
>> incremental==17.5.0
>> interop==0.0.0
>> LatLon23==1.0.7
>> monotonic==

Re: Channels + django-tenants

2018-11-13 Thread lorinkoz
I know this is not general, but maybe `get_user` could accept an optional 
function as second parameter, so that the function could wrap the inner 
content of the current `get_user`. django-tenants provides a regular 
middleware, but I think the async breaks any attempt to handle this through 
a channels-like middleware.

-- 
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/f99a231f-cdc5-426f-8d0a-20c0f8ebc2fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why does my Django project open the same home page irrespective or which url I type?

2018-11-13 Thread Alex Callaway
Thanks!

On Monday, November 12, 2018 at 7:06:37 PM UTC-8, Jason wrote:
>
> you have an ending slash on your login urls, and no ending slash in your 
> links defined.  try adding a trailing slash
>

-- 
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/cd52e49f-16d0-4d9e-8575-5434d2caca8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels group_send hangs in extrenal process

2018-11-13 Thread Yaro Kifor
I've ensured my consumer is setup properly, added a type field to the
message and added a callback method for that type. My callback method isn't
getting called. I've tested my callback method from a different source and
it worked there. In my tested I noticed that redis MONITOR logs this:

> 1542152017.290859 [0 lua] "EXPIRE" "asgi:specific.cNbsZzOu!" "60"
> 1542152017.290866 [0 lua] "LLEN" "asgi:specific.aqRkFBbT!"
> 1542152017.290874 [0 lua] "LPUSH" "asgi:specific.aqRkFBbT!"
> "\x83\xa4type\xa4test\xa4test\xa4test\xb0__asgi_channel__\x91\xbespecific.aqRkFBbT!FCpiHVGLaITQ
>

While from my GenericAgent process, redis MONITOR doesn't show anything
like this (see my previous email). I am not sure what my process is
missing. Is this a bug or am I going about this all wrong?

Yaro

On Tue, Nov 13, 2018 at 5:57 PM Yaro Kifor  wrote:

> Huh that's weird. I've removed the async-to-sync stuff and now the script
> doesn't hang. I've checked redis MONITOR and I do see traffic now which
> nice, but for some reason my consumer isn't seeing any of it. Maybe I
> messed up the group_add method. Here's the redis MONITOR output.
>
> 1542149506.032331 [0 172.19.0.4:45506] "BRPOPLPUSH"
>> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>> 1542149512.043776 [0 172.19.0.4:45506] "EVAL" "\nlocal
>> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
>> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
>> backed_up[i])\nend\nredis.call('DEL',
>> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
>> "asgi:specific.eYdlWGyC!$inflight"
>> 1542149512.043867 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
>> "-1"
>> 1542149512.043884 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
>> 1542149512.044194 [0 172.19.0.4:45506] "BRPOPLPUSH"
>> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>> 1542149518.056667 [0 172.19.0.4:45506] "EVAL" "\nlocal
>> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
>> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
>> backed_up[i])\nend\nredis.call('DEL',
>> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
>> "asgi:specific.eYdlWGyC!$inflight"
>> 1542149518.056757 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
>> "-1"
>> 1542149518.056773 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
>> 1542149518.057120 [0 172.19.0.4:45506] "BRPOPLPUSH"
>> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>> 1542149524.068806 [0 172.19.0.4:45506] "EVAL" "\nlocal
>> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
>> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
>> backed_up[i])\nend\nredis.call('DEL',
>> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
>> "asgi:specific.eYdlWGyC!$inflight"
>> 1542149524.068919 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
>> "-1"
>> 1542149524.068935 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
>> 1542149524.069345 [0 172.19.0.4:45506] "BRPOPLPUSH"
>> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>> 1542149530.080909 [0 172.19.0.4:45506] "EVAL" "\nlocal
>> backed_up = redis.call('LRANGE', ARGV[2], 0, -1)\nfor i =
>> #backed_up, 1, -1 do\nredis.call('LPUSH', ARGV[1],
>> backed_up[i])\nend\nredis.call('DEL',
>> ARGV[2])\n" "0" "asgi:specific.eYdlWGyC!"
>> "asgi:specific.eYdlWGyC!$inflight"
>> 1542149530.080999 [0 lua] "LRANGE" "asgi:specific.eYdlWGyC!$inflight" "0"
>> "-1"
>> 1542149530.081015 [0 lua] "DEL" "asgi:specific.eYdlWGyC!$inflight"
>> 1542149530.081372 [0 172.19.0.4:45506] "BRPOPLPUSH"
>> "asgi:specific.eYdlWGyC!" "asgi:specific.eYdlWGyC!$inflight" "5"
>>
>>
> I'll let you know where I get with this. Thanks for the help so far.
>
> Yaro
>
> On Tue, Nov 13, 2018 at 5:34 PM Andrew Godwin  wrote:
>
>> I've never tried using the async-to-sync stuff with multiprocessing -
>> first, I'd try removing that and see if it still works (just run from a
>> management command or script directly).
>>
>> If it still fails, I'd suggest running a redis MONITOR to see if any
>> traffic makes it to Redis at all.
>>
>> Andrew
>>
>> On Tue, Nov 13, 2018 at 2:07 PM Yaro Kifor  wrote:
>>
>>> Hello,
>>>
>>> I am a little new to channels, but I can't seem to figure out this
>>> issue. I am trying to use group_send from an external process and I am
>>> using Redis as my channel backend. Here is what my process code looks like:
>>>
>>>
>>> from channels.layers import get_channel_layer
>>> from multiprocessing import Process
>>> from asgiref.sync import AsyncToSync, SyncToAsync
>>>
>>> class GenericAgent(Process):
>>> def __init__(self, *args, **kwargs):
>>> self.channel_layer = get_channel_layer()
>>> self.send_message = AsyncToSync(self.channel_layer.group_send)
>>> super().__init__(*a

Deploy Django with Apache on Windows

2018-11-13 Thread ANi
Hi, 
I come across a problem when I want to deploy Django using Apache on 
Windows.

I separated some configurations into production.py and local.py, like 
database configurations.
And each files will read the actual setting data from a another file 
config.json.

I try to set the environment variables through the following files: 
 1. activate.bat  file of my virtual environment.
( This works only in local)

set "DJANGO_CONFIG=path\to\config.json"
set "DJANGO_SETTINGS_MODULE=myapp.settings.production"

 2. httpd.conf in Apache.
(env_module is enabled.)

LoadModule wsgi_module "path/to/mod_wsgi.cp37-win32.pyd"


WSGIScriptAlias / "path/to/wsgi.py"
WSGIPythonHome "path/to/virtualenv"
WSGIPythonPath "path/to/myproject"


SetEnv DJANGO_SETTINGS_MODULE "myapp.settings.production"
SetEnv DJANGO_CONFIG "path/to/config.json"


Alias /static "path/to/static-files"

 Require all granted





 Require all granted




The only way is to set the variables in wsgi.py, but this is not what I 
want.

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings.production')
os.environ.setdefault('DJANGO_CONFIG', 'path\to\config.json')

Please tell me if you need more information and thank you for helping.



-- 
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/ea0d1d61-f6b8-40f0-affe-61e78ddd41ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: using a foreign key with multiple choices

2018-11-13 Thread amit pant
use dict in  * LISTE_CHOIX.*

On Tue, Nov 13, 2018 at 6:14 PM 'Christian' via Django users <
django-users@googlegroups.com> wrote:

> Hello
>
> I need to use a model form to create a new instance of Recette,  using
> multiple choices list instead of the foreign_key
>
> *class Recette(models.Model):*
> *  ..*
> *categoriederecette = models.ForeignKey(Categorie,
> on_delete=models.CASCADE) *
>
> *class Categorie(models.Model):*
> *SOUPE = 'SP'*
> *DESSERTS ='DS'*
> *PLATUNIQUE ='PU'*
> *LISTE_CHOIX =  ((SOUPE,'Soupe'), (DESSERTS,'Desserts'),
> (PLATUNIQUE,'Plat unique'),)*
> *   .*
> *categorierecette = models.CharField(db_column='Categorierecette',
> max_length=15, choices=LISTE_CHOIX, blank=True, null=True)  # Field name
> made lowercase*
>
> I use a Modelform
> * : *
>
> *class RecettesForm(forms.ModelForm):*
> *categoriederecette = forms.ChoiceField(choices =
> Categorie.LISTE_CHOIX)*
>
> *class Meta:*
> *model = Recette*
> *fields = (..** ,'categoriederecette')*
>
>
> The form is displayed correctly,  but cannot be saved. In the test *if
> form.is_valid():*  I get a value error -
>
> * ValueError: Cannot assign "'SP'": "Recette.categoriederecette" must be a
> "Categorie" instance.*
>
> Any help would be greatly 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/524c62ab-2454-7746-ec6a-9c7daeed775d%40yahoo.fr
> 
> .
> 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/CAF2Ah_E2UnvGgt2G%3DZ1ECc2wvnaWPH32da5h%2BXxZhsgtjprHpA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: using a foreign key with multiple choices

2018-11-13 Thread Jani Tiainen
Well categoriederecette is a foereign key to your Categorie model.

Your models don't make any real sense.

If your categories are fixed you can remove foreign key and add charfield
and definitions directly to Recette model.

If you expect that categories are added, changed, created or deleted
frequently having your current structure is okayish. Just make a name field
in Categorie model as free text.

'Christian' via Django users  kirjoitti ti
13. marrask. 2018 klo 14.45:

> Hello
>
> I need to use a model form to create a new instance of Recette,  using
> multiple choices list instead of the foreign_key
>
> *class Recette(models.Model):*
> *  ..*
> *categoriederecette = models.ForeignKey(Categorie,
> on_delete=models.CASCADE) *
>
> *class Categorie(models.Model):*
> *SOUPE = 'SP'*
> *DESSERTS ='DS'*
> *PLATUNIQUE ='PU'*
> *LISTE_CHOIX =  ((SOUPE,'Soupe'), (DESSERTS,'Desserts'),
> (PLATUNIQUE,'Plat unique'),)*
> *   .*
> *categorierecette = models.CharField(db_column='Categorierecette',
> max_length=15, choices=LISTE_CHOIX, blank=True, null=True)  # Field name
> made lowercase*
>
> I use a Modelform
> * : *
>
> *class RecettesForm(forms.ModelForm):*
> *categoriederecette = forms.ChoiceField(choices =
> Categorie.LISTE_CHOIX)*
>
> *class Meta:*
> *model = Recette*
> *fields = (..** ,'categoriederecette')*
>
>
> The form is displayed correctly,  but cannot be saved. In the test *if
> form.is_valid():*  I get a value error -
>
> * ValueError: Cannot assign "'SP'": "Recette.categoriederecette" must be a
> "Categorie" instance.*
>
> Any help would be greatly 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/524c62ab-2454-7746-ec6a-9c7daeed775d%40yahoo.fr
> 
> .
> 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/CAHn91of2kF6XJFx--5iJMsx%3D-1jHdQ2pxoHxNwNHyjp%3Dm9jWEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Foreign key data saving issue

2018-11-13 Thread amit pant
could you share your progress then we can find what exactly you want.


On Tue, Nov 13, 2018 at 6:14 PM mohit basantani <
mohitbasantani1...@gmail.com> wrote:

> Hello I am new to django i have two tables namely Mastertable and Partlist
>
> Partlist columns:
>
> 1. id
> 2. partlist_name
>
> I am using the imort-export plugin to import the data in the mastertable
> where i have created a foreign key referred to partlist table, I want
> whenever i import any xls file first data would save to the partlist table
> and i will get the id of the inserted row and then the data should be saved
> in the mastertable. Please 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/fd74c2ec-9969-493e-b0c9-2aa05f6f1cc2%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/CAF2Ah_GKp4V9omg3sGWt3ucYv7SqEv_OokejB3QpqfEeZzA3RA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why I can't pass anything to my html? Django 2.1

2018-11-13 Thread Rookies DJ
Hi Omar Abou Mrad thanks for helping me,
 
Please read the ones in red:

What are you seeing?
My Web page as I want but, i'm missing the key value form my database

What errors do you get?
no errors everything working fine

in summary i'm not having any errors but i can't see anything form my 
database 

My project goal is retrieve a data form the database and display on web-page

But i can't pass any value form my database into my html page

Thanks help Omar Abou Mrad


On Tuesday, 13 November 2018 17:07:47 UTC+8, Omar Abou Mrad wrote:
>
> We would require more information;
> What errors do you get?
> What are you seeing?
>
> Either way, this is not correct: tank = tank_system.object.get(id(5))
> It should be: tank = tank_system.object.get(id=5)
>
> I suggest going through the django tutorial if you haven't already.
>
> On Tue, Nov 13, 2018 at 10:29 AM Rookies DJ  > wrote:
>
>>
>>
>> On Monday, 12 November 2018 21:26:48 UTC+8, Cuneyt Mertayak wrote:
>>>
>>> The content for the `render` method is supposed to be a dictionary: 
>>> https://docs.djangoproject.com/en/2.1/topics/http/shortcuts/#optional-arguments
>>>
>>> So change it to this render(requset, "FrounterWeb/body.html",{'tank': 
>>> tank})
>>>
>>> Also in the template file you want to display the properties of the ORM 
>>> (tank_system) object I guess, change them to {{tank.EC}}, 
>>> {{tank. temp}}, respectively.
>>>
>>> Hope it helps!
>>>
>>
>> Thx for help
>> Cuneyt Mertayak
>>
>>  but it didn't work, appreciate the reply, but suspect that the whiten 
>> the request to return there nothing, is the whole code become empty, that 
>> my believes 
>>  
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/45d9f4af-4807-4692-8d6e-dcc7ab14818a%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/40fc4541-5242-4b21-897e-b064bcde519b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.