Free Django Video Tutorials

2015-03-04 Thread Deep Sukhwani
Thanks Mike,

Just starting with introduction tutorials.

Very helpful..

-- 
You received this message because you are subscribed to the Google Groups 
"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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3170e26-3e81-4eed-a01e-1559258ce3a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2015-03-04 Thread Deep Sukhwani
Hi,

I am a newbie to this community and I am not sure how should I submit this 
bug/error in 1st part of Django Tutorial.

Here's the error:
On page Writing your first Django app, part 1 | Creating a project 
 
notice 
it says *django-admin.py startproject mysite* whereas it should actually be 
*django-admin 
startproject mysite*

Note: I am not sure if the documentation here: Problems running django-admin 

 relates 
to this issue (Screenshot below):




I am on a Windows 7 64-bit machine, running Django 1.7.5 with Python 2.7.9 
(64-bit). If I run *django-admin.py startproject mysite*, I get following 
response:

Usage: django-admin.py subcommand [options] [args]


Options:
  -v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output, 3=very verbose output
  --settings=SETTINGS   The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't provided, 
the
DJANGO_SETTINGS_MODULE environment variable will be
used.
  --pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
  --traceback   Raise on exception
  --no-colorDon't colorize the command output.
  --version show program's version number and exit
  -h, --helpshow this help message and exit


Type 'django-admin.py help ' for help on a specific subcommand.


Available subcommands:


[django]
check
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
makemigrations
migrate
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqldropindexes
sqlflush
sqlindexes
sqlinitialdata
sqlmigrate
sqlsequencereset
squashmigrations
startapp
startproject
syncdb
test
testserver
validate
Note that only Django core commands are listed as settings are not properly 
configured (error: Requested setting INSTALLED_AP
PS, but settings are not configured. You must either define the environment 
variable DJANGO_SETTINGS_MODULE or call settings.
configure() before accessing settings.).

However if I run, *django-admin startproject mysite*, the new mysite 
directory is created along with all the default files

-- 
You received this message because you are subscribed to the Google Groups 
"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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/78dc0cb3-6269-40ca-9c08-358e9a67d0fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Documentation 1.7 shows "django-admin.py" whereas it should be "django-admin"

2017-09-11 Thread Deep Sukhwani
The answer is in the first post in this thread!

--
Regards
Deep L Sukhwani

On 11 September 2017 at 10:51, margana harika 
wrote:

>
> hello sir,
>even i got the same problem can you just tell me how did
> you solve this please!!
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/LsFZVzhj4v4/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d81aa114-77dc-4a61-9e73-42913b8196c6%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/CAEMqiPdbdbW62NM1Q5_UQLtcL_qEc6XGKPY1gKCHb01a9qyHAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django LiveServerTestCase - Unable to force_login in multiple tests

2020-03-04 Thread Deep Sukhwani


*Versions*


* - Django version: 1.9- Python: 3.5- Django Rest Framework: 3.5.4*

*Error Observed:*

ErrorTraceback (most recent call last):
  File "/Users/ds/git/some_repo/integration/test_multiple_login.py", line 32, 
in test_two
self.client.force_login(self.user)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/test/client.py",
 line 608, in force_login
self._login(user)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/test/client.py",
 line 621, in _login
login(request, user)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/contrib/auth/__init__.py",
 line 117, in login
user_logged_in.send(sender=user.__class__, request=request, user=user)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/dispatch/dispatcher.py",
 line 192, in send
response = receiver(signal=self, sender=sender, **named)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/contrib/auth/models.py",
 line 23, in update_last_login
user.save(update_fields=['last_login'])
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/contrib/auth/base_user.py",
 line 74, in save
super(AbstractBaseUser, self).save(*args, **kwargs)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/db/models/base.py",
 line 708, in save
force_update=force_update, update_fields=update_fields)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/db/models/base.py",
 line 736, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, 
update_fields)
  File 
"/Users/ds/.pyenv/versions/3.5.7/envs/work_env/lib/python3.5/site-packages/django/db/models/base.py",
 line 805, in _save_table
raise DatabaseError("Save with update_fields did not affect any rows.")
django.db.utils.DatabaseError: Save with update_fields did not affect any rows.

*Sample Code to reproduce this:*

from django.test import TestCase, LiveServerTestCase
from paths.factories import UserFactory

class ATestClass(LiveServerTestCase):

@classmethod
def setUpClass(cls):
"""
Test Data common across all tests
"""

super().setUpClass()

cls.user = UserFactory(is_staff=False, is_superuser=False)

def test_one(self):
"""
Login and then do some actions
"""
self.client.force_login(self.user)

# do something
self.assertTrue(True)

def test_two(self):
"""
Login and do some actions
"""

self.client.force_login(self.user)

# do something
self.assertFalse(False)


*What worked?*

   - If I replace LiveServerTestCase with TestCase it works as expected. 
   However, since I need access to live_server_url I need to inherit from 
   LiveServerTestCase for my use case

*Why LiveServerTestCase?*

   - My Test class needs access to live_server_url.

*What have I tried?*

   - I tried to move force_login statement to setUp method instead of doing 
   the login within the test method - doesn't help
   - I tried disconnecting the update_last_login signal 
   user_logged_in.disconnect(update_last_login) - While the signal 
   disconnected, and this allowed the test to progress (i.e. force_login 
statement 
   in the second test went through without any runtime errors, but actual 
   login failed and the API I was testing, returned 403 forbidden
   - I tried setting last_login attribute on self.user object to None before 
   the force_login statement - doesn't help.

*But Django version is old*

   - I know, but for reasons outside of my control, I am not in a position 
   to upgrade Django version. I am looking for some workable patch in my own 
   tests that I can use to get my use case working.

So any steps to help me patch this from within my tests would be greatly 
helpful.

-- 
You received this message because you are subscribed to the Google Groups 
"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/1d005cef-af43-46a5-89d3-a9b7f285a16d%40googlegroups.com.


Slack community for Django

2019-07-17 Thread Deep Sukhwani
[I have sent this as an email to DSF via Contact Us form, cross-posting it
here in case this is a better place to communicate]

Hello,

A lot of large scale open source projects have a dedicated Slack community,
some examples are Kubernetes, Golang, etc.
Slack has become defacto communication standard given its ease of use,
third party integrations, bots, ability to notify people, availability
across the platforms, etc.
Do we (Django community) have it in our pipeline to have a dedicated slack
community?

This question became more acute as I noticed that DjangoCon2018 and
DjangoCon2019 had their dedicated Slack communities but it is not open to
the general public (probably only attendees, organizers, volunteer, etc?)

Thanks,
--
Deep L Sukhwani
ᐧ

-- 
You received this message because you are subscribed to the Google Groups 
"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/CAEMqiPe%2BcZX3AW-rPNWivTzJsjh%3DNa1whV%3D3%3DeTD8z5qh%3DLbqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slack community for Django

2019-07-17 Thread Deep Sukhwani
Thank you, folks, for the super prompt and really helpful response.

<https://pouch.jumpshare.com/preview/VIBo1uV_rL0LcsieBCkXs19r2fLBr1t3shiJ_1EV6cjNHOjvkV2NYdazr_K2N9G9xlw183Zrh27NZmeSyYkpwDJprjKJn4snkOQIlHyX-Do>


*Two points:*

   1. It seems we are using the free version of Slack for 
   https://pyslackers.com/web as a result of which older messages are not 
   searchable. I feel (maybe I am wrong) This kind of discourages the use of 
   tool given limitations that we have inherently.
   2. Tried to look for some select individuals I know are very regular in 
   Django community, but couldn't find them - hence assuming it's either not 
   evangelized enough (as much as our Mailing lists, IRC, etc.) and I have 
   never heard of this being spoken about in any DjangoCon talks either.


*Individual thoughts:*

   1. I feel being updated with the tools and technologies we use as a 
   community encourages more participation in the community since the barriers 
   are low and the tools are familiar for the newly evolving workforce. As a 
   community we should put focussed efforts towards things of this nature 
   (again, just an opinion based on experience with some communities such as 
   K8s)

Thank you again.

--
Deep S

On Wednesday, 17 July 2019 14:16:13 UTC+5:30, Deep Sukhwani wrote:
>
> [I have sent this as an email to DSF via Contact Us form, cross-posting it 
> here in case this is a better place to communicate]
>
> Hello,
>
> A lot of large scale open source projects have a dedicated Slack 
> community, some examples are Kubernetes, Golang, etc.
> Slack has become defacto communication standard given its ease of use, 
> third party integrations, bots, ability to notify people, availability 
> across the platforms, etc.
> Do we (Django community) have it in our pipeline to have a dedicated slack 
> community?
>
> This question became more acute as I noticed that DjangoCon2018 and 
> DjangoCon2019 had their dedicated Slack communities but it is not open to 
> the general public (probably only attendees, organizers, volunteer, etc?)
>
> Thanks,
> --
> Deep L Sukhwani
> ᐧ
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/628d45e5-60ab-4ecd-9cda-fa0ee9d7746f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Slack community for Django

2019-07-17 Thread Deep Sukhwani
Thank you for acknowledging Nick.

Best,
Deep S


On Wed, Jul 17, 2019, 17:29 Nick Sarbicki  wrote:

> Cheers for the feedback Deep,
>
> Sadly given the scale of the current community it would cost up to around
> 1.6 million USD per year to use enterprise slack.
>
> I know some OSS communities have this enabled for free, slack has been
> approached about this but have sadly declined to give pyslackers the same
> privilege.
>
> Outside of doing a huge fundraiser every year I don't think there is a
> reasonable way to go about this.
>
> Just to make a quick disclaimer, I am an admin of this slack community -
> but derive no profit or benefit from it other than community engagement.
>
> Obviously we're happy to be mentioned in conference talks. But i don't see
> any real reason why we should be promoted at conferences at the moment.
>
> This is feeling quite off topic at this point.
>
> On Wed, 17 Jul 2019, 12:43 Deep Sukhwani,  wrote:
>
>> Thank you, folks, for the super prompt and really helpful response.
>>
>>
>> <https://pouch.jumpshare.com/preview/VIBo1uV_rL0LcsieBCkXs19r2fLBr1t3shiJ_1EV6cjNHOjvkV2NYdazr_K2N9G9xlw183Zrh27NZmeSyYkpwDJprjKJn4snkOQIlHyX-Do>
>>
>>
>> *Two points:*
>>
>>1. It seems we are using the free version of Slack for
>>https://pyslackers.com/web as a result of which older messages are
>>not searchable. I feel (maybe I am wrong) This kind of discourages the use
>>of tool given limitations that we have inherently.
>>2. Tried to look for some select individuals I know are very regular
>>in Django community, but couldn't find them - hence assuming it's either
>>not evangelized enough (as much as our Mailing lists, IRC, etc.) and I 
>> have
>>never heard of this being spoken about in any DjangoCon talks either.
>>
>>
>> *Individual thoughts:*
>>
>>1. I feel being updated with the tools and technologies we use as a
>>community encourages more participation in the community since the 
>> barriers
>>are low and the tools are familiar for the newly evolving workforce. As a
>>community we should put focussed efforts towards things of this nature
>>(again, just an opinion based on experience with some communities such as
>>K8s)
>>
>> Thank you again.
>>
>> --
>> Deep S
>>
>> On Wednesday, 17 July 2019 14:16:13 UTC+5:30, Deep Sukhwani wrote:
>>>
>>> [I have sent this as an email to DSF via Contact Us form, cross-posting
>>> it here in case this is a better place to communicate]
>>>
>>> Hello,
>>>
>>> A lot of large scale open source projects have a dedicated Slack
>>> community, some examples are Kubernetes, Golang, etc.
>>> Slack has become defacto communication standard given its ease of use,
>>> third party integrations, bots, ability to notify people, availability
>>> across the platforms, etc.
>>> Do we (Django community) have it in our pipeline to have a dedicated
>>> slack community?
>>>
>>> This question became more acute as I noticed that DjangoCon2018 and
>>> DjangoCon2019 had their dedicated Slack communities but it is not open to
>>> the general public (probably only attendees, organizers, volunteer, etc?)
>>>
>>> Thanks,
>>> --
>>> Deep L Sukhwani
>>> ᐧ
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/628d45e5-60ab-4ecd-9cda-fa0ee9d7746f%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/628d45e5-60ab-4ecd-9cda-fa0ee9d7746f%40googlegroups.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 vis

Re: request module

2019-09-23 Thread Deep Sukhwani
The right place for this would be "requests" community -
https://2.python-requests.org/en/master/community/support/#e-mail

The best immediate course of action would be to post a question on
stackoverflow.com and tag the question with *python-requests*

--
Regards
Deep L Sukhwani


On Mon, 23 Sep 2019 at 18:11, dandu sreenivasulu 
wrote:

> Hi All,
>  can someone please help on below request
>
> url = 'http://abc.com/'
> response = requests.get(url)# 
> url1 = response.url # http://xyz.com --> when we access abc.com url it
> will redirect to xyz.com url and there we have to entere username and
> password
> print(url1) #xyz.com
> print(response.url) #xyz.com
> post_data = {
> 'User Name': 'sr...@gmail.com',
> 'Password': 'srinu123',
> 'action':'btnLogin'
> }
> with requests.Session() as s:
> r = s.post(url1, data=post_data)
> r = s.post(url1, auth=HTTPBasicAuth('sr...@gmail.com', 'srinu123'))
> print(response.status_code) # 200
> print(response.text) # error //
>
> questions:
> 1) what attributes i have to take from text filed ?
>
> User Id:
> Passwor:
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/406a807c-9979-42c6-b061-9a12d66cd65b%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/CAEMqiPd9XEK3H76tgJKw%2BdiUyPFBGHBLygqZ1FCwXY4xhmFgoQ%40mail.gmail.com.


Re: ModuleNotFoundError: No module named :

2019-09-23 Thread Deep Sukhwani
Are you supposed to be using a virtualenv and you don't have that activated?

Can you run *pip freeze | grep -i django* and share the output?

--
Regards
Deep L Sukhwani


On Tue, 24 Sep 2019 at 09:40, MEGA NATHAN  wrote:

> Hi.
>
>
> i 'm meganathan from india i was doing django trining ,
>
> And i have one dout .mo module name found models
>
> *ModuleNotFoundError: No module named 'django.models'*
>
>
>
>
>
> *Regards*
> *Meganathan,*
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/f85f29b7-e3d9-4dfa-945f-70f1fb8e90f1%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/CAEMqiPe7rf4syuVUTEZVO%2BOMh7K-cvGX_yLsL0vhchNbTTfATw%40mail.gmail.com.


Re: convert python 3 to python2

2019-09-24 Thread Deep Sukhwani
Wow, TIL there are companies selling support for Python 2? Never heard of
it. So basically we are saying these companies will maintain there own
version of Python programming language which will continue to be maintained
as long as they have paid users for Python 2? I seriously doubt that. Or
may be I am understanding it all wrong.


--
Regards
Deep L Sukhwani


On Tue, 24 Sep 2019 at 17:32, Larry Martell  wrote:

> On Tue, Sep 24, 2019 at 4:15 AM Andréas Kühne
>  wrote:
> >
> > Official access isn't denied - and python 2 will probably be available.
> The problem is that you don't get any security fixes or any updates at all.
> That in itself is a major problem. If someone is saying that you need to
> use python 2, I would strongly recommend them to not even think about it.
> All code that is written will be useless in a couple of years time, and
> need to be updated or even worse thrown away.
>
> This is totally untrue. Yes, all code should be converted to py3, but
> that is simply not happing at many companies. They will continue to
> use their py2 apps, and either support them internally or purchase py2
> support from one of the many companies offering it. Is that a good
> idea? No, but it's a reality.
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CACwCsY4asgYPCoXVabOi4NABck-NfAsjOOsZN_1-MVQ07HZe7Q%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/CAEMqiPeL8KMsq9d7FhZGh%2B73dY7i3rhA7kxHKjpWnMA3K83S-w%40mail.gmail.com.


Re: convert python 3 to python2

2019-09-24 Thread Deep Sukhwani
Thanks for the prompt reply. Did a quick cursory check with Anaconda, I
don't think Anaconda does it. In fact Anaconda has posted a few months ago
about Python 2's EOL (End of Life) -
https://www.anaconda.com/end-of-life-eol-for-python-2-7-is-coming-are-you-ready/

Also, just did a quick look at their professional services, couldn't see
anything suggesting they will offer python 2 support beyond the python 2's
community itself.

--
Regards
Deep L Sukhwani


On Tue, 24 Sep 2019 at 17:53, Larry Martell  wrote:

> Anaconda, Enthought, ActiveState, Red Hat and maybe others as well.
> Also large companies can do their own support.
>
> On Tue, Sep 24, 2019 at 8:11 AM Deep Sukhwani 
> wrote:
> >
> > Wow, TIL there are companies selling support for Python 2? Never heard
> of it. So basically we are saying these companies will maintain there own
> version of Python programming language which will continue to be maintained
> as long as they have paid users for Python 2? I seriously doubt that. Or
> may be I am understanding it all wrong.
> >
> >
> > --
> > Regards
> > Deep L Sukhwani
> >
> >
> > On Tue, 24 Sep 2019 at 17:32, Larry Martell 
> wrote:
> >>
> >> On Tue, Sep 24, 2019 at 4:15 AM Andréas Kühne
> >>  wrote:
> >> >
> >> > Official access isn't denied - and python 2 will probably be
> available. The problem is that you don't get any security fixes or any
> updates at all. That in itself is a major problem. If someone is saying
> that you need to use python 2, I would strongly recommend them to not even
> think about it. All code that is written will be useless in a couple of
> years time, and need to be updated or even worse thrown away.
> >>
> >> This is totally untrue. Yes, all code should be converted to py3, but
> >> that is simply not happing at many companies. They will continue to
> >> use their py2 apps, and either support them internally or purchase py2
> >> support from one of the many companies offering it. Is that a good
> >> idea? No, but it's a reality.
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups "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/CACwCsY4asgYPCoXVabOi4NABck-NfAsjOOsZN_1-MVQ07HZe7Q%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/CAEMqiPeL8KMsq9d7FhZGh%2B73dY7i3rhA7kxHKjpWnMA3K83S-w%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/CACwCsY4Y%2BhYS_oLaUVC4pkRW-v_rrsjY38CwHR1Vv1%2Bt0gNZQA%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/CAEMqiPe-ZOJLbiXn2Qesk-dSC%2Bw8JYcAii81ecsL%2BpV%2B_7AFfA%40mail.gmail.com.


Re: Django developer server auto quit when iterate QuerySet in template

2019-09-24 Thread Deep Sukhwani
Possible to push the whole code to a Github repo so someone could check out
and try locally - Couldn't really figure out anything that might be going
wrong by looking at this much mode?

Also, just out of curiosity, why are you using *Department.objects.filter()*
instead of *Department.objects.all()* since you are anyways not passing
anything to the filter.

--
Regards
Deep L Sukhwani


On Tue, 24 Sep 2019 at 20:23, Huy Bùi  wrote:

> Hello,
>
>  Everytime i try to access a url, the Django developer server auto quit
> without any log about what happens.
>  After debugging a little bit, i find out if i remove this block of code
> in the template file, i can access the web page normally:
>
>  
>  
>  {% for d in departments %}
>   {{ d.name }} - {{ d.department_code }}
> 
>  {% endfor %}
>  
>
>  But i can iterate the QuerySet in the view normally, it seems like there
> aren't any problem iterating the QuerySet:
>
> def edit(request):
> departments = Department.objects.filter()
> for d in departments:
> print(d.id, d.name, d.department_code)
>
> return render(request, 'edit/edit.html', {'departments': departments})
>
>  I have no idea what is happening and it's driving me crazy. Any help
> would be appreciated. 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/905973fa-6d90-4b45-bb69-ffcc787d2524%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/CAEMqiPf-0NxxKjbWXPh7R7qZvPDLgOeamrhpCw7MASit8%3DB3vg%40mail.gmail.com.


Re: how to use django pagination with sql query and not ORM

2019-09-24 Thread Deep Sukhwani
Have you tried using the *.query* on Django's QuerySet (documentation: [1])

For example, if my QuerySet is:
*User.objects.filter(username__contains='alpha')*

I can obtain the underlying raw SQL Query using:
*print(User.objects.filter(username__contains='alpha').query)*
*>>> *print(User.objects.filter(username__contains='alpha').query)
SELECT `auth_user`.`id`, `auth_user`.`password`, `auth_user`.`last_login`,
`auth_user`.`is_superuser`, `auth_user`.`username`,
`auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`,
`auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`date_joined`
FROM `auth_user` WHERE `auth_user`.`username` LIKE BINARY %alpha%

1:
https://docs.djangoproject.com/en/2.2/topics/db/sql/#performing-raw-queries

--
Regards
Deep L Sukhwani


On Wed, 25 Sep 2019 at 00:47, leb dev  wrote:

> I now how to use django pagination with ORM django after filtering the
> required data and put in into *pagination div*
>
> *queryset_list = employee.objects.all()*
> *query=request.GET.get("q")*
> *if query:*
> *queryset_list=queryset_list.filter(*
> *  Q(name__icontains=query)|*
> *  Q(father_name__icontains=query)|*
> *  Q(mother_name__icontains=query)|*
> *  Q(content__icontains=query)|*
> *  Q(create_date__icontains=query)*
> *  # Q(user__first_name__contains=query)*
> *).distinct()*
>
>
> *paginator = Paginator(queryset_list, 5)*
> *page_request_var = "page"*
> *page = request.GET.get(page_request_var)*
> *queryset = paginator.get_page(page)*
>
> *context={*
> *"object_list":queryset,*
> *"title":"List Items",*
> *"page_request_var":page_request_var,*
> *}*
> *return render(request,"blog/list.html", context)*
>
>
> the above code is working
>
> my question is how to convert this ORM into raw SQL
>
> i know that i must use LIMIT and OFFSET  in raw SQL  to embedded into
> paginator.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/2d44b204-8520-423a-992c-597fd479f856%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/CAEMqiPc5zqcT%2BaPYSySLCJe22nPC-fCk_RkaTvWvRx5CSqkXQA%40mail.gmail.com.


Re: Virtual Environment error

2019-09-24 Thread Deep Sukhwani
Depending on how you installed *virtualenv* package and what you are using
to create and activate virtualenv you can determine the currently present
virtualenvs on your computer.


   - If you used *virtualenvwrapper* - use *lsvirtualenv*
   - Additionally, you can look in your Home Directory and search for a
   directory named .virtualenvs (Note there's a dot before virtualenvs) to
   see the list of all present virtualenvs
   - Finally, you can always just go ahead and create a new one - shouldn't
   take too much time

--
Regards
Deep L Sukhwani


On Wed, 25 Sep 2019 at 08:44, yasar arafath Kajamydeen 
wrote:

> Dear All,
>
> Actually i forget my virtual environment name. So when i run  --  python
> manage.py  runserver   command its showing   error like this  .
>
>
> ImportError: Couldn't import Django. Are you sure it's installed and
> available on your PYTHONPATH environment variable? Did you forget to
> activate a virtual environment?
>
>
>
>
> Thanks in Advance.
>
>
> Regards,
> Yasar Arafath K
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/198d3480-4f3b-4cf3-971d-ce6c7ec19080%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/CAEMqiPfagZtyvNC%2BLzzmTvasK2HXFcdLnDLqyxJirBq4-miCgQ%40mail.gmail.com.


Re: Regarding to file stronge.

2019-09-25 Thread Deep Sukhwani
Hey Anil,

Django PostgresQL and Django-MySQL have JSONField which allow you to store
JSON formatted data (I am assuming you meant storing JSON data when you
asked *multiple files in  Json format to  store the  database *)

*PostgresQL*:
https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/#jsonfield

*Django-MySQL*:
https://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html#django_mysql.models.JSONField



On Wed, Sep 25, 2019, 16:28 ANIL UMARANE  wrote:

> Hi guys,
> How to store the multiple files in  Json format to  store the  database .
> Easily retrieve and delete.
>
> And how set the path
>
> Regards..
> Anil.K
> Mob:9019094199
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAKfwX9wvcE909kbu79xFt1bcWzfS3u8L%3D6v-5iRQLjYQBk%3D9cw%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/CAEMqiPcdRsnxg4_RTkQpYW8-H2ftas8N%2BFg7BghVWAuHi3cvKg%40mail.gmail.com.


Re: redirect authenticated user in create view in django

2019-09-26 Thread Deep Sukhwani
Hey,

you could use if request.user.is_autenticated to identify if a user has
authenticated, see documentation on Django

.

--
Regards
Deep L Sukhwani

ᐧ

On Wed, 25 Sep 2019 at 22:39, saeed albooyeh 
wrote:

> hi
> i used CreateView for registration in my project and i wanna prevent
> authenticated user from accessing to the register url and redirect it to
> another page
> can anyone tell me how can i do it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/a87cee2c-bfc9-4086-aefd-2342f6b55da7%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/CAEMqiPcfSSHhopJiEM%2BdGgXoia_3hz1ei6iXOJ3890kJD1b_Ng%40mail.gmail.com.


Re: Using Django Admin as definitive admin interface

2019-09-26 Thread Deep Sukhwani
I have read about places where Django Admin interface is used as primary
admin interface by tech and non-tech departments to manage a project. On
the other hand, I have also seen workplaces where admin is as much hidden
from non-tech / routine project management as much possible and instead
external tools are given to the individual teams based on what they need it
for in order to manage the project.

I think it really depends on your use case, number of people who are likely
to use it if you have other things in place - like permissions to ensure
unintended/accidental changes by one individual/team does affect another
individual/team, some ability to audit database changes (when/who made
them), etc.

--
Regards
Deep L Sukhwani

ᐧ

On Thu, 26 Sep 2019 at 21:33, Edson Kan Ishigami  wrote:

> Hi all,
>
> I'm a newbie in the Django world. And I have a question to ask for you:
>
> Is it a good practice to use the Django Admin as a definitive admin
> interface for a project in production?
>
> Or it is just used on the development stage?
>
> If it isn't a good practice, there are some tips to create an admin?
>
> Tks a lot.
>
> Kan Ishigami
>
> --
> You received this message because you are subscribed to the Google Groups
> "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%2Br2btJt_b_xbOE6Z%3Da42DKB-njXw_3Ah3poht%3DKWN0t2gKkAw%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/CAEMqiPf5%2BvqzuG762ORo52ssx1MvBq1QwJscjnZrfz2jVy378g%40mail.gmail.com.


Re: best option for Front End Design in Django

2019-09-27 Thread Deep Sukhwani
Hey,

Any basic tutorial (the ones listed on Postman's website too) should be
good to use. If you really want a step by step guide, check this tutorial
on guru99.com 

An appropriate approach would be to understand the basics of ReST and how
ReST APIs work, make some sample requests using tools like cURL, wget, etc.
and postman, in a very simplified way, is just a UI tool to make HTTP
requests.

Hope this helps

--
Regards
Deep L Sukhwani

ᐧ

On Fri, 27 Sep 2019 at 16:13, Balaji Shetty  wrote:

> Hello
>
> Can you please give me some good resources to learn and understand Postman.
>
>
>
>
>
> On Thu, Sep 26, 2019 at 10:06 AM dheeraj technoevanglist <
> bond.dee...@gmail.com> wrote:
>
>> Postman is a tool on which we can request with the parameters, for
>> example we have a web application contains backed code and front end code
>> you can create backed alone and instead of html web page you can use
>> postman to execute the backed and get HTML output on postman
>>
>> On Thu, Sep 26, 2019, 19:29 Ankita Gupta 
>> wrote:
>>
>>> What is post-man? Can you explain it little more?
>>>
>>> On Thu, 26 Sep 2019, 7:13 pm dheeraj technoevanglist, <
>>> bond.dee...@gmail.com> wrote:
>>>
 Totally agreed Django applies separation of concern so start with html
 basics or make back end first and test it through the post man.

 On Thu, Sep 26, 2019, 16:28 Nick Sarbicki 
 wrote:

> Honestly whilst everyone is recommending react/angular etc. I'd argue
> these are probably the worst places to start. It assumed a lot of up front
> knowledge and ability in web design.
>
> Balaji has strongly suggested that they don't have a good grasp of the
> basics yet, HTML, CSS and vanilla JavaScript. Throwing out relatively
> advanced JS solutions does not solve this problem.
>
> Balaji I'd recommend picking up some basic knowledge of HTML and CSS
> first - this will get you started building rudimentary websites and is
> essential knowledge for practically all web development. You must learn
> these before anything else.
>
> Once you have some understanding of how these work take a basic course
> in JavaScript - which is what powers most of the modern web (through using
> HTML and CSS). If you start feeling comfortable with that I'd recommend
> looking up a framework, React, Angular and Vue are the normal
> recommendations. I'd personally go with React for the sole reason that it
> is - comparatively quite simple to pick up (once you understand 
> JavaScript)
> and also very commonly used with strong community support.
>
> In terms of turning this into an app down the road... Apps and web
> sites are not directly comparable. There are multiple ways of approaching
> converting a website into an app but most are relatively advanced. I would
> focus on what you are doing now before thinking about that journey.
>
>
> - Nick
>
>
> On Thu, Sep 26, 2019 at 11:50 AM Pengyu Cao 
> wrote:
>
>> Hey, how about check this,
>> https://www.similartech.com/compare/angular-js-vs-react-js
>>
>> On Thursday, September 26, 2019 at 4:48:30 PM UTC+8, Suraj Thapa FC
>> wrote:
>>>
>>> React
>>>
>>> On Thu, 26 Sep, 2019, 1:53 PM Balaji Shetty, 
>>> wrote:
>>>
 Hi

 Can anybody please tell me what are the different options to create
 GUI (User Interface ) for Front End in Django.

 I got answer like Angularjs, Nodejs, HTML5 or CSS.

 Which one is easier as well as mobile compatible if we need to
 develop mobile App also.

 --


 *Mr. Shetty Balaji S.Asst. ProfessorDepartment of Information
 Technology,*
 *SGGS Institute of Engineering & Technology, Vishnupuri,
 Nanded.MH.India*
 *Official: bssh...@sggs.ac.in *
 *  Mobile: +91-9270696267*

 --
 You received this message because you are 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/CAECSbOtrT638Qv1UFdD-WKiqLr464-%3D5_O7K7vO5rHBo3m9yqg%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://gro

A good explanation on dispatch() method

2019-09-27 Thread Deep Sukhwani
I found this explanation on SO
 much more layman terms
oriented. It helped me understand just after the first read of it.
Sharing in case it helps others too.

*Official Django documentation*


--
Regards
Deep L Sukhwani
SO  | Twitter
 | LinkedIn

ᐧ

-- 
You received this message because you are subscribed to the Google Groups 
"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/CAEMqiPdSOjTK5kirdf_H6SKGncm%2BUEYGLUD5e8h4f4tbGn_QFQ%40mail.gmail.com.


Re:

2019-09-30 Thread Deep Sukhwani
Probably a good question for Django CMS community, mind posting it there?

Here's how you can reach them:
http://docs.django-cms.org/en/latest/#join-us-online

--
Regards
Deep L Sukhwani

ᐧ

On Sat, 28 Sep 2019 at 22:30, Perceval Maturure 
wrote:

> dear team
> my django cms is refusing to take in other templates when i select a
> different template, what could be the problem?
>
> i am on django cms 3.7.0 , django 2.1 and python 3
> regards
>
>
> --
> *Perceval Maturure*
>
> *083 303 9423*
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAFZtZmCJzJOfCfOGNm%2B3bep%3DaiJxep%2BgfXC8Yg_5tYmifnXG_A%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/CAEMqiPdaVGyOrkNRCpkqMDz7Cy%3Dp6RNv%3Dx0b_u6VSGMPRfXhLA%40mail.gmail.com.


Re: Django FastCGI and static files

2019-09-30 Thread Deep Sukhwani
At the end of every email, the instructions are clearly mentioned - Here it
is:

*To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com
> .*


Hope this helps.

--
Regards
Deep L Sukhwani

ᐧ

On Sat, 28 Sep 2019 at 22:17, Sipum  wrote:

> Block or mark as spam.
> I think it will work. Give it a try
>
> On Sat, 28 Sep, 2019, 7:30 PM Anike Sadia,  wrote:
>
>> Hi pls how to leave this group
>>
>>
>> On Tue, 17 Sep 2019 at 17:16, Martin Jaan Leesment <
>> martinjaa...@gmail.com> wrote:
>>
>>> Hey
>>>
>>> I'm new to serving Django website on a shared server as well as using
>>> fastcgi and .htaccess so this might be a basic question. Namely I'm having
>>> difficulties serving static content. I've tried playing with htaccess
>>> rules, but no luck yet. My project structure:
>>>
>>> myproject/
>>> ├── myapp
>>> │   ├── admin.py
>>> │   ├── apps.py
>>> │   ├── models.py
>>> │   ├── static
>>> │   │   └── myapp
>>> │   │   ├── css
>>> │   │   │   ├── bootstrap.min.css
>>> │   │   │   ├── bootstrap.min.min_myproject.css
>>> │   │   │   └── proj.css
>>> │   │   ├── fonts
>>> │   │   ├── images
>>> │   │   │   ├── logo.png
>>> │   │   └── scripts
>>> │   │   ├── bootstrap.bundle.min.js
>>> │   │   └── bootstrap.min.js
>>> │   ├── templates
>>> │   │   └── myapp
>>> │   │   ├── base.html
>>> │   │   ├── footer.html
>>> │   │   ├── header.html
>>> │   │   ├── index.html
>>> │   ├── tests.py
>>> │   ├── urls.py
>>> │   └── views.py
>>> ├── manage.py
>>> ├── myproject
>>> │   ├── __init__.py
>>> │   ├── locale
>>> │   ├── media
>>> │   ├── settings
>>> │   │   ├── base.py
>>> │   │   ├── dev.py
>>> │   │   ├── __init__.py
>>> │   │   ├── prod.py
>>> │   ├── static
>>> │   ├── templates
>>> │   │   └── base.html
>>> │   ├── urls.py
>>> │   └── wsgi.py
>>> ├── requirements
>>> └── test.py
>>>
>>> My htaccess
>>>
>>> Options +ExecCGI
>>> AddHandler fcgid-script .fcgi
>>> RewriteEngine On
>>> RewriteRule ^(/static.*)$ /static//$1 [L]
>>> RewriteCond %{REQUEST_FILENAME} !-f
>>> RewriteRule ^(.*)$ cgi-bin/mydjangapp.fcgi/$1 [QSA,L]
>>>
>>>
>>> If anybody can help me figure out how to solve it, would really
>>> appreciate.
>>>
>>> Thanks!
>>>
>>> Best
>>> MJ
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "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/80c1e98b-8a0a-482c-a20f-29b4c7afdcab%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/CADi3MtsqOtuN%2BEuArMCZSJBuW-AYgvqDkDU4RsP3Y%2BF62SC_bQ%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/CAGHZBzzeObUv0vLdoU4arPb8iYz1pGYSKEUSopC7nX7Fz_YAcw%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/CAEMqiPfvh%3DNpye%2BsV2-zfjJgYhCzh5%3Dii_GQd%2Bt3sEu9NPkm3Q%40mail.gmail.com.


Re: Stop executing certain py files or delay in loading python files until Django server is up and runnning

2019-09-30 Thread Deep Sukhwani
What you are looking for is readiness check. Basically readiness is a
concept wherein something reports to be ready to handle requests (this
something could be a web server, a docker container, a kubernetes pod, a
database, etc.)

You can custom define an API endpoint that returns 200 OK when your Django
server is ready to handle the requests, and internally make a request to
that API endpoint and only execute your file once the endpoint returns 200
OK.

Alternatively, there are third-party packages (a quick google search
revealed django-probes ) that
might assist you in implementing something similar.

Logically, at a primitive level, your flow would be something along the
lines of:

   - Define an API endpoint:
  - This should return a custom response WHILE it is YET to be ready to
  start taking requests
  - This should return a different custom response WHEN it is ready to
  start taking requests
   - Once you have the desired "ready" response, you go on invoking the
   file, until then you keep delaying it by adding a second's sleep or
   something.

Sample code


   1. import requests
   2.
   3. """
   4. api_endpoint is the custom endpoint that returns your desired
   5. response based on whether or not Django Server is ready to take
   6. on requests
   7. """
   8. response = requests.get(api_endpoint)
   9.
   10. while response.status_code != 200:
   11. time.sleep(1) # Sleep for 1 second
   12. response = requests.get(api_endpoint)
   13.
   14. # Once this while loop breaks, this indicates we are good to proceed
   15.
   16. if response.status_code == 200:
   17. # Do rest of your job here


Pastebin link to above: https://pastebin.com/G3G41Xmb

--
Regards
Deep L Sukhwani

ᐧ

On Mon, 30 Sep 2019 at 16:12, Sampath Reddy 
wrote:

> Hey All,
>
> Using DRF for developing backend api end points for the application, I
> want to run a python module, only when we are sure Django server is up and
> running As I am calling the api end in that module.
>
> So need to be sure Django server is up and running, before I can call the
> same server API end point.
>
> Precisely What I am looking for is, how django loads files and starts
> executing them when I run "python manage.py runserver 0.0.0.0:8084" from
> command line. I want to delay some files execution if possible.
>
> Any leads are much appreciated.
>
> Thanks,
> Sampath
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/CAErixQ3%3D_ms9y-RtHa89LMtgFvHBN2sQ32GJ1yef0MCtx7HT%3Dw%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/CAEMqiPc_-kkbZbxiw9Ui7-NDb3kMb9Gv9vryoXh8wJLZkexHeA%40mail.gmail.com.


Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-09-30 Thread Deep Sukhwani
What exactly do you want to use celery for?

Using selenium webdriver the regular way should suffice here.
Regarding copying from one field and pasting into another, you might be
able to work with .get_text() method in selenium to read text from one
field, store it in a variable and then .send_keys() to write that text into
another field.

*Note: This is a good question for selenium community and you should
consider posting it there or on Stack overflow with selenium webdriver tag*

On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:

>
>
> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
> wrote:
>>
>> I am new to Django.
>>
>> I  have a requirement to develop a django application with the
>> requirement as stated below:
>>
>> 1.Under one tab ,provide a button name "ApplyGSP"
>> 2.click on "ApplyGSP" button should open a form ,which required below
>> input from the user.
>>
>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
>> *f)from_sas_url g) to_sas_url etc.*
>>
>> *3.*once the user submitted the FORM with all the fields from step2,
>> your app should open a browser with the user specified URL from 
>> f)*from_sas_url
>> field* in step2.
>> 4.Perform few click operations using selenium webdriver.
>>
>5.copy the list of records from f) to g)
>
> Please provide your suggestion how to perform this task in a better way.
>
> can i use celery application and launch the browser and perform the click
> operations using selenium webdriver ?
> Is there any better way please suggest me.
>
> Regards,
> N.Dilip Kumar.
>
>>
>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "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/87eaa9b9-eccb-4f7c-87b3-3a6a2d6ee8b7%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/CAEMqiPc%3D2z5-LZNAKSAmrhOWB%3DV_mJhA2R2%2BzMRzt9CTjs5OOw%40mail.gmail.com.


Re: Request to provide the details of how to integrate django app with selenium chrome web driver

2019-10-01 Thread Deep Sukhwani
Still not clear on what is the automation task. From your original
questions:

1.Under one tab ,provide a button name "ApplyGSP"
> 2.click on "ApplyGSP" button should open a form ,which required below
> input from the user.
>
>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user 
> *f)from_sas_url
> g) to_sas_url etc.*
>
> *3.*once the user submitted the FORM with all the fields from step2, your
> app should open a browser with the user specified URL from f)*from_sas_url
> field* in step2.
> 4.Perform few click operations using selenium webdriver.
>
   5.copy the list of records from f) to g)

These indicate that you want to perform a particular task using selenium.

What is the other task you are trying to run simultaneously for which you
want to run the selenium job using celery.delay()?

My full understanding is:

   - You will develop a Django application that meets the above requirements
   - That Django application will certainly be in running state (only then
   you will be able to perform visual automation on it)
   - You will then run a selenium job on the above running Django
   application.
   - Here, your Django app is running on a different process and you are
   triggering selenium job separately.
   - If on the other hand, the only reason you want to run a Django app is
   to do the selenium task and then shutdown the Django app altogether, you
   can put the whole thing in a single bash script which essentially:
  - Starts your Django application using gunicorn or direct call to
  runserver or whichever way you want it to run
  - Checks that the Django application is up and running
  - Triggers the Selenium flow
  - If selenium flow returns exit 0 - gets out and shuts down the
  Django application

Is the above correct expectation correct?

--
Regards
Deep L Sukhwani

ᐧ

On Tue, 1 Oct 2019 at 23:08, Dilipkumar Noone  wrote:

> Hi,
>
> If i use selenium webdriver regular way in my django app, will it not
> cause time consuming to perform the automation task on chrome webdriver ?
> So to save the time , can i launch browser and perform automation task
> using celery delay() method.
>
> Regards,
> N.Dilip Kumar.
>
> On Tuesday, October 1, 2019 at 4:13:51 AM UTC+5:30, Deep Sukhwani wrote:
>>
>> What exactly do you want to use celery for?
>>
>> Using selenium webdriver the regular way should suffice here.
>> Regarding copying from one field and pasting into another, you might be
>> able to work with .get_text() method in selenium to read text from one
>> field, store it in a variable and then .send_keys() to write that text into
>> another field.
>>
>> *Note: This is a good question for selenium community and you should
>> consider posting it there or on Stack overflow with selenium webdriver tag*
>>
>> On Mon, Sep 30, 2019, 21:29 Dilipkumar Noone  wrote:
>>
>>>
>>>
>>> On Monday, September 30, 2019 at 9:22:16 PM UTC+5:30, Dilipkumar Noone
>>> wrote:
>>>>
>>>> I am new to Django.
>>>>
>>>> I  have a requirement to develop a django application with the
>>>> requirement as stated below:
>>>>
>>>> 1.Under one tab ,provide a button name "ApplyGSP"
>>>> 2.click on "ApplyGSP" button should open a form ,which required below
>>>> input from the user.
>>>>
>>>>*a)*model_no* b)*model_name *c)*os_version *d)*requested_time *e)*user
>>>> *f)from_sas_url g) to_sas_url etc.*
>>>>
>>>> *3.*once the user submitted the FORM with all the fields from step2,
>>>> your app should open a browser with the user specified URL from 
>>>> f)*from_sas_url
>>>> field* in step2.
>>>> 4.Perform few click operations using selenium webdriver.
>>>>
>>>5.copy the list of records from f) to g)
>>>
>>> Please provide your suggestion how to perform this task in a better way.
>>>
>>> can i use celery application and launch the browser and perform the
>>> click operations using selenium webdriver ?
>>> Is there any better way please suggest me.
>>>
>>> Regards,
>>> N.Dilip Kumar.
>>>
>>>>
>>>>
>>>>
>>>>
>>> --
>>> You received this message because you are 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/dja

Re: how to add the html and css

2019-10-02 Thread Deep Sukhwani
You're all in for luck, Django's official tutorial has quite an explanation
on this, check this out: Customize your App's look and feel



--
Regards
Deep L Sukhwani

ᐧ

On Wed, 2 Oct 2019 at 15:20, challa.Harikrishna chowdary <
challahari0...@gmail.com> wrote:

> In djnago how to add the html and css in my project
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/3928ae73-cc75-4fd7-8555-583f05b0bc26%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/CAEMqiPfCn8WQ2Tq_sBPcAgucBjogAB1E6aCYr3zk41aAWN6YiQ%40mail.gmail.com.