Re: Pagination - Not Working

2019-02-18 Thread Aakash Baranwal
I am trying to do it using Django. I used Django Rest Framework API
Guide-Pagination for reference

On Tue, Feb 19, 2019 at 11:13 AM Siddharth Tamang <
tamangsiddhart...@gmail.com> wrote:

> Are you trying pagination using JavaScript or Django?
>
> On Mon, Feb 18, 2019 at 11:47 PM Aakash Baranwal 
> wrote:
>
>> Hello Everyone,
>>
>> I am new to Django and working towards developing a web app where 10
>> posts appear at a time with a "Load More" option given at last which when
>> clicked shows the next 10 posts. I am not able to find what is going wrong
>> with the code.
>>
>> Also, it is not showing the character counter for the textbox, so kindly
>> help me with that as well.
>>
>> I am sending the screenshot of the code, pagination.py file.
>>
>> Thank You in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thank you
> Siddharth Tamang
> AWS Certified Solutions Architect - Associate
>
> --
> 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/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Pagination - Not Working

2019-02-18 Thread Aakash Baranwal
I have also used Ajax with that. It's load more button is not working, it
is showing the 10 posts which is the limit I set in the beginning, but not
going beyond that.

On Tue, Feb 19, 2019 at 11:13 AM Siddharth Tamang <
tamangsiddhart...@gmail.com> wrote:

> Are you trying pagination using JavaScript or Django?
>
> On Mon, Feb 18, 2019 at 11:47 PM Aakash Baranwal 
> wrote:
>
>> Hello Everyone,
>>
>> I am new to Django and working towards developing a web app where 10
>> posts appear at a time with a "Load More" option given at last which when
>> clicked shows the next 10 posts. I am not able to find what is going wrong
>> with the code.
>>
>> Also, it is not showing the character counter for the textbox, so kindly
>> help me with that as well.
>>
>> I am sending the screenshot of the code, pagination.py file.
>>
>> Thank You in advance
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thank you
> Siddharth Tamang
> AWS Certified Solutions Architect - Associate
>
> --
> 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/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Pagination - Not Working

2019-02-19 Thread Aakash Baranwal
Hello,

Thanks for offering me your help, but the problem is I can't upload it on
internet as I have signed a Non Disclosure Agreement for the project in
which I am working, so totally helpless in this case.

However I might be able to give a specific portion of what you might need
for resolving this issue.

I am extremely sorry about this.

On Tue, Feb 19, 2019 at 1:38 PM Godson Rapture  wrote:

> Can you upload your code on github let me check where your problem is?
>
> On Tue, Feb 19, 2019, 6:43 AM Siddharth Tamang <
> tamangsiddhart...@gmail.com> wrote:
>
>> Are you trying pagination using JavaScript or Django?
>>
>> On Mon, Feb 18, 2019 at 11:47 PM Aakash Baranwal 
>> wrote:
>>
>>> Hello Everyone,
>>>
>>> I am new to Django and working towards developing a web app where 10
>>> posts appear at a time with a "Load More" option given at last which when
>>> clicked shows the next 10 posts. I am not able to find what is going wrong
>>> with the code.
>>>
>>> Also, it is not showing the character counter for the textbox, so kindly
>>> help me with that as well.
>>>
>>> I am sending the screenshot of the code, pagination.py file.
>>>
>>> Thank You in advance
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> --
>> Thank you
>> Siddharth Tamang
>> AWS Certified Solutions Architect - Associate
>>
>> --
>> 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/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEUEpOTUP_-rdoY8p4%2BfT4%2BTEmCLoSFyLQ1L%3DsdhfPkeHtY3rw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEUEpOTUP_-rdoY8p4%2BfT4%2BTEmCLoSFyLQ1L%3DsdhfPkeHtY3rw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Pagination - Not Working

2019-02-19 Thread Aakash Baranwal
It did not work. I tried making it using JavaScript like in websites if you
might have seen when you press the button then only it shows the content or
scrolls down.


On Tue, Feb 19, 2019 at 2:01 PM Siddharth Tamang <
tamangsiddhart...@gmail.com> wrote:

> Can you try this in your views.py?
>
> from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
>
> views.py
>
> feedTextAll = feedText.objects.order_by('-feedTexDate')
> pages = Paginator(feedTextAll,5)
> pageNum = request.GET.get('page')
> feedtext = pages.get_page(pageNum)
> return render(request, 'index.html',{'feedtext':feedtext})
>
>
> and then in your html file where you want to show paginated records
>
> {% for feedtext in feedtext%}
>
> > 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/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thank you
> Siddharth Tamang
> AWS Certified Solutions Architect - Associate
>
> --
> 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/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%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/CALr9hQ1CRSweCoycg0AfyiwG9LFb%3DZ2NL7oW7BMPuBg8qk%2B2GA%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>> --
>>> Thank you
>>> Siddharth Tamang
>>> AWS Certified Solutions Architect - Associate
>>>
>>> --
>>> 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/CADBOudtmJpskP-K_5%3D24BOXExeNq0%3DreM4nQZbWLaVrJVo0k8Q%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/CALr9hQ2%2Brp-ih4YCS34PYw3nxFwvvT-EG0DqAdbJ4taLunDHYQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Thank you
> Siddharth Tamang
> AW

Re: Pagination - Not Working

2019-02-19 Thread Aakash Baranwal
Thanks a lot. I worked that out by making the Load More as a clickable
button which when pressed will show the contents.

On Tue, Feb 19, 2019 at 9:00 PM Godson Rapture  wrote:

> Check out simple is better than complex blog. It should have a topic on
> pagination to help you
>
> On Tue, Feb 19, 2019, 9:20 AM Aakash Baranwal 
> wrote:
>
>> Hello,
>>
>> Thanks for offering me your help, but the problem is I can't upload it on
>> internet as I have signed a Non Disclosure Agreement for the project in
>> which I am working, so totally helpless in this case.
>>
>> However I might be able to give a specific portion of what you might need
>> for resolving this issue.
>>
>> I am extremely sorry about this.
>>
>> On Tue, Feb 19, 2019 at 1:38 PM Godson Rapture 
>> wrote:
>>
>>> Can you upload your code on github let me check where your problem is?
>>>
>>> On Tue, Feb 19, 2019, 6:43 AM Siddharth Tamang <
>>> tamangsiddhart...@gmail.com> wrote:
>>>
>>>> Are you trying pagination using JavaScript or Django?
>>>>
>>>> On Mon, Feb 18, 2019 at 11:47 PM Aakash Baranwal 
>>>> wrote:
>>>>
>>>>> Hello Everyone,
>>>>>
>>>>> I am new to Django and working towards developing a web app where 10
>>>>> posts appear at a time with a "Load More" option given at last which when
>>>>> clicked shows the next 10 posts. I am not able to find what is going wrong
>>>>> with the code.
>>>>>
>>>>> Also, it is not showing the character counter for the textbox, so
>>>>> kindly help me with that as well.
>>>>>
>>>>> I am sending the screenshot of the code, pagination.py file.
>>>>>
>>>>> Thank You in advance
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>>> To post to this group, send email to django-users@googlegroups.com.
>>>>> Visit this group at https://groups.google.com/group/django-users.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CALr9hQ02EKRB%3DUjPfgjX1Q1%2BG_QxxBovM7Xv_J9Y-Q%3DiwMLo_A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>> --
>>>> Thank you
>>>> Siddharth Tamang
>>>> AWS Certified Solutions Architect - Associate
>>>>
>>>> --
>>>> 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/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CADBOudsyrwDg%3DzcG3SgFMVnosOUtym%2BeR3d7UPXEa9GnRz7Opw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAEUEpOTUP_-rdoY8p4%2BfT4%2BTEmCLoSFyLQ1L%3DsdhfPkeHtY3rw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAEUEpOTUP_-rdoY8p4%2BfT4%2BT

Re: Deployment on Heroku

2019-03-25 Thread Aakash Baranwal
Its already present there.

On Mon, Mar 25, 2019 at 1:23 PM Christhian Jesus 
wrote:

> Add gunicorn to requeriments.txt
>
> On Mon, Mar 25, 2019 at 3:26 AM Ahmed Ishtiaque 
> wrote:
>
>> From the looks of it, it seems that in your procfile you need to point to
>> the *exact* location gunicorn is installed in. So this could be somewhere
>> like ~/.local/lib/pythonx.y/site-packages/gunicorn directory on your heroku
>> instance (if it’s a Linux filesystem... I don’t remember what heroku uses
>> exactly).
>>
>> Also yes, always use environment variables to import your passwords,
>> security keys etc. in deployment.
>>
>> On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal 
>> wrote:
>>
>>> Hi, I am Aakash. I have been working on a project which i want to deploy
>>> on heroku, but i have been facing some issues. I searched for solutions on
>>> the internet but none of them helped me.
>>>
>>> I, request you to kindly help me with the deployment.
>>>
>>> Pfa the settings.py, asgi.py , wsgi.py , Procfile.
>>> Also, please check line no 34 in settings.py for the
>>> EMAIL_HOST_PASSWORD, if I am doing it the right way or it should be done as
>>> commented in the same line after the code.
>>>
>>> As you will see in the terminal, it says Starting ASGI channels, so do i
>>> need the wsgi.py file anymore or should i run it with WSGI instead of ASGI?
>>>
>>> When I push it into the heroku server and run the application, it does
>>> not run and in the heroku logs the error which it shows is :
>>>
>>>  at=error code=H10 desc="App crashed" method=GET path="/" host=
>>> vibex.herokuapp.com request_id=3211546f-5081-4233-b016-428493e611c1
>>> fwd="139.167.172.83" dyno= connect= service= status=503 bytes= protocol=http
>>>
>>> and it also shows  bash: gunicorn: command not found
>>> which I have installed on my computer as well as by using heroku run pip
>>> install gunicorn.
>>>
>>> I shall be extremely thankful for your help.
>>>
>>> Thanks in advance
>>>
>>> With Kind Regards
>>> Aakash
>>>
>>> --
>>> 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/CALr9hQ12oZ4C1L6BtYyPGbQuwrezaeWzd8x9JkLXE8jM80nM5A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CALr9hQ12oZ4C1L6BtYyPGbQuwrezaeWzd8x9JkLXE8jM80nM5A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMQeudrvzzkbS4-ghdG-pmsm2%3Dx7L%3DfY7q-myj_3uCBStYyw6w%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMQeudrvzzkbS4-ghdG-pmsm2%3Dx7L%3DfY7q-myj_3uCBStYyw6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALr9hQ2bPF%3DZ-0UhGd4M%2BeSSP%2BL5U2J2qn0rHUQ3yAqmToC49w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deployment on Heroku

2019-03-25 Thread Aakash Baranwal
It goes into the site-packages in linux as well but it was not showing
there, infact even after I installed it there itself, then also it was not
there, however when I checked in the terminal by reinstalling it said that
requirement is already satisfied and its already in the requirements.txt
file.

I used this command :
as per the guide in this gunicorn guide by digital ocean
<https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04>
which is gunicorn --bind 0.0.0.0:8000 myproject.wsgi

Now when i run it in the browser, it says internal server error and the
terminal shows this error:

  File
"/home/aakash/Dev/tweetme/lib/python3.6/site-packages/gunicorn/workers/sync.py",
line 135, in handle
self.handle_request(listener, req, client, addr)
  File
"/home/aakash/Dev/tweetme/lib/python3.6/site-packages/gunicorn/workers/sync.py",
line 176, in handle_request
respiter = self.wsgi(environ, resp.start_response)
TypeError: __call__() takes 2 positional arguments but 3 were given


Kindly tell me what I might be doing wrong and also check my procfile if I
am going the right way

On Mon, Mar 25, 2019 at 12:56 PM Ahmed Ishtiaque 
wrote:

> From the looks of it, it seems that in your procfile you need to point to
> the *exact* location gunicorn is installed in. So this could be somewhere
> like ~/.local/lib/pythonx.y/site-packages/gunicorn directory on your heroku
> instance (if it’s a Linux filesystem... I don’t remember what heroku uses
> exactly).
>
> Also yes, always use environment variables to import your passwords,
> security keys etc. in deployment.
>
> On Mon, Mar 25, 2019 at 3:07 AM Aakash Baranwal 
> wrote:
>
>> Hi, I am Aakash. I have been working on a project which i want to deploy
>> on heroku, but i have been facing some issues. I searched for solutions on
>> the internet but none of them helped me.
>>
>> I, request you to kindly help me with the deployment.
>>
>> Pfa the settings.py, asgi.py , wsgi.py , Procfile.
>> Also, please check line no 34 in settings.py for the EMAIL_HOST_PASSWORD,
>> if I am doing it the right way or it should be done as commented in the
>> same line after the code.
>>
>> As you will see in the terminal, it says Starting ASGI channels, so do i
>> need the wsgi.py file anymore or should i run it with WSGI instead of ASGI?
>>
>> When I push it into the heroku server and run the application, it does
>> not run and in the heroku logs the error which it shows is :
>>
>>  at=error code=H10 desc="App crashed" method=GET path="/" host=
>> vibex.herokuapp.com request_id=3211546f-5081-4233-b016-428493e611c1
>> fwd="139.167.172.83" dyno= connect= service= status=503 bytes= protocol=http
>>
>> and it also shows  bash: gunicorn: command not found
>> which I have installed on my computer as well as by using heroku run pip
>> install gunicorn.
>>
>> I shall be extremely thankful for your help.
>>
>> Thanks in advance
>>
>> With Kind Regards
>> Aakash
>>
>> --
>> 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/CALr9hQ12oZ4C1L6BtYyPGbQuwrezaeWzd8x9JkLXE8jM80nM5A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALr9hQ12oZ4C1L6BtYyPGbQuwrezaeWzd8x9JkLXE8jM80nM5A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKizqR6PP%2BROesNLjjXLWfX%3Dz8FdL4NJXqTpDtNzrkesYRYcsw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You r

Caltech Pedestrian Detection Annotations

2019-04-08 Thread Aakash Baranwal
Hi Everybody,

This is not exactly a Django related question, but I need help.

I am working on a project, and I have to use Caltech Pedestrian Detection
 data
set. However, I am not able to get the output as desired as the files are
in VBB format and moreover I am not able to interpret the matrix.

If anyone happens to have any kind of documentation which will help in
using the data set for training the model and correctly interpreting the
data, or are aware how to correctly use it, please help me.

I shall be extremely thankful.

Thanks in advance.

With Kind Regards

Aakash

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


Integrating Machine Learning Model in Django

2019-04-11 Thread Aakash Baranwal
Hi Everybody,

I need a help in integrating a machine learning model with my website.

I have a file upload button where I can upload either an image or a video.
After it is uploaded, I want to run my model into it and whatever is the
result I want to display it and keep a record of the whole process.

Also, I wish to add a feature of connecting my website with my CCTV camera,
so I can have a live video feed instead of uploading a video and then do
the same.

PS - I can select whether I want to upload the image or the video or I want
to use the live footage of the camera and run my model on that.

Thank You in advance.

With Kind Regards

Aakash

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


Re: Integrating Machine Learning Model in Django

2019-04-11 Thread Aakash Baranwal
Thanks a  lot.

I read about it and I think it will do the job for me. I plan to send a
live video and chunk it after 1 hour time and then run the model on it.

How to create a REST API for calling my model to run on the video and then
another challenge is how to show the result video to the person who
requested for the service i.e. the one who uploaded the video.

Thank you for the 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/CALr9hQ0jycsmAYuOSXNmpQc3MuWuomda30ESR55XGcEGugPS%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Getting a TypeError

2019-04-16 Thread Aakash Baranwal
Hi Everybody,

Kindly help me out.

My views.py file is:

def video_detail_view(request):
obj = str(Video.objects.get(id=id))
print(obj)
context = {
"object": obj
}
return render(request, "deploy/list_view.html", context)


def video_list_view(request):
queryset = Video.objects.all()
print(queryset)
for obj in queryset:
print(obj.Video_Description, obj.videofile)
context = {
"object_list": queryset
}
return render(request, "deploy/detail_view.html", context)


The models.py file is:

class Video(models.Model):
Video_Description= models.CharField(max_length=500)
videofile= models.FileField(upload_to='videos/', null=True,
verbose_name="")

def __str__(self):
return self.Video_Description + ": " + str(self.videofile)

The error I am getting is:
int() argument must be a string, a bytes-like object or a number not
'builtin_function_or_method'.

The error is in views.py file in obj = str(Video.objects.get(id=id)).

Kindly help me out.

Thank you

Best
Aakash

-- 
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/CALr9hQ0c%2Bn5VYCzP24XSekY8R%3DSZ2bORWWRjH31o2hsWM_s%3DWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


File not getting uploaded

2019-04-16 Thread Aakash Baranwal
Hi Everybody,

I am trying to upload a file, but it says "No file chosen", even when I
have selected the file. However it is getting uploaded when I have logged
in as as admin and i am uploading it from there.

Kindly help me, thanks in advance.

views.py file:

class VideoCreateView(CreateView):
form_class = VideoModelForm
fields = ['Video_Description','videofile']
template_name = 'deploy/create_view.html'

success_url = "/video/create/"

def form_valid(self, form):
form.instance.user = self.request.videofile
return super(VideoCreateView, self).form_valid(form)


models.py file:

class Video(models.Model):
Video_Description= models.CharField(max_length=500)
videofile= models.FileField(upload_to='videos/', null=True,
verbose_name="")
timestamp   = models.DateTimeField(auto_now_add=True)

class Meta:
ordering = ['-timestamp']


def __str__(self):
return self.Video_Description + ": " + str(self.id)


urls.py file:


url(r'^create/$', VideoCreateView.as_view(), name='create')


create_view.html :


{% csrf_token %}
{{ form.as_p }}



PFA the image file displaying the page after i selected the file and hit
the Upload Video button

With Kind Regards

Aakash Baranwal

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


Re: File not getting uploaded

2019-04-16 Thread Aakash Baranwal
Sorry, the image file wasnt uploaded.



On Wed, Apr 17, 2019 at 12:04 PM Aakash Baranwal 
wrote:

> Hi Everybody,
>
> I am trying to upload a file, but it says "No file chosen", even when I
> have selected the file. However it is getting uploaded when I have logged
> in as as admin and i am uploading it from there.
>
> Kindly help me, thanks in advance.
>
> views.py file:
>
> class VideoCreateView(CreateView):
> form_class = VideoModelForm
> fields = ['Video_Description','videofile']
> template_name = 'deploy/create_view.html'
>
> success_url = "/video/create/"
>
> def form_valid(self, form):
> form.instance.user = self.request.videofile
> return super(VideoCreateView, self).form_valid(form)
>
>
> models.py file:
>
> class Video(models.Model):
> Video_Description= models.CharField(max_length=500)
> videofile= models.FileField(upload_to='videos/', null=True,
> verbose_name="")
> timestamp   = models.DateTimeField(auto_now_add=True)
>
> class Meta:
> ordering = ['-timestamp']
>
>
> def __str__(self):
> return self.Video_Description + ": " + str(self.id)
>
>
> urls.py file:
>
>
> url(r'^create/$', VideoCreateView.as_view(), name='create')
>
>
> create_view.html :
>
> 
> {% csrf_token %}
> {{ form.as_p }}
> 
> 
>
> PFA the image file displaying the page after i selected the file and hit
> the Upload Video button
>
> With Kind Regards
>
> Aakash Baranwal
>

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


Re: File not getting uploaded

2019-04-17 Thread Aakash Baranwal
Hi,

Actually, his solution was correct because when I provided the encryption
it worked, however I am not sure about the reason why it did worked at all.

Thanks a lot.

With Kind Regards
Aakash Baranwal

On 17 Apr 2019 7:23 p.m., "Ram sundar"  wrote:

> Hi Vijay,
>
> You are right, but he has mentioned that it gets uploaded when logged in
> as admin. Will it be a different template for the same view? Just
> wondering...
>
> @Aakaash: can you please check in both cases and confirm please
>
> Regards,
> Ramsundar
>
>
> On Wed 17 Apr, 2019, 6:18 PM Vijay Khemlani,  wrote:
>
>> In your HTML, the form tag should have an enctype
>>
>> 
>> ...
>> 
>>
>> On Wed, Apr 17, 2019 at 2:36 AM Aakash Baranwal 
>> wrote:
>>
>>> Sorry, the image file wasnt uploaded.
>>>
>>>
>>>
>>> On Wed, Apr 17, 2019 at 12:04 PM Aakash Baranwal 
>>> wrote:
>>>
>>>> Hi Everybody,
>>>>
>>>> I am trying to upload a file, but it says "No file chosen", even when I
>>>> have selected the file. However it is getting uploaded when I have logged
>>>> in as as admin and i am uploading it from there.
>>>>
>>>> Kindly help me, thanks in advance.
>>>>
>>>> views.py file:
>>>>
>>>> class VideoCreateView(CreateView):
>>>> form_class = VideoModelForm
>>>> fields = ['Video_Description','videofile']
>>>> template_name = 'deploy/create_view.html'
>>>>
>>>> success_url = "/video/create/"
>>>>
>>>> def form_valid(self, form):
>>>> form.instance.user = self.request.videofile
>>>> return super(VideoCreateView, self).form_valid(form)
>>>>
>>>>
>>>> models.py file:
>>>>
>>>> class Video(models.Model):
>>>> Video_Description= models.CharField(max_length=500)
>>>> videofile= models.FileField(upload_to='videos/', null=True,
>>>> verbose_name="")
>>>> timestamp   = models.DateTimeField(auto_now_add=True)
>>>>
>>>> class Meta:
>>>> ordering = ['-timestamp']
>>>>
>>>>
>>>> def __str__(self):
>>>> return self.Video_Description + ": " + str(self.id)
>>>>
>>>>
>>>> urls.py file:
>>>>
>>>>
>>>> url(r'^create/$', VideoCreateView.as_view(), name='create')
>>>>
>>>>
>>>> create_view.html :
>>>>
>>>> 
>>>> {% csrf_token %}
>>>> {{ form.as_p }}
>>>> 
>>>> 
>>>>
>>>> PFA the image file displaying the page after i selected the file and
>>>> hit the Upload Video button
>>>>
>>>> With Kind Regards
>>>>
>>>> Aakash Baranwal
>>>>
>>> --
>>> 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/CALr9hQ2eq0np-THVoQOBJ6ux3fqw%
>>> 2BzA1DM4DBHshTP5dMNat2g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CALr9hQ2eq0np-THVoQOBJ6ux3fqw%2BzA1DM4DBHshTP5dMNat2g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/CALn3ei1ZicOfYs2Xe1CuEuHgxhQVFLv3BDhcEa5VWoa%2BC7JQzw%
>> 40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALn3ei1ZicOfYs2Xe1CuEuHgxhQVFLv3BDhcEa5VWoa%2BC7

Re: File not getting uploaded

2019-04-17 Thread Aakash Baranwal
Thanks a lot. Your solution worked perfectly for me.

With Kind Regards
Aakash Baranwal

On 17 Apr 2019 7:36 p.m., "Vijay Khemlani"  wrote:

When he said "uploading it from there" I was not sure whether "there" meant
Django's admin page or the same view that's failing now

As far as I know the form has to have a multipart enctype to upload files

On Wed, Apr 17, 2019 at 9:53 AM Ram sundar  wrote:

> Hi Vijay,
>
> You are right, but he has mentioned that it gets uploaded when logged in
> as admin. Will it be a different template for the same view? Just
> wondering...
>
> @Aakaash: can you please check in both cases and confirm please
>
> Regards,
> Ramsundar
>
>
> On Wed 17 Apr, 2019, 6:18 PM Vijay Khemlani,  wrote:
>
>> In your HTML, the form tag should have an enctype
>>
>> 
>> ...
>> 
>>
>> On Wed, Apr 17, 2019 at 2:36 AM Aakash Baranwal 
>> wrote:
>>
>>> Sorry, the image file wasnt uploaded.
>>>
>>>
>>>
>>> On Wed, Apr 17, 2019 at 12:04 PM Aakash Baranwal 
>>> wrote:
>>>
>>>> Hi Everybody,
>>>>
>>>> I am trying to upload a file, but it says "No file chosen", even when I
>>>> have selected the file. However it is getting uploaded when I have logged
>>>> in as as admin and i am uploading it from there.
>>>>
>>>> Kindly help me, thanks in advance.
>>>>
>>>> views.py file:
>>>>
>>>> class VideoCreateView(CreateView):
>>>> form_class = VideoModelForm
>>>> fields = ['Video_Description','videofile']
>>>> template_name = 'deploy/create_view.html'
>>>>
>>>> success_url = "/video/create/"
>>>>
>>>> def form_valid(self, form):
>>>> form.instance.user = self.request.videofile
>>>> return super(VideoCreateView, self).form_valid(form)
>>>>
>>>>
>>>> models.py file:
>>>>
>>>> class Video(models.Model):
>>>> Video_Description= models.CharField(max_length=500)
>>>> videofile= models.FileField(upload_to='videos/', null=True,
>>>> verbose_name="")
>>>> timestamp   = models.DateTimeField(auto_now_add=True)
>>>>
>>>> class Meta:
>>>> ordering = ['-timestamp']
>>>>
>>>>
>>>> def __str__(self):
>>>> return self.Video_Description + ": " + str(self.id)
>>>>
>>>>
>>>> urls.py file:
>>>>
>>>>
>>>> url(r'^create/$', VideoCreateView.as_view(), name='create')
>>>>
>>>>
>>>> create_view.html :
>>>>
>>>> 
>>>> {% csrf_token %}
>>>> {{ form.as_p }}
>>>> 
>>>> 
>>>>
>>>> PFA the image file displaying the page after i selected the file and
>>>> hit the Upload Video button
>>>>
>>>> With Kind Regards
>>>>
>>>> Aakash Baranwal
>>>>
>>> --
>>> 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/CALr9hQ2eq0np-THVoQOBJ6ux3fqw%
>>> 2BzA1DM4DBHshTP5dMNat2g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CALr9hQ2eq0np-THVoQOBJ6ux3fqw%2BzA1DM4DBHshTP5dMNat2g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/CALn3ei1ZicOfYs2Xe1CuEuHgxh

Re: File not getting uploaded

2019-04-18 Thread Aakash Baranwal
Yes Sir,

I corrected it. Thanks a lot.

Best
Aakash

On Thu, Apr 18, 2019 at 8:46 PM adarsh pandey 
wrote:

> Gentle man you have not given enctype=" form/multipartdata" in the form
> tag of the HTML file
>
>
> On Wed, Apr 17, 2019, 12:05 PM Aakash Baranwal 
> wrote:
>
>> Hi Everybody,
>>
>> I am trying to upload a file, but it says "No file chosen", even when I
>> have selected the file. However it is getting uploaded when I have logged
>> in as as admin and i am uploading it from there.
>>
>> Kindly help me, thanks in advance.
>>
>> views.py file:
>>
>> class VideoCreateView(CreateView):
>> form_class = VideoModelForm
>> fields = ['Video_Description','videofile']
>> template_name = 'deploy/create_view.html'
>>
>> success_url = "/video/create/"
>>
>> def form_valid(self, form):
>> form.instance.user = self.request.videofile
>> return super(VideoCreateView, self).form_valid(form)
>>
>>
>> models.py file:
>>
>> class Video(models.Model):
>> Video_Description= models.CharField(max_length=500)
>> videofile= models.FileField(upload_to='videos/', null=True,
>> verbose_name="")
>> timestamp   = models.DateTimeField(auto_now_add=True)
>>
>> class Meta:
>> ordering = ['-timestamp']
>>
>>
>> def __str__(self):
>> return self.Video_Description + ": " + str(self.id)
>>
>>
>> urls.py file:
>>
>>
>> url(r'^create/$', VideoCreateView.as_view(), name='create')
>>
>>
>> create_view.html :
>>
>> 
>> {% csrf_token %}
>> {{ form.as_p }}
>> 
>> 
>>
>> PFA the image file displaying the page after i selected the file and hit
>> the Upload Video button
>>
>> With Kind Regards
>>
>> Aakash Baranwal
>>
>> --
>> 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/CALr9hQ0iBSOt1tUxXUW06bVBd%2B1Crm-O8_A-tyV01jtGWhS5sw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALr9hQ0iBSOt1tUxXUW06bVBd%2B1Crm-O8_A-tyV01jtGWhS5sw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKzwNoZBxxjgqchh1UbtK1r_W1fjTYaFg6ASh-q%2BgjFPvTPVaQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKzwNoZBxxjgqchh1UbtK1r_W1fjTYaFg6ASh-q%2BgjFPvTPVaQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Slug not working

2019-04-18 Thread Aakash Baranwal
Hello Sir,

As of now, I haven't thought of making any tutorials as I am just learning.

Best
Aakash

On Thu, Apr 18, 2019 at 4:05 PM fofa Zu  wrote:

> idk what is the problem but i liked your app it is a tutorial if is it may
> i get the link thanks
>
> ‫في الخميس، 18 أبريل 2019 في 12:41 م تمت كتابة ما يلي بواسطة ‪Aakash
> Baranwal‬‏ <‪baakash1...@gmail.com‬‏>:‬
>
>> Hi Everybody,
>>
>> This is my models.py file:
>>
>> from django.db.models.signals import pre_save
>> from django.utils.text import slugify
>> from django.db import models
>> from django.conf import settings
>> from django import forms
>>
>> # Create your models here.
>> class Video(models.Model):
>> Video_Description= models.CharField(max_length=500)
>> slug = models.SlugField(unique=True)
>>
>> videofile= models.FileField(upload_to='videos/', null=True,
>> verbose_name="")
>> timestamp   = models.DateTimeField(auto_now_add=True)
>>
>> class Meta:
>> ordering = ['-timestamp']
>>
>> def get_absolute_url(self):
>> return reverse ("video:detail", kwargs={"slug":self.slug})
>>
>>
>> def __str__(self):
>> return self.Video_Description + ": " + str(self.id)
>>
>>
>> def create_slug(instance, new_slug=None):
>> slug = slugify(instance.Video_Description)
>> if new_slug is not None:
>> slug = new_slug
>> qs = Video.objects.filter(slug=slug).order_by("-id")
>> exists = qs.exists()
>> if exists:
>> new_slug = "%s-%s" %(slug, qs.first().id)
>> return create_slug(instance, slug=new_slug)
>> return slug
>>
>>
>> def pre_save_video_receiver(sender, instance, *args, **kwargs):
>> if not instance.slug:
>> instance.slug = create_slug(instance)
>>
>> pre_save.connect(pre_save_video_receiver, sender=Video)
>>
>>
>> The problem I am facing is, slug field appears in the admin and
>> unfortunately in the create page where I am uploading the videos.
>>
>> However, in the url it is not coming, also in the create page, I have to
>> enter the slug manually. I want it to take whatever input was given to t
>> video_description in the models.py file and it should disappear from the
>> create post page.
>>
>> Kindly help me.
>>
>> With Kind Regards
>> Aakash Baranwal
>>
>> --
>> 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/CALr9hQ2hsoqjBaN7g5%2B6rqkEyRYrfDMHPan8tSvHG%3DQjhnfRbw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CALr9hQ2hsoqjBaN7g5%2B6rqkEyRYrfDMHPan8tSvHG%3DQjhnfRbw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPkS-C57EYh-PS56ZUAM0wcuvUoZs5Lu_71x5fRWwoq2tM0uiQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPkS-C57EYh-PS56ZUAM0wcuvUoZs5Lu_71x5fRWwoq2tM0uiQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Slug not working

2019-04-18 Thread Aakash Baranwal
Can anyone kindly suggest what I am doing wrong?

Thanks
Aakash

On Thu, Apr 18, 2019 at 3:10 PM Aakash Baranwal 
wrote:

> Hi Everybody,
>
> This is my models.py file:
>
> from django.db.models.signals import pre_save
> from django.utils.text import slugify
> from django.db import models
> from django.conf import settings
> from django import forms
>
> # Create your models here.
> class Video(models.Model):
> Video_Description= models.CharField(max_length=500)
> slug = models.SlugField(unique=True)
>
> videofile= models.FileField(upload_to='videos/', null=True,
> verbose_name="")
> timestamp   = models.DateTimeField(auto_now_add=True)
>
> class Meta:
> ordering = ['-timestamp']
>
> def get_absolute_url(self):
> return reverse ("video:detail", kwargs={"slug":self.slug})
>
>
> def __str__(self):
> return self.Video_Description + ": " + str(self.id)
>
>
> def create_slug(instance, new_slug=None):
> slug = slugify(instance.Video_Description)
> if new_slug is not None:
> slug = new_slug
> qs = Video.objects.filter(slug=slug).order_by("-id")
> exists = qs.exists()
> if exists:
> new_slug = "%s-%s" %(slug, qs.first().id)
> return create_slug(instance, slug=new_slug)
> return slug
>
>
> def pre_save_video_receiver(sender, instance, *args, **kwargs):
> if not instance.slug:
> instance.slug = create_slug(instance)
>
> pre_save.connect(pre_save_video_receiver, sender=Video)
>
>
> The problem I am facing is, slug field appears in the admin and
> unfortunately in the create page where I am uploading the videos.
>
> However, in the url it is not coming, also in the create page, I have to
> enter the slug manually. I want it to take whatever input was given to t
> video_description in the models.py file and it should disappear from the
> create post page.
>
> Kindly help me.
>
> With Kind Regards
> Aakash Baranwal
>

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


Help for reading data from csv file and store the data in json format in Django

2019-04-25 Thread Aakash Baranwal
Hi Everybody,

I have a CSV file in media folder inside my django project. I want to read
the data from the CSV file and store it in JSON format either directly in
the database or convert it into JSON from CSV file and then store it, and
enable me to view it on an html page, in my Django Web Application.

Kindly help me.

With Kind Regards

Aakash

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


Search and display results using calendar in Django

2019-04-30 Thread Aakash Baranwal
Hi Everybody,

I need help.

I want to perform search operation using calendars. I shall select two
dates i.e. max_date which shall not be more than the current date but can
be less and min_date, these two shall be the days range. The result fields
are: in_count, out_count, and dwell_time. The output should sum up all the
results of all the days which are between the max_date and min_date. How
can I do that? Please help. Is there a need to define a model for this? I
am completely clueless.

Expected result is getting the output in the same form as in
result_list.html with the result of all the fields of the days starting
from min_date till max_date getting displayed and the min_date and max_date
should also be shown in the template. Kindly help.

My model :

class Result(models.Model):

in_count   = models.PositiveIntegerField()
out_count  = models.PositiveIntegerField()
date_time  = models.DateTimeField()
time   = models.TimeField()

def __str__(self):

return "{},{},{},{}".format(self.in_count, self.out_count,
self.date_time, self.time)

My views.py

class ResultListView(ListView):

def get_queryset(self, *args, **kwargs):
qs = Result.objects.all()
print(self.request.GET)
query = self.request.GET.get("q", None)
if query is not None:
qs = qs.filter(
Q(in_count__icontains=query) |
Q(out_count__icontains=query) | Q(date_time__icontains=query) |
Q(time__icontains=query))
return qs

def get_context_data(self, *args, **kwargs):
context = super(ResultListView, self).get_context_data(*args, **kwargs)

return context

class ResultDetailView(DetailView):
queryset = Result.objects.all()


My result_list.html

Result on {{ object.date_time}}
  
Result of Model
 In Count {{ object.in_count }}

Out Count {{ object.out_count}}

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


Re: Search and display results using calendar in Django

2019-05-01 Thread Aakash Baranwal
My Calendar.html:
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css";>


https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css";>
https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css";
/>

https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js";>
https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js";>
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js";>

https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js";>

























jQuery(function () {
jQuery('#datetimepicker6').datetimepicker();

jQuery('#datetimepicker7').datetimepicker({
useCurrent: false //Important! See issue #1075
});
jQuery("#datetimepicker6").on("dp.change", function (e) {
jQuery('#datetimepicker7').data("DateTimePicker").minDate(e.date);
});
jQuery("#datetimepicker7").on("dp.change", function (e) {
jQuery('#datetimepicker6').data("DateTimePicker").maxDate(e.date);
});
});



Now, I want to select multiple dates using this, say start_date and
end_date which will filter the dates between that range and then sum the
value of in_count and out_count and display it to the user.

So, far what I think I should use is, but I am not sure how to do it and
display the result to the user. Someone please help me here.

Result.objects.filter(

date_time__range=[start_date,
end_date]).aggregate(Sum('in_count'), Sum('out_count'))

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