Re: Poll Tutorial: I'm stuck I have mysql on my vps I created the database

2019-01-22 Thread Anirudh Jain
First of all you can remove 'PORT'. Then the most important thing to do is
to grant your user privileges to perform operations on mysql database that
you must have created by the name 'urbanpyt_polls'. The easiest way to do
is to run this query on mysql : GRANT ALL PRIVILEGES ON *.* TO
'username'@'localhost'
IDENTIFIED BY 'password';
You only need to replace 'username' by your user and similarly the password.
After this - python manage.py makemigrations and then migrate

On Wed, Jan 23, 2019 at 12:28 PM RETAIL CYBER  wrote:

> has anyone ever install the django on a live web hosting service? if so
> when it comes to using db is the db virtual just like djangoEnv or do i use
> the mysql thats on my host? i have a vsp??
>
> --
> 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/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*Anirudh Jain* | *Appreciate you taking time to read the mail.*

-- 
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/CAC3mK7d3nUo%3DUy_%2B0yd8q_nvXHZbcRZmPoZAhuX-Rgg8wb%2BeTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Charfield variable length

2019-01-23 Thread Anirudh Jain
If you are sure that values entered will only be 0s and 1s then why not use
IntegerField(). But if really want to use CharField() and you know that
size won't be larger than 180bits then use CharField(max_lenght=25)

On Thu, 24 Jan 2019, 06:23 Mike Dewhirst  On 24/01/2019 9:14 am, 'Odile Lambert' via Django users wrote:
> >
> > Hello
> >
> > I have problems with the Charfield max_length. In the source code, the
> > possibility exists to have max_length = None but it does not pass
> > Django check when  models.py. contains a charfield = None
> >
> > I can understand that there is a need for such a max_length form the
> > database point of view .
> >
>
> When you run migrate it establishes the size of the Char field *in the
> database*. Therefore it can only be set once per migration.
>
> > My need is the following:
> >
> > I have a set of  fields whose content in the database is a binary code
> > of maximum 180 bits. Most of the time it will be much shorter and
> > there is  in the form a field (max size) giving this maximum size.
> >
> > The user needs to input this field in the database as a Character
> > string of 0 and 1. using hexadecimal fields would be very unpractical.
> > Last but not least, I am using the admin to enter these data in the
> > database.
> >
> > In a first shot, I used a Charfield and*I overwrote the field in the
> > init to set the maximum length to the value chosen by the user. I also
> > modifed the attributes of the widget. But at the end the HTML contains
> > a texinput with the max length set in the model.
> > *
> >
> > Is this an admin feature or did I miss something?
> >
>
> A TextField is a varying length character field. Might be of interest.
>
> A binary field requires bytes not text. I think if I needed binary data
> entered by a user I would use a CharField with a reasonable max_length
> and in the model.save() method I would convert/interpret the data
> entered into precisely the binary format I needed and then
> programmatically store it into a "parallel" binary field. I would
> probably make it readonly in the Admin or just not display it.
>
> I'm not sure about using binary fields with a choice attribute but that
> might be another thing to research.
>
> You can certainly use choices in a CharField to totally restrict the
> data entered.
>
> > . Any other suggestion on how to handle these fields would be welcomed.
> >
>
> It might be easier to offer advice if your use-case was more clear.
>
> > --
> > 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/23ff10f1-41d5-8da1-18a4-07d457be8756%40laposte.net
> > <
> https://groups.google.com/d/msgid/django-users/23ff10f1-41d5-8da1-18a4-07d457be8756%40laposte.net?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/e55ea10b-7fc6-efd9-ec87-02b5b75368f2%40dewhirst.com.au
> .
> 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/CAC3mK7dpwk%3DrAUDT4VbUZ94rz30JHKHKVe0kDMmrjN_xAcz0zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can I reference a field from one model to another model

2019-01-25 Thread Anirudh Jain
You can do this easily by creating creating an object of that model from
which you want to get the value or input a value by using
'get_object_or_404' or 'get_list_or_404' by importing from
django.shortucts. Reas about these two functions and difference between
them in documentation.

Use them, for eg :-
 derive = get_object_or_404(ModelChild1, ModelDad=request.user) #object
created of model ModelChild1

access = derive.number #will give the value of number that has been input
by user

On Fri, 25 Jan 2019, 17:29 NAveeN Kumar Reddy  You can use this where you want you to link tables with foreign key
>
> models.ForeignKey(Model_Name,on_delete=models.CASCADE)
>
> That's it  both tables will be in relation after migration of models into
> database
>
>
>
> On Fri, Jan 25, 2019 at 12:20 PM Mike Dewhirst 
> wrote:
>
>> On 24/01/2019 5:28 pm, carlos wrote:
>> > Hello,
>> > I do not know if I'm asking the question correctly, but I need to call
>> > a field of one model in another model
>> > example:
>> > class ModelDad(models.Model):
>> > name = blablabla
>> >
>> > class ModelChild1():
>> >fk(ModelDad)
>> >number = models.IntegerField()
>> >
>> > class ModelChild2():
>> >   fk(ModelDad)
>> >   another_number = models.IntegerField()
>> >
>> >def make_proces(self):
>> >   return self.another_number * ModelChild1.number #this is my
>> question
>> >
>> > how can I send a call number within the function (make_proces ) of
>> > ModelChild2
>>
>> You need a mechanism to find ModelChild1 and the Django ORM provides
>> Queries for exactly that.
>>
>> There is a default model manager called 'objects' which you can use to
>> find instances of models. By that I mean you can pinpoint a row in the
>> database table which that model represents. For example ... (but to make
>> it clearer I'll adjust your models above slightly)
>>
>> class ModelDad(models.Model):
>>  name = blablabla
>>
>> class ModelChild1(models.Model):
>> dad = models.ForeignKey(ModelDad)
>> number = models.IntegerField()
>>
>> class ModelChild2(models.Model):
>> dad = models.ForeignKey(ModelDad)
>> another_number = models.IntegerField()
>>
>> def make_proces(self):
>>  child1 = ModelChild1.objects.get(dad=self.dad)
>>  return self.another_number *child1.number
>>
>> Visit Django documentation https://docs.djangoproject.com and scroll
>> down past "First steps" to  "The model layer" and click on a link in the
>> "Quersets" line. The answers will be in there.
>>
>> >
>> > is posible
>> >
>> >
>> >
>> > --
>> > att.
>> > Carlos Rocha
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an email to django-users+unsubscr...@googlegroups.com
>> > .
>> > To post to this group, send email to django-users@googlegroups.com
>> > .
>> > Visit this group at https://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/CAM-7rO125r3pox%3D137GOfmjnmFaf3cekaNj-j%2B9A0Cwc%3DEM0Fg%40mail.gmail.com
>> > <
>> https://groups.google.com/d/msgid/django-users/CAM-7rO125r3pox%3D137GOfmjnmFaf3cekaNj-j%2B9A0Cwc%3DEM0Fg%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/522c40aa-2736-3f57-b23b-9c283c9a59e0%40dewhirst.com.au
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Naveen Kumar  Reddy
>
> --
> 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%2BC2Q82%2Bp47A92koj2%3Djq4aOvFetD%2BEuSikSCSbofTeSxWz-8Q%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 us

Re: regarding django hosting

2019-01-25 Thread Anirudh Jain
AWS EC2 is good with nginx and gunicorn

On Sat, 26 Jan 2019, 13:04 tribhuvan kishor 
> can you guys please help which is best hosting solution for django
> --
> regards
> Tribhuvan Kishor Bhaskar
>
> --
> 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/CACiphSWHbayZp1sFM3i%3DayNV9nqB4v0UuO6ZojQvxDa-9eQa4A%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/CAC3mK7ffrtjH_eGFepRev5fE5hq7f631R1ieOyWrm%3DJyQ8UdXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Logging of full trace with Debug set to False

2019-01-28 Thread Anirudh Jain
You  can setup a logging and debugging logging system using gunicorn in
production using flags :-

--log-level debug
--access-logfile /home/ubuntu/websitelogs.log

For more setting options read gunicorn documentation

https://docs.gunicorn.org/en/stable/settings.html#logging

On Mon, 28 Jan 2019, 16:50 Michal Petrucha  -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
>
> On Mon, Jan 28, 2019 at 02:53:55AM -0800, Kevin Olbrich wrote:
> > Hi!
> >
> > I would like to catch and send all exceptions to a logging system.
> > When Debug is set to False, all debug related information is lost (just
> a
> > HTTP 500 error message).
> >
> > While Debug False works perfectly in production, I would like to log and
> > send the exceptions to a backend, where I can save them.
> > This would allow me to fix bugs, that only occur once every month
> (because
> > nobody is able to reproduce).
> >
> > Similar approach was the case with Testflight on iOS, where I got a
> message
> > for every App-crash.
> >
> > How can I handle this?
> >
> > Kind regards
> > Kevin
>
> Hi Kevin,
>
> You can set up your backend logging to send logs to Sentry [1], for
> example. You can either set up your own Sentry instance, or use the
> commercial offering [2]. If you set up sentry as one of the default
> logging handlers, it will catch all unhandled exceptions, and you'll
> get a fancy stack trace for each, including the values of local
> variables in each stack frame.
>
> Cheers,
>
> Michal
>
>
> [1]: https://github.com/getsentry/sentry
> [2]: https://sentry.io/
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1
>
> iQIcBAEBCgAGBQJcTuVkAAoJEHA7T/IPM/kl5skQAOVvT+gu33Cn9YuM5152LaN/
> hO8jQ5qC85k62+Z+3ptx8xsLOSPpbivdrAWOEW2asgRUFpSzdvsvDpF5ARWUlO9D
> 3s7bTfNqnPATDjEdiBep4ZQd5eWtkw7aMhHOS6gnwl60zEqlH62MIqOj9NFRL5YV
> MMsCTAnqcB2IqXsiGmpxUvc5c20WHac4ODwOkOBAY4CPd1O6s1bf44LtD2bTaJTR
> py7KvwKJ+4wkhM89cjnP5etIhdsnPbv+hKry40rji/J/k8VAz2w702jnRc5W6a8d
> mPlBYfdZS/tfnNDx+TO+fKgwny1xrrE55vXabVgyt3nQF+KQluf2Zw2Q4HzDhhZ+
> 6L0QU2xR+EzFHsXCdhUAVF9+0h6guJzNQ7qsSz9KlZoGB5a2Jdk8Q4ji/RBVaORx
> GEZpRw/VWTn7/mLvCdOxOH8J/IMf9avyEm+CK8K23BMFqO7ydmtUIboN/MVQ1UJA
> 4Xjp3vm1zB5hcaS9AjAJ5/vn9ySPjE9deoBxqUuN7I30Vug/EqqDhBhqOCiiwp4p
> V6OwPMqhhZig3cvmigvwhZoT+WXUQwrGAGodleBon8ajIUcB1dxyxbPnbeIzSKPg
> 9lNot8WLlQEwYN7HWVQRMTc0NtLRg4YTI7UZWcwAneznxrCwKyzdQV3PhiN5A1Kh
> VRcuK/Cf70seqQEarfXL
> =HFoa
> -END PGP SIGNATURE-
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20190128112004.GD10973%40konk.org
> .
> 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/CAC3mK7c9q%3D%2BZSF9AHGjKFnKtTBgCAswEV%2Bkdja8XQXqDV7pQYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django send_mail

2019-03-27 Thread Anirudh Jain
Instead of creating a word file, create a HTML template for it if you want
the links of your social media accounts to work. Otherwise jusy save this
file in static/images folder and load it in a template. Either way you will
have to create a template.

On Wed, 27 Mar 2019, 13:08 Aayush Bhattarai, 
wrote:

> [image: isjs.PNG]
> How to send this form in django send_mail. Thanks For Your 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/2701bc34-cd91-4e24-8be9-b17bfab31f5f%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/CAC3mK7fvJQ3vCs%3DpBHN6Qe4m7CD6%2B_TM%2BU9kw1qk7QWFa0tH8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installation Question

2019-03-29 Thread Anirudh Jain
that's because you want to use python 3.7 but by default it is using python
2.7

Try this to install virutal env: pip install -p python3 virtualenv

On Fri, 29 Mar 2019, 13:15 Michael Achterberg, 
wrote:

> When I run
>
> Pip install virtualenv
>
> I still get the SyntaxError: invalid syntax
>
>
> Regards,
>
> Michael Achterberg
> E-mail: mich...@achterberg.org.za
>
>
>  Original message 
> From: KONE GOMPOU LOUA ALASSANE 
> Date: 28/03/2019 18:57 (GMT+02:00)
> To: django-users@googlegroups.com
> Subject: Re: Installation Question
>
> You must install  virtualenv first,
>
> Le jeu. 28 mars 2019 16:55, Sandip Nath  a écrit :
>
>> Definitely will help you with your installation. But first reply to the
>> questions. Because the remedy will depend on your reply.
>>
>> On Thursday, 28 March 2019 22:02:08 UTC+5:30, michael wrote:
>>>
>>> I've installed Python 3.7 which comes with pip installed. When I try to
>>> create a virtualenv I get a SyntaxError: invalid syntax
>>>
>>> What am I doing wrong?
>>>
>>>
>>> Regards,
>>>
>>> Michael Achterberg
>>> E-mail: mic...@achterberg.org.za
>>>
>> --
>> 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/2e63c3dc-283b-4498-9e49-d44f75f871ee%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/CANoHCssQpRLwV6GorXjzrzLFxHDGTUWr%3DAnyEcmAAX%3DLCPVibQ%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/ylww5dfn1ahytvwqxbubq5m4.1553845277711%40email.android.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/CAC3mK7eeGB3Xeqn5yPVRRSz7x52eX9XcEWKBX-0tc%2BZoyeydBw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading Django from 1.11 to 2.2

2019-03-29 Thread Anirudh Jain
First use 'pip freeze' in your virtual env to see all the packages
installed. Then checkout their official, latest documentation to see
whether they support django2.1 or not.

 Even if all them do, you might need to make a lot of changes in your code
after upgrade.

And no, you dont need to install django2 install django2.1.

If you have checked libraries and are sure to upgrade then first uninstall
prev version using 'pip uninstall django' and install the latest
stable version by sinply using 'pip install django'

On Fri, 29 Mar 2019, 14:22 אורי,  wrote:

> Hi,
>
> I want to upgrade Django from 1.11 to 2.2. Do I have to upgrade first to
> 2.0 and then to 2.1, or can I upgrade directly from 1.11 to 2.2?
>
> By the way, we use many third-party packages and I'm not sure which
> version of Django they support. Maybe not all of them already support
> Django 2.2.
>
> Thanks!
> אורי
> u...@speedy.net
>
> --
> 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/CABD5YeGDTteqPxsxq6rTQ4D8rLX%3D2nER61gBXMueSM088HWuoA%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/CAC3mK7feiC0SQ7PNJJHqNbs13f_2pHeyBnGUXFYLrMV%3DCt8XoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I need help on adding a search button to an input field

2019-04-03 Thread Anirudh Jain
You can include the following code in the end

ButtonHolder(
Submit('submit', 'Update', css_class='btn btn-theme small')
)

Take care of proper indentation.

On Wed, 3 Apr 2019, 23:48 Nanjuki Saidat,  wrote:

> Hi everyone,
> I want to add a search button to an input search field , if there is
> anyone who knows
> how to add a button to the field in crispy form's input field. Please help
> me out
>
>
> https://pagure.io/fedora-commops/fedora-happiness-packets/issue/raw/files/a8846b7d72aced5bdc0a2470dc97a495fb7558d6a0908a04b369260e862d-Screenshot_2019-03-20_Open-source_Happiness_Packets.png
>
> --
> 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/CAHrBrjDW%2Bn-oHwdiYRpw%3DdS8HA%2BAH%2Bne3_kjmxz-UHYqPhX9ow%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/CAC3mK7fBWiFTXEqeDHPfiExZ39DexHK90OBQ6mmsrSpfD2CCVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django URLs

2019-04-28 Thread Anirudh Jain
What is the function 'detail' ? You need to assign 'slug' variable also in
order to pass it to the url.

On Sun, 28 Apr 2019, 13:50 Aayush Bhattarai, 
wrote:

> Hello Everyone,
>
> I want to pass two url in url of template. I have added in urls.py also.
>
> code:-
> Index.html
> *http://detail.id> %}"
> target="_blank">*
> *In Up I want to pass slug. What Should I do.*
>
> *urls.py:*
>
> *path("detail//"),*
>
> *Thanks For 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/e9ecfa89-1175-405a-b3d4-f3808b7f2b0f%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/CAC3mK7fhj3e_LcuLwhm7Eu-qDVBWXeZNuFmqwBu15sdGpMrx-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static files won't match the path given

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

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

> I apologise, I'm a hardware engineer, I'm not very familiar with coding;
> I'm only on Django for the past 5 months. (under my boss order)
>
> I had managed to develop and establish a Django App, and manage to upload
> it to remote server *NameCheap*. There on the server, the issue is unable
> to locate the static files. Even when we directed the path to static files
> folder.
>
> This static files, infrequently work and load the static, that's how we
> concluded the static error was caused by the misdirection of the path.
>
> But reading over the Django documentary multiple time didn't help resolve
>
> Please help our team had been trying resolve this issue for past 2months
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e2f33470-0ad3-4387-9fbe-cd20b40eee82%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: django manage.py will not work

2019-05-15 Thread Anirudh Jain
You are probably not using virtual environment. Send snapshot of the error
would help clarifying though.

On Wed, 15 May 2019, 18:01 Emmanuel Simeon,  wrote:

> Are you having Multiple Version of Python Installed on Your System
>
>
> On Wednesday, May 15, 2019 at 1:23:13 PM UTC+1, Ishant Agrawal wrote:
>>
>> manage.py will not work how we handle this issue
>>
> --
> 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/dc4a142d-c4fd-4667-8f29-153a3268%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/CAC3mK7eUOaDh8o%2Bct6z48kJSD%3DvDUQcrCNwxPBTp7fWy24p4LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: data not coming into html

2019-05-22 Thread Anirudh Jain
Can you tell which function in which app you are using to show data in
which template ?

On Wed, 22 May 2019, 18:56 Soumen Khatua,  wrote:

> Hi Folks,
> Guys I'm not getting my data into html after rendered that still I'm not
> getting my data,i'm sharing my github link:
> https://github.com/Herosoumen/clothproject.Please go through this
> link.Please guys help me it's urgent.
>
>
> Thank You
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZ-ESxGfTZwiSBUf7ZSiDF3g0jzSNqUX3N4NowKA3%3DGTg%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/CAC3mK7dv0yZwX6-RjfRwkpTAF0j5%2Bxq-L1O8NcCFLj1pY-uQjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: data not coming into html

2019-05-22 Thread Anirudh Jain
Why is your shop templates folder outside the shop app folder? You dont
even have any static files folder, niether in shop app nor in cart app. May
be you could manage it first. BTW are you new to django? (just asking)

On Wed, 22 May 2019, 19:03 Soumen Khatua,  wrote:

> *cart.py*
>
> class Cart(object):
> def __init__(self,request):
> self.session = request.session
> cart = self.session.get(settings.CART_SESSION_ID)
> if not cart:
> # save an empty cart in the session
>cart = self.session[settings.CART_SESSION_ID] = {}
> self.cart = cart
>
> def add(self,product,quantity = 1,update_quantity = False):
> '''
> Add a product to the cart or update its quantity
>
> '''
> product_id = str(product.id)
> print(product_id)
> if product_id not in self.cart:
> self.cart[product_id] = {'quantity':0,'price':str(product.price)}
>
> if update_quantity:
> self.cart[product_id]['quantity'] = quantity
>
>
> else:
> self.cart[product_id]['quantity']+=quantity
>
> self.save()
>
> def save(self):
> #mark the session as "modidied" to make sure it gets saved
> self.session.modified = True
>
> def remove(self, product):
> '''
>   remove a product from the cart
> '''
> product_id = str(product.id)
>
> if product_id in self.cart:
> del self.cart[product_id]
> self.save()
>
>
> def __iter__(self):
> '''
> Iterate over the items in the cart and get the products from the database
>
> '''
> product_ids = self.cart.keys()
> # get the product objects and add them to the cart
> products = Product.objects.filter(id__in=product_ids)
> cart = self.cart.copy()
> for product in products:
> cart[str(product.id)]['product'] = product
>
> for item in cart.values():
> item['price'] = Decimal(item['price'])
> item['total_price'] = item['price'] * item['quantity']
> yield item
>
> def __len__(self):
> """
> count all the items in the cart
> """
> return sum(item['quantity'] for item in self.cart.values())
>
> def get_total_price(self):
> return sum(Decimal(item['price']) * item['quantity'] for item in
> self.cart.values())
>
> def clear(self):
> #remove cart from session
> del self.session[settings.CART_SESSION_ID]
> self.save()
>
>
> *views.py(cart)*
> @require_POST
> def cart_add(request,product_id):
> cart = Cart(request)
> product = get_object_or_404(Product,id  = product_id)
> form = forms.CartAddProductForm(request.POST)
> if form.is_valid():
> cd  = form.cleaned_data
> cart.add(product = product,quantity = cd['quantity'],update_quantity =
> cd['update'])
> return redirect('cart_detail')
>
>
> def cart_remove(request,product_id):
> cart = Cart(request)
> product = get_object_or_404(Product,id = product_id)
> cart.remove(product)
> return redirect('cart_detail')
>
>
>
> def cart_detail(request):
> cart = Cart(request)
> for item in cart:
> * print(item)*
> for item in cart:
> item['update_quantity_form'] = forms.CartAddProductForm(
>initial =
> {'quantity':item['quantity'],
>   'update' : True}
>
>   )
>
> return render (request,'cart/cartdetail.html',{'cart':cart})
>
> here len of item is 0
>
>
>
> On Wed, May 22, 2019 at 6:58 PM Anirudh Jain 
> wrote:
>
>> Can you tell which function in which app you are using to show data in
>> which template ?
>>
>> On Wed, 22 May 2019, 18:56 Soumen Khatua, 
>> wrote:
>>
>>> Hi Folks,
>>> Guys I'm not getting my data into html after rendered that still I'm not
>>> getting my data,i'm sharing my github link:
>>> https://github.com/Herosoumen/clothproject.Please go through this
>>> link.Please guys help me it's urgent.
>>>
>>>
>>> Thank You
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view thi

Re: Display image in template

2019-05-28 Thread Anirudh Jain
You will have to setup MEDIA path f8rst. All your uploded files will be
stored in that folder. STATIC path is used only for, well, static content
like css and js.

On Tue, 28 May 2019, 23:31 anchal agarwal, 
wrote:

> I want to display image dynamically from the database in a django
> template. I have used ImageField for this purpose. The code shows no error
> but it is only displaying an icon of image.
> This is my template file,
> here album is the context and album_logo is the variable in which i have
> stored my image. please tell me how can i fix this issue
> 
>
> {{ album.album_title}}
> {{ album.artist }}
>
> 
> {% for song in album.song_set.all %}
> {{song.song_title}}-{{song.file_type}}
> {% endfor %}
> 
>
> --
> 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/CAMT%3DisWxuO9d1tTMacyYauDAmQS%2B2e_B9HawfZP7eY8smCS%3D2Q%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/CAC3mK7fGps2XR1S7V%2B4WvU-%2Boma-eoUTrtDjEwVJe2QtCTL_Xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: problem with form

2019-05-28 Thread Anirudh Jain
Can you please send the screenshot or text of error. Also, try -
form.save(commit=False)

On Wed, 29 May 2019, 04:53 Saeed Pooladzadeh,  wrote:

> Hi
>
> I'm trying to make a simple crud applicatio and learn from it. I wonder
> why my form can't save the data. Here cames my view:
>
> from django.shortcuts import render
> from saeed.forms import SmodelForm
> from saeed.models import Smodel
> from django.shortcuts import render, redirect
>
>
>
> # Create your views here.
> def emp(request):
> if request.method == "POST":
> form = SmodelForm(request.POST)
> if form.is_valid():
> try:
> form.save()
> return redirect('/show')
> except  AssertionError as error:
>
> print(error)
> pass
>
>
>
>
>
> else:
> form = SmodelForm()
> return render(request,'saeed/index.html',{'form':form})
> #
> def show(request):
> smodels = Smodel.objects.all()
> return render(request,'saeed/show.html',{'smodels':smodels})
> #
>
> def edit(request, id):
> smodels = Smodel.objects.get(id=id)
> return render(request,'saeed/edit.html', {'smodels':smodels})
> #---
>
> def update(request, id):
> smodels = Smodel.objects.get(id=id)
> form = SmodelForm(request.POST, instance = smodels)
> if form.is_valid():
> form.save()
> return redirect("/show")
> return render(request,'saeed/edit.html',{'smodels':smodels})
>
> #-
> def destroy(request, id):
> smodels = Smodel.objects.get(id=id)
> smodels.delete()
> return redirect("/show")
>
>
> and here cames the complete app:
>
>
> https://ln.sync.com/dl/1bf7658d0/pw69mf37-yk85kjaa-qprd4xdx-m8em4rxk
>
> can you please inform me where is wrong?
>
> thanks
>
> 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/83aa34e2-2da1-432d-94ba-ec0beea90608%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/CAC3mK7fp6Nwj%3DBOk9psELGEKDbYPr2oNHhPe5ohLDSrEvAcWJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where to find my web app within mysite directory ?

2019-05-28 Thread Anirudh Jain
If the command you had run did not show any error, then it should be in the
same folder as that of manage.py

On Wed, 29 May 2019, 01:16 Joseph Jones,  wrote:

>
>
> Hello fellow community members,
>>
>> I’m working on a Django project using PyCharm on my pc. I’ve run command
>> ‘>py manage.py startapp hypotheticalapp’.
>> To ensure my app does in fact exist However if I enter into my mysite
>> directory on file explorer the ‘hypotheticalapp’ file is nowhere to be
>> found any advice on what error I am making and how to correct it would be
>> appreciated. Thank you,
>>
>> Joseph
>>
> --
> 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/CAJGsC5McHOD8EdsbT2%3Df2ZkqvZiriOoZvbRy64B%3DpAOMh8Z%3Dtw%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/CAC3mK7evRNfwLQa-2RYQWE0H6mE4nU4LKw8Bb-y-7Fy0DDRK_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error is MultiValueDictKeyError at /login

2019-06-05 Thread Anirudh Jain
In login function, could you try password =request.POST['password1']

You have used ['password']

On Wed, 5 Jun 2019, 17:22 sahukara harish, 
wrote:

> Hi, to all can any one help me to rectify this error
>
> --
> 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/CAJTXQ2OAq6GuXQDfiqwRELc26p1nWaPP%2Bvqv9j7T35JJH2DcgQ%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/CAC3mK7fnb2Mi4kpccffwWPR3ThuQUxJ9iHUxrZxP0kLw_sZo8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

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

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

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

> I am trying to create a form which asks user to input a value, do some
> calculations on it and show the results back to the user. Here is what I've
> done: I have created an app called QMarcum. Inside this app I have this
> views.py, forms.py and urls.py:
>
> views.py
>
> from django.shortcuts import render
> from scipy.integrate import quad
> import scipy, numpy, math
> from scipy import integrate
> from django.http import HttpResponse
> from .forms import Calculate
>
> def integrand(x):
> Q_y = (1/(math.sqrt(2*math.pi)))*math.exp((-x**2)/2)
> return Q_y
> y = Calculate.y
> ans, err = quad(integrand, float(y), math.inf)
> print(ans)
> return render(request, 'test.html', {'form': Q_y})
> forms.py
>
> from django import forms
>
> class Calculate(forms.Form):
> y = forms.FloatField()
> urls.py
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('form', views.integrand),
> ]
> form.html
>
> 
> 
> 
> 
> Title
> 
> 
> 
> {% csrf_token %}
> {{ form }}
> Submit
> 
> 
> 
> The form asks user to input a value (y) (y is printed on terminal
> successfully), however, print(ans) doesn't print the value AND also I don't
> know how to show the calculated result (ans) to user.
>
> Thanks in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b77e2ebd-a440-4eb5-bd9d-a6635edd56a8%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Digital Ocean server Error

2019-06-17 Thread Anirudh Jain
could you run `journalctl -xe` tell us more about the log result

On Mon, 17 Jun 2019, 17:08 Soumen Khatua,  wrote:

> Hi Folks,
>
> I uploaded my project into digital ocean but at the time of run 
> this*(sai@sai-foundation:~/saiproject$
> sudo systemctl status gunicorn) *command,I'm getting this error:
>
>
>
>
>
>
>
>
>
> *● gunicorn.service - gunicorn daemon   Loaded: loaded
> (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
>  Active: failed (Result: exit-code) since Mon 2019-06-17 11:34:09 UTC; 14s
> ago Main PID: 1174 (code=exited, status=200/CHDIR)Jun 17 11:34:09
> sai-foundation systemd[1]: Started gunicorn daemon.Jun 17 11:34:09
> sai-foundation systemd[1]: gunicorn.service: Main process exited,
> code=exited, status=200/CHDIRJun 17 11:34:09 sai-foundation systemd[1]:
> gunicorn.service: Unit entered failed state.Jun 17 11:34:09 sai-foundation
> systemd[1]: gunicorn.service: Failed with result 'exit-code'*.
>
> Please help me guys for this problem.
>
>
> Thank You.
>
>
>
>
> regards,
> Soumen
>
> --
> 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/CAPUw6WZBuRhK6QR4xZuNpYQrHARuoM0TWiBpTqGNnN0RJdsPXA%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/CAC3mK7cKKB0YpTCV0UeDRmcTo5tqfaj4jr_upP35_vjBLGjzeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CSRF verification failed when I use smart phone

2019-06-26 Thread Anirudh Jain
Are you using it as a website or mobile app? If it is website then try
logging out and login again. You might have logged in as another user or it
might be a caching problem.

On Wed, 26 Jun 2019, 08:31 Aldian Fazrihady,  wrote:

> Please make sure csrftoken cookie is returned to the Android app
>
> Regards,
>
> Aldian Fazrihady
>
> On Wed, 26 Jun 2019, 09:46 Robert F.,  wrote:
>
>> Make sure you aren't blocking cookies on whatever device is giving you
>> problems.  You'll get this error if you are blocking them.
>>
>> On Tuesday, January 6, 2015 at 1:09:46 AM UTC-8, Sugita Shinsuke wrote:
>>>
>>> Hello.
>>>
>>> When I use Django via my smart phone Android and iOS.
>>> The error sometimes occurred.
>>>
>>> Forbidden (403)
>>> CSRF verification failed. Request aborted.
>>> Help
>>> Reason given for failure:
>>> CSRF token missing or incorrect.
>>>
>>> In general, this can occur when there is a genuine Cross Site Request
>>> Forgery, or when Django's CSRF mechanism has not been used correctly. For
>>> POST forms, you need to ensure:
>>> Your browser is accepting cookies.
>>> The view function uses RequestContext for the template, instead of
>>> Context.
>>> In the template, there is a {% csrf_token %} template tag inside each
>>> POST form that targets an internal URL.
>>> If you are not using CsrfViewMiddleware, then you must use csrf_protect
>>> on any views that use the csrf_token template tag, as well as those that
>>> accept the POST data.
>>> You're seeing the help section of this page because you have DEBUG =
>>> True in your Django settings file. Change that to False, and only the
>>> initial error message will be displayed.
>>> You can customize this page using the CSRF_FAILURE_VIEW setting.
>>>
>>> I append django.middleware.csrf.CsrfViewMiddleware', of
>>> MIDDLEWARE_CLASSES in settings.py
>>>
>>> I use
>>> Python 2.7.5
>>> Django 1.6.4
>>>
>>> Anyone who know this matter, 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/cb4f6aba-85e6-4105-9fe4-b3cbcddca727%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/CAN7EoAaW4%2BnBcppcvPWwxTO9EGHV2UjpM3-TChkZv2Cjp5uqow%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/CAC3mK7eRV9baLYHzw2RvMZPv0MWW5wZ_nONdTM6SjKaQEyajBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploy django on AWS

2019-06-30 Thread Anirudh Jain
You can use ubuntu+nginx+gunicorn. There are some blogs on digital ocean
regarding deployment. After you launch an ec2 instance on aws and connect
to it via ssh from terminal, it won't matter whether you are using aws or
digital ocean.

On Sun, 30 Jun 2019, 22:07 Harshit Agarwal, 
wrote:

> Hello Django users,
> I want to host my django website on aws, This is first time that i am
> hosting a website. Can u suggest any good resource from which i can learn?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAE%2BC-X_ROpNGnGGQKt7VDE3Bb%2BL1O8q2GAY91JWfgdwA7kKZFQ%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/CAC3mK7e_yHXZqd%2BGe6%2B6O1G2yA3hGDfUbywGag7Zw-Tx_3RuAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't access my django runserver

2018-06-30 Thread Anirudh Jain
You forgot to put 'comma' after DIRS': [os.path.join(BASE_DIR,
'templates')] in templates.

It should be DIRS': [os.path.join(BASE_DIR, 'templates')],

On Sat 30 Jun, 2018, 15:52 Umar Kambala,  wrote:

>
> this are my codes...
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
> ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']
> ALLOWED_HOSTS = ['localhost', '.pythonanywhere.com']
>
>
> # Application definition
>
> INSTALLED_APPS = [
> 'polls.apps.PollsConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> ]
>
> MIDDLEWARE = [
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> ]
>
> ROOT_URLCONF = 'mysite.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')]
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
> WSGI_APPLICATION = 'mysite.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/2.0/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> }
> }
>
>
> # Password validation
> #
> https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME':
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.CommonPasswordValidator',
> },
> {
> 'NAME':
> 'django.contrib.auth.password_validation.NumericPasswordValidator',
> },
> ]
>
>
> # Internationalization
> # https://docs.djangoproject.com/en/2.0/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'GMT'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/2.0/howto/static-files/
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR, 'STATIC')
> MASSAGE_STORAGE = 'django.contrib.message.storage.session.SessionStorage'
>
>
> this what i get when i run python manage.py runserver
> line 371, in execute_from_command_line
> utility.execute()
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py",
> line 317, in execute
> settings.INSTALLED_APPS
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 56, in __getattr__
> self._setup(name)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 43, in _setup
> self._wrapped = Settings(settings_module)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\conf\__init__.py",
> line 106, in __init__
> mod = importlib.import_module(self.SETTINGS_MODULE)
>   File
> "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
>   File "", line 994, in _gcd_import
>   File "", line 971, in _find_and_load
>   File "", line 955, in
> _find_and_load_unlocked
>   File "", line 665, in _load_unlocked
>   File "", line 674, in exec_module
>   File "", line 781, in get_code
>   File "", line 741, in
> source_to_code
>   File "", line 219, in
> _call_with_frames_removed
>   File "C:\Users\Admin\Desktop\Djan Polls\mysite\mysite\settings.py", line
> 60
> 'APP_DIRS': True,
>  ^
> SyntaxError: invalid syntax
>
> On Fri, Jun 29, 2018 at 6:00 AM, Mikhailo Keda  wrote:
>
>> show your code
>>
>> --
>> 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://grou

Re: Can't access my django runserver

2018-07-01 Thread Anirudh Jain
Can you please show your directory structure ? Just take the screenshot of your 
project tree from code editor and that would be enough.

-- 
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/4648f889-3697-4a2a-a317-e31fd0214e59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Running a django website on AWS EC2 on ubuntu

2018-07-02 Thread Anirudh Jain
I am getting the following error on running the command :-

"sudo journalctl -u gunicorn"

Error is :-

Jul 02 20:05:35 ip-172-31-40-226 systemd[1]: Started gunicorn daemon.
Jul 02 20:05:35 ip-172-31-40-226 systemd[1]: gunicorn.service: Main process 
exited, code=exited, status=200/CHDIR
Jul 02 20:05:35 ip-172-31-40-226 systemd[1]: gunicorn.service: Unit entered 
failed state.
Jul 02 20:05:35 ip-172-31-40-226 systemd[1]: gunicorn.service: Failed with 
result 'exit-code'.
Jul 02 20:44:45 ip-172-31-40-226 systemd[1]: Started gunicorn daemon.
Jul 02 20:44:45 ip-172-31-40-226 systemd[1]: gunicorn.service: Main process 
exited, code=exited, status=203/EXEC
Jul 02 20:44:45 ip-172-31-40-226 systemd[1]: gunicorn.service: Unit entered 
failed state.
Jul 02 20:44:45 ip-172-31-40-226 systemd[1]: gunicorn.service: Failed with 
result 'exit-code'.


before running this command, I had saved the file gunicorn.service and run 
the following commands :-

sudo systemctl daemon-reload sudo systemctl start gunicorn sudo systemctl 
enable gunicorn

Command "sudo systemctl status gunicorn" also gave the eror as :-

gunicorn.service - gunicorn daemon
   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor 
preset: enabled)
   Active: failed (Result: exit-code) since Mon 2018-07-02 23:09:49 UTC; 
16s ago
 Main PID: 3671 (code=exited, status=203/EXEC)

Jul 02 23:09:49 ip-172-31-40-226 systemd[1]: Started gunicorn daemon.
Jul 02 23:09:49 ip-172-31-40-226 systemd[1]: gunicorn.service: Main process 
exited, code=exited, status=203/EXEC
Jul 02 23:09:49 ip-172-31-40-226 systemd[1]: gunicorn.service: Unit entered 
failed state.
Jul 02 23:09:49 ip-172-31-40-226 systemd[1]: gunicorn.service: Failed with 
result 'exit-code'.


Can anyone please tell me what is exactly the error and how to resolve it?

Thank you.

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


Re: '$' is not recongnized

2018-08-16 Thread Anirudh Jain
while copy pasting the command, you must have copied '$' as well and pasted
it in the terminal. Remove $ from the begining and try again. I am sure it
would work.

On Fri, 17 Aug 2018, 01:33 Brandon Hernandez, 
wrote:

> Im trying to follow the tutorial for django, but i cant figure out how to
> make my cmd recognize '$' .
>
> --
> 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/cc05d2ae-5f7b-426b-b637-85faca69f276%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/CAC3mK7cgsEQYPof0tofOZe%3DcAMm-B1xg_eZWG1UVaGjjthY1Uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django database problem

2018-08-17 Thread Anirudh Jain
You will have to create a database on your system first (it is better to
use mysql instead of sqlite) and then run commands :-

1. python manage.py makemigrations
2. python manage.py migrate

Also you will have to create forms (forms.ModelForm or forms.Forms) for
taking input.

On Fri, 17 Aug 2018, 21:26 Mikko Meronen, 
wrote:

> Hi,
>
> I'm quite new with django and python and I wish someone could help me.
>
> I'm building a webpage where my python program/bot collects data from
> webpages.
>
> Is there a way that I can use my python program to store the data to
> django's database?
>
> At the moment when I run my program, I collect the data to separate sqlite
> database, but I don't know how to collect/connect it to django's sqlite
> database (or models).
>
> - Mikko
>
> --
> 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/CAGD0jjLbzK1XVVSUTD4Z66p_RUoK0pBW%2BrEYtVM_HwAd9d%3DwvQ%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/CAC3mK7dgX__66cbM53OZF%3DSYCHfVQRTe9ghDWWD_4h5cesOgCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Can anyone please help me solve this question?

2018-08-29 Thread Anirudh Jain
Here is the question that I posted earlier yesterday and it is still 
unsolved

https://stackoverflow.com/questions/52054246/how-to-add-a-foreign-key-from-multiple-options-available-in-model-for-that-key-i

It is very urgent for me to solve this question and this is the last part 
where I am stuck while building a product. Please help me solve the 
question.

-- 
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/631e032c-108e-4034-8a65-a8bb403c18c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-02 Thread Anirudh Jain
Use django allauth library. It's great.

On Thu, 1 Nov 2018, 17:39 Ryan Shepard  How could i go about allowing people to also use their email to sign into
> Django instead of a username? I have done research my self and tried
> creating my own backend for it. But it doesn't 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/d6046362-5149-4edf-adc8-273547213748%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/CAC3mK7cS9%2BEi4VwZyBgeqiLqAuzTwGXTpTvykvXAN-SrsPxq5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Use Email to Login With Django Auth

2018-11-02 Thread Anirudh Jain
Hey William

Is it you who runs the website wsvincent.com ? Great stuff you have out
there. Keep working man !!

On Fri, 2 Nov 2018, 19:08 William Vincent  As others have noted, the short answer is use django-allauth. Here's a
> basic implementation that might help: https://github.com/wsvincent/djangox
> .
>
> On Thursday, November 1, 2018 at 8:09:13 AM UTC-4, Ryan Shepard wrote:
>>
>> How could i go about allowing people to also use their email to sign into
>> Django instead of a username? I have done research my self and tried
>> creating my own backend for it. But it doesn't 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/f724e526-b6e1-4798-b3f1-637a08094945%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/CAC3mK7dGe9qsPJjEzsXGkPCX8N-_MZcNvFmymk0xmYpKSfq44g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Who use django-allauth!

2018-12-04 Thread Anirudh Jain
Where do you want to redirect them? Where exactly is the problem?

On Tue, 4 Dec 2018, 17:53  I can't authorize users at my project. If I'm going to login with
> http://127.0.0.1:8000/account/login I'm redirecting to index page.
>
> --
> 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/0ec4eb58-6a33-43da-9b7a-059b69a71334%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/CAC3mK7fp5SV7X150-ceTUBS6YNy-xP%2B30TWBsnzQ7YYXs6woPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 127.0.0.1 refused to connect.

2020-12-21 Thread Anirudh Jain
Please send picture of your cmd/terminal where you are running the
localserver

On Fri, 18 Dec 2020, 21:59 Parul.,  wrote:

> i am not able to connect , i tried to use 0.0.0.0:8000 , 0.0.0.0:8080 as
> well, still getting same error.
> used 127.0.0.1 with ports 8000 and 8080 still getting error
> i have put '*' in ALLOWED_HOSTS
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b6e49e34-46f1-4c5f-9829-358b3323d381n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7d6-Zyop2q09MjKB1G9KE_oN2%3DKpr0jKafmLFHdqni9Ww%40mail.gmail.com.


Re: hldp on my api

2020-12-21 Thread Anirudh Jain
Include JSONParser also

On Sun, 20 Dec 2020, 12:35 Desh Deepak,  wrote:

> You have missed adding the Content-Type header in the headers section.
> Just set the Content-Type header to application/json and it should work.
>
> On Sun, 20 Dec 2020, 1:37 am ola neat,  wrote:
>
>> halo guys, i'm working api that requires user to upload image and send
>> text as form input on the same endpoint, i've done all is needed but i've
>> been faced wit an err, hoping anyone can help out,
>> attached below is my code(serializer views) and d  err msg
>> hoping anyone can 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAHLKn70xJbnK0zXE9rc_Q5q8UYhp6xHCvjz3Gv7vTX5Y2-D_gQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ0m4xjo9-UXNpi%2Bmzs0Y_jHhg_t-DbYMWqPFRwa83Rb9im0LA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7eoSkVLMmnOk00W7O40G5EhMDTdKtG99Js_dpfCYQj-wQ%40mail.gmail.com.


Re: Please help me in views.py

2019-09-03 Thread Anirudh Jain
Could you please elaborate/be more clear about what you are really trying
to do ?

On Wed, 4 Sep 2019, 10:26 Bhoopesh sisoudiya,  wrote:

> Hi Amit,
>
> You can use
> =≠=
> Book.objects.select_related(FK).select_related(FK). values (select column
> name which you want).all()
>
>
> Thanks
> Bhoopesh sisoudiya
>
> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta  wrote:
>
>> Hi,
>>
>> I need help i am not understanding the keywords of joining and fetch
>> value in veiw.py
>> i have three tables in model.py
>>
>> Table 1(Author) :
>>
>> Table 2(books):
>>
>> Table 3 (details):
>> FK of table1
>> FK of table2
>>
>> Fk = foreign key
>>
>> I have to just show
>>
>> Author (author name) Books (dynamic) Books(author 2nd book)
>>  ...
>> details(dynamic) details(dtl
>> of author 2nd book) ...
>>
>> I have created the template
>>
>> now in views.py i an confused
>>
>> book=books.object(i do not get what to do)
>> Author= (same )
>> details = (same)
>>
>> Please can anybody help that will be very greatfull.
>> Thank you in advance
>>
>>
>>
>> Thanks and Regards
>> Amit Samanta
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAk3c1OzGXKSQg8GK1C8_5Ck-iQ%2B1WjsYMdD%2B%2B0_q3inb94jyw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7faT1yOHZXdHXc0DyeDYRtTpD_Pke39AJYmXRQW%2BOi09Q%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Anirudh Jain
ogle 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPcVkjg11EAf-rYFvoz85Y5BLKBisD4FJQSOCzonzi0TFC91ZQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPcVkjg11EAf-rYFvoz85Y5BLKBisD4FJQSOCzonzi0TFC91ZQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
*Anirudh Jain* | *Appreciate you taking time to read the mail.*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7diFxarM6W-Tv-wT-sFZz6A46brHP%2Bjo772jKcn_qjbJQ%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Anirudh Jain
Also, I am not sure how you have written html code, so use it properly
according to your convinience.

On Wed, Sep 4, 2019 at 2:41 PM Anirudh Jain 
wrote:

> This can be done easily if you make a proper view function and render data
> from it in template properly.
> A view function can be written like this :-
>
> Here I am assuming that you want get the details of all the books/auuthors
> at one page. If you want details of a particular book, then the following
> function will be different.
>
> from .models import Details, Author, Books
> from django.shortcuts import render
>
> view.py :-
> def getdetails(request):
> template_name = 'showDetails.html'
> objs = Details.objects.all()
> context = {'objs; : objs}
> return render(request, template_name, context}
>
>
> showDetails.html :-
> (use this block in your html code wherever you want to show this data)
>
> {% if objs %}
>
> 
> 
> Author
> Book
> 
>
> {% for obj in objs %}
> 
>   {{ obj.author_name }} 
>   {{ obj.book_name }} 
> 
> {% endfor %}
> 
>
> {% endif %}
>
> (In above html code, I have assumed that author_name and book_name are the
> FK in your Details table. Also, I am not sure
>
>
> On Wed, Sep 4, 2019 at 1:34 PM Lim Kai Wey  wrote:
>
>> Hey Amit,
>>
>> I suggest you to follow this tutorial to build your project,
>>
>> https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website
>>
>> It teaches you all the basics that you need to know from scratch, which
>> in my opinion will answer all the questions you're asking.
>> The tutorial is about building a local library webpage which I believe is
>> very similar to what you are doing now.
>>
>> Hope this helps.
>>
>> Regards,
>> Kai Wey
>>
>> On Wed, Sep 4, 2019 at 3:59 PM Amit Samanta 
>> wrote:
>>
>>> now how can i get the name for author and details??
>>>
>>> On Wed, 4 Sep, 2019, 10:25 AM Bhoopesh sisoudiya, 
>>> wrote:
>>>
>>>> Hi Amit,
>>>>
>>>> You can use
>>>> =≠=
>>>> Book.objects.select_related(FK).select_related(FK). values (select
>>>> column name which you want).all()
>>>>
>>>>
>>>> Thanks
>>>> Bhoopesh sisoudiya
>>>>
>>>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I need help i am not understanding the keywords of joining and fetch
>>>>> value in veiw.py
>>>>> i have three tables in model.py
>>>>>
>>>>> Table 1(Author) :
>>>>>
>>>>> Table 2(books):
>>>>>
>>>>> Table 3 (details):
>>>>> FK of table1
>>>>> FK of table2
>>>>>
>>>>> Fk = foreign key
>>>>>
>>>>> I have to just show
>>>>>
>>>>> Author (author name) Books (dynamic) Books(author 2nd book)
>>>>>...
>>>>> details(dynamic)
>>>>>  details(dtl of author 2nd book) ...
>>>>>
>>>>> I have created the template
>>>>>
>>>>> now in views.py i an confused
>>>>>
>>>>> book=books.object(i do not get what to do)
>>>>> Author= (same )
>>>>> details = (same)
>>>>>
>>>>> Please can anybody help that will be very greatfull.
>>>>> Thank you in advance
>>>>>
>>>>>
>>>>>
>>>>> Thanks and Regards
>>>>> Amit Samanta
>>>>>
>>>>> --
>>>>> 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 view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed

Re: Please help me in views.py

2019-09-04 Thread Anirudh Jain
Then simply use {{ obj.book_name.name }} in template where again, I am
assuming 'name' is the column name you have give to book name in Books model

On Wed, Sep 4, 2019 at 3:25 PM Amit Samanta  wrote:

> You have gussed correctly..
> but i have taked book id as fk but i need the book name
>
> On Wed, 4 Sep, 2019, 2:41 PM Anirudh Jain, 
> wrote:
>
>> This can be done easily if you make a proper view function and render
>> data from it in template properly.
>> A view function can be written like this :-
>>
>> Here I am assuming that you want get the details of all the
>> books/auuthors at one page. If you want details of a particular book, then
>> the following function will be different.
>>
>> from .models import Details, Author, Books
>> from django.shortcuts import render
>>
>> view.py :-
>> def getdetails(request):
>> template_name = 'showDetails.html'
>> objs = Details.objects.all()
>> context = {'objs; : objs}
>> return render(request, template_name, context}
>>
>>
>> showDetails.html :-
>> (use this block in your html code wherever you want to show this data)
>>
>> {% if objs %}
>>
>> 
>> 
>> Author
>> Book
>> 
>>
>> {% for obj in objs %}
>> 
>>   {{ obj.author_name }} 
>>   {{ obj.book_name }} 
>> 
>> {% endfor %}
>> 
>>
>> {% endif %}
>>
>> (In above html code, I have assumed that author_name and book_name are
>> the FK in your Details table. Also, I am not sure
>>
>>
>> On Wed, Sep 4, 2019 at 1:34 PM Lim Kai Wey  wrote:
>>
>>> Hey Amit,
>>>
>>> I suggest you to follow this tutorial to build your project,
>>>
>>> https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website
>>>
>>> It teaches you all the basics that you need to know from scratch, which
>>> in my opinion will answer all the questions you're asking.
>>> The tutorial is about building a local library webpage which I believe
>>> is very similar to what you are doing now.
>>>
>>> Hope this helps.
>>>
>>> Regards,
>>> Kai Wey
>>>
>>> On Wed, Sep 4, 2019 at 3:59 PM Amit Samanta 
>>> wrote:
>>>
>>>> now how can i get the name for author and details??
>>>>
>>>> On Wed, 4 Sep, 2019, 10:25 AM Bhoopesh sisoudiya, 
>>>> wrote:
>>>>
>>>>> Hi Amit,
>>>>>
>>>>> You can use
>>>>> =≠=
>>>>> Book.objects.select_related(FK).select_related(FK). values (select
>>>>> column name which you want).all()
>>>>>
>>>>>
>>>>> Thanks
>>>>> Bhoopesh sisoudiya
>>>>>
>>>>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I need help i am not understanding the keywords of joining and fetch
>>>>>> value in veiw.py
>>>>>> i have three tables in model.py
>>>>>>
>>>>>> Table 1(Author) :
>>>>>>
>>>>>> Table 2(books):
>>>>>>
>>>>>> Table 3 (details):
>>>>>> FK of table1
>>>>>> FK of table2
>>>>>>
>>>>>> Fk = foreign key
>>>>>>
>>>>>> I have to just show
>>>>>>
>>>>>> Author (author name) Books (dynamic) Books(author 2nd book)
>>>>>>  ...
>>>>>> details(dynamic)
>>>>>>  details(dtl of author 2nd book) ...
>>>>>>
>>>>>> I have created the template
>>>>>>
>>>>>> now in views.py i an confused
>>>>>>
>>>>>> book=books.object(i do not get what to do)
>>>>>> Author= (same )
>>>>>> details = (same)
>>>>>>
>>>>>> Please can anybody help that will be very greatfull.
>>>>>> Thank you in advance
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks and Regards
>>>>>> Amit Samanta
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subsc

Re:

2019-09-18 Thread Anirudh Jain
Example: YouModelName.objects.all().order_by('created_at')


This will sort all the objects in your model on the basis of date of
creation on that object.

On Wed, 18 Sep 2019, 12:16 Shakil Ahmmed,  wrote:

>
> How to select all field but group by one field
> --
>
> 
> Shakil Ahmmed
> about.me/shakilahmmed
> 
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com.


Re:

2019-09-18 Thread Anirudh Jain
a = YouModelName.objects.all().values_list()
b= a.order_by('created_at')

On Wed, 18 Sep 2019, 17:44 Shakil Ahmmed,  wrote:

> I want to select all field in a model but Grouy By One field.. Suppose i
> have country,people , and onther field in a model i want to  group by
> country but select all field
>
> On Wed, Sep 18, 2019, 6:05 PM Anirudh Jain 
> wrote:
>
>> Example: YouModelName.objects.all().order_by('created_at')
>>
>>
>> This will sort all the objects in your model on the basis of date of
>> creation on that object.
>>
>> On Wed, 18 Sep 2019, 12:16 Shakil Ahmmed,  wrote:
>>
>>>
>>> How to select all field but group by one field
>>> --
>>>
>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>> Shakil Ahmmed
>>> about.me/shakilahmmed
>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7fJyqrvFZUU4xUe%2BDdCtWBqCUD%3DPvFbVNN2Pcv1iPb6Gw%40mail.gmail.com.


Re:

2019-09-18 Thread Anirudh Jain
Or you can use filter() instead of all()

On Wed, 18 Sep 2019, 17:46 Anirudh Jain,  wrote:

> a = YouModelName.objects.all().values_list()
> b= a.order_by('created_at')
>
> On Wed, 18 Sep 2019, 17:44 Shakil Ahmmed,  wrote:
>
>> I want to select all field in a model but Grouy By One field.. Suppose i
>> have country,people , and onther field in a model i want to  group by
>> country but select all field
>>
>> On Wed, Sep 18, 2019, 6:05 PM Anirudh Jain 
>> wrote:
>>
>>> Example: YouModelName.objects.all().order_by('created_at')
>>>
>>>
>>> This will sort all the objects in your model on the basis of date of
>>> creation on that object.
>>>
>>> On Wed, 18 Sep 2019, 12:16 Shakil Ahmmed, 
>>> wrote:
>>>
>>>>
>>>> How to select all field but group by one field
>>>> --
>>>>
>>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>> Shakil Ahmmed
>>>> about.me/shakilahmmed
>>>> <https://about.me/shakilahmmed?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
>>>>
>>>> --
>>>> 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 view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfzNPZ_vRqyHan92VsDY9MAjsxogKVh4FEBdwXWLd%3DHXtQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAC3mK7frp_NWYmtJ1mUjrC3vTr6nb1%3DcoHWQiD48f7jnHbFhzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CA%2BEpJfx8i%2BYCDD16NUn1wjDW4bsdhFgySbtHYUChCR1ArbBEBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7eQwA8jq%3D9TUrZ19rd%2BAiWAYyhPKG7F7Qg-9-RjVQckJw%40mail.gmail.com.


Re: how to rectify this error

2019-09-20 Thread Anirudh Jain
Open the DOS as administrator and then try again

On Fri, 20 Sep 2019, 21:59 idb solutions, 
wrote:

> the server isn't running.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cb8e6300-15a5-4a22-a054-117439311a86%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7c17bhBgvWdrrk-qX-Cn7imSPPnRvhgnZqYGPKC1vo23g%40mail.gmail.com.


Re: delete image url from database

2019-10-16 Thread Anirudh Jain
First of all, are you saving image url explicitly in database ? You dont
need to so that to show/delete any image.

Second, try delete() for deletint image entry.

On Wed, 16 Oct 2019, 19:54 Nuno Vieira, 
wrote:

> Hi there,
>
> i am creating a real estate app and i want users to insert and delete
> images for the houses.
>
> It's all working great except the delete.
>
> In my views.py i have the code:
>
> listing = Listing.objects.get(id=1511)
> if listing:
> listing.photo_5 = None
> listing.save(['photo_5'])
> return True
>
> photo_5 is an Imagefield and i want to change the value of that field in
> database to None.
>
> Why is not changing?
>
> Thanks for your 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f24fda94-428d-4f76-b632-4078d948fdcf%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7cO7x4LADm9Je2MusG5iqx3xxAhOeze1%3D8uqfvrU%2BjjcA%40mail.gmail.com.


Re: Can anyone sove my issue please!

2019-10-22 Thread Anirudh Jain
What is the error?

On Tue, 22 Oct 2019, 16:49 Parvez Khan Pathan, 
wrote:

> [image: pyissue2.png]
> *Even check out my views.py file*
>
> On Tuesday, 22 October 2019 16:44:37 UTC+5:30, Parvez Khan Pathan wrote:
>>
>> [image: pyissue1.png]
>> Sir Already Added! still got error!!!
>>
>> On Tuesday, 22 October 2019 16:38:34 UTC+5:30, laya Mahmoudi wrote:
>>>
>>> Hi,
>>> In your form.py , put fields:"__all__"
>>>
>>> در تاریخ سه‌شنبه ۲۲ اکتبر ۲۰۱۹،‏ ۱۴:۳۳ Parvez Khan Pathan <
>>> iamparv...@gmail.com> نوشت:
>>>

 https://stackoverflow.com/questions/58502732/exception-in-thred-django-main-thread

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/3152b194-5b13-4abb-a38a-1f1708f79bd3%40googlegroups.com
 
 .

>>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ad394df-27b8-4e68-9bc5-86a727945f37%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7dO_v3jQp8tbkzNc6D%2BoWdTPrsWjiDmFdRVoTi5d_AkZQ%40mail.gmail.com.


Re: Internship

2019-11-22 Thread Anirudh Jain
If anyone, based out of Delhi/NCR, is looking for an internship as a Django
developer, message me on telegram @i_m_root

You should have fair knowledge about graphql and its implementation in
django.

Internship will be mostly remotely, might need to meet at some weekends.

On Sat, 23 Nov 2019, 10:31 Nitin Kalmaste,  wrote:

> It looks like your server is unable to create file to inside your var/log/
> folder.
>
> What server are you using?
> Is it apache?
> Solution:
> 1. check that lockon_debug.log is file created in /var/log/ folder
> 2. If file exists then check for file permission.
> 3. Check permission for log folder if and change its permissions
> Apache uses daemon as user.
> sudo chown -R your_user:daemon /path/to/the/log/folder and sudo chmod -R
> g+w /path/to/the/log/folder
> I hope this helps.
> And let me know that I got this internship or not.
> 😁
>
> On Sat 23 Nov, 2019, 3:51 AM Josiah Umezurike, <
> pcintegral.pcintegr...@gmail.com> wrote:
>
>>  File "/usr/lib64/python3.6/logging/config.py", line 565, in configure
>> handler = self.configure_handler(handlers[name])
>>   File "/usr/lib64/python3.6/logging/config.py", line 738, in
>> configure_handler
>> result = factory(**kwargs)
>>   File "/usr/lib64/python3.6/logging/__init__.py", line 1032, in __init__
>> StreamHandler.__init__(self, self._open())
>>   File "/usr/lib64/python3.6/logging/__init__.py", line 1061, in _open
>> return open(self.baseFilename, self.mode, encoding=self.encoding)
>> PermissionError: [Errno 13] Permission denied: '/var/log/lokdon_debug.log'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 22, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/home/centos/APIS/apis_env/lib64/python3.6/site-packages/django/core/management/__init__.py",
>> line 364, in execute_from_command_line
>> utility.execute()
>>   File
>> "/home/centos/APIS/apis_env/lib64/python3.6/site-packages/django/core/management/__init__.py",
>> line 338, in execute
>> django.setup()
>>   File
>> "/home/centos/APIS/apis_env/lib64/python3.6/site-packages/django/__init__.py",
>> line 22, in setup
>> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
>>   File
>> "/home/centos/APIS/apis_env/lib64/python3.6/site-packages/django/utils/log.py",
>> line 75, in configure_logging
>> logging_config_func(logging_settings)
>>   File "/usr/lib64/python3.6/logging/config.py", line 802, in dictConfig
>> dictConfigClass(config).configure()
>>   File "/usr/lib64/python3.6/logging/config.py", line 573, in configure
>> '%r: %s' % (name, e))
>> ValueError: Unable to configure handler 'file': [Errno 13] Permission
>> denied: '/var/log/lokdon_debug.log'
>>
>>
>> 
>>
>> I  got the above when I ran my command:
>>
>> python manage.py check
>>
>> If you can solve this the internship is your.
>>
>> Initially and currently I have internal error on the web response to GET.
>>
>> See below in attachment.
>>
>> [image: image.png]
>>
>> On Fri, Nov 22, 2019 at 5:02 PM mohamed khaled <
>> mohamed.khaled33...@gmail.com> wrote:
>>
>>> I also I would like for an internship any help guys or opensource
>>> projects ?
>>>
>>> On Friday, 22 November 2019 13:33:26 UTC+2, Scyil sharma wrote:

 I am sahil sharma, a student of btech 3rd year and I'm seeking for an
 internship in Winter vacation. I would like to be work as a backend
 developer.
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/27da745d-16eb-4ffa-9bbe-7636ee0560b8%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2BGDpiQiqqEP2a0%3DHRjzxxUU%3DbPOUMnGfHXA5RzU4sX2ASYKLQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop rece

Re:

2019-11-27 Thread Anirudh Jain
Message on the URL ? Could you please give an example ?

On Wed, 27 Nov 2019, 18:08 vaneet bawa,  wrote:

> can someone please tell me that how I can display the message on the url
> from which I am getting the response
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKubXnycx%3DqU2h4SgRJ%3D_HEXbSqfbJ8ii2TbVQVzYGzcT9m7Qg%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAC3mK7dVtz9r%2B8yGdKYCLfts0hgv%2Bd325BnqHOKFMMGp6Hx27A%40mail.gmail.com.