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/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/3292dd2d-b5b7-4b65-8d67-8b3276e4f94f%40googlegroups.com
> 

Re: AttributeError

2019-10-01 Thread Jorge Gimeno
On Tue, Oct 1, 2019 at 9:24 PM yasar arafath Kajamydeen 
wrote:

> Hi ,
>
> While try to execute  it showing AttributeError, Can some one help me on
> this.
>
>
> *My views.py*
>
>
>
> from django.shortcuts import render
> from django.http import Http404
> from django.http import HttpResponse
> from .models import Question
>
>
> def index(request):
> latest_question_list=Question.objects.order_by('pub_date')[:3]
> context={'latest_question_list':latest_question_list}
> return render(request,'polls/index.html',context)
>
> def detail(request, question_id):
> try:
> question=Question.object.get(pk=question_id)
> except Question.DoesNotExist:
> raise Http404("Question does not exist")
> return render(request, 'polls/detail.html', {'question':question})
>
>
> def results(request, question_id):
> response = "You're looking at the results of question %s."
> return HttpResponse(response%question_id)
>
>
> def vote(request, question_id):
> return HttpResponse("You're voting on question %s."%question_id)
>
>
>
>
>
>
>
> *My detail.html*
>
>
>
>   {{question}}
>
>
>
>
>
>
>
>
>
> *My polls/urls.py*
>
>
>
>
> from django.urls import path
>
> from . import views
>
> urlpatterns = [
> # ex: /polls/
> path('', views.index, name='index'),
> # ex: /polls/5/
> path('/', views.detail, name='detail'),
> # ex: /polls/5/results/
> path('/results/', views.results, name='results'),
> # ex: /polls/5/vote/
> path('/vote/', views.vote, name='vote'),
>
> ]
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/9918df61-41fd-40bd-8ca3-79ee3be12ec3%40googlegroups.com
> 
> .
>

Can you please post the traceback?  Copy and paste, please. Without that we
won't know where the exception is raised.

-Jorge

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


AttributeError

2019-10-01 Thread yasar arafath Kajamydeen
Hi ,

While try to execute  it showing AttributeError, Can some one help me on 
this.


*My views.py*



from django.shortcuts import render
from django.http import Http404
from django.http import HttpResponse
from .models import Question


def index(request):
latest_question_list=Question.objects.order_by('pub_date')[:3]
context={'latest_question_list':latest_question_list}
return render(request,'polls/index.html',context)

def detail(request, question_id):
try:
question=Question.object.get(pk=question_id)
except Question.DoesNotExist:
raise Http404("Question does not exist")
return render(request, 'polls/detail.html', {'question':question})


def results(request, question_id):
response = "You're looking at the results of question %s."
return HttpResponse(response%question_id)


def vote(request, question_id):
return HttpResponse("You're voting on question %s."%question_id)







*My detail.html*



  {{question}}









*My polls/urls.py*




from django.urls import path

from . import views

urlpatterns = [
# ex: /polls/
path('', views.index, name='index'),
# ex: /polls/5/
path('/', views.detail, name='detail'),
# ex: /polls/5/results/
path('/results/', views.results, name='results'),
# ex: /polls/5/vote/
path('/vote/', views.vote, name='vote'),

]

-- 
You received this message because you are subscribed to the Google Groups 
"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/9918df61-41fd-40bd-8ca3-79ee3be12ec3%40googlegroups.com.


Re: Django FastCGI and static files

2019-10-01 Thread anil polineni
hi  Django project structure is clearly understandable but I want CURD 
Operations mini-project  by using Django project



On Tuesday, September 17, 2019 at 9:46:31 PM UTC+5:30, Martin Jaan Leesment 
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/9892f659-d841-41d5-a65e-6216a6b9fae7%40googlegroups.com.


Widgets not working for dynamically added formset forms

2019-10-01 Thread Dmitri S.
I have a formset with fields with Select2 widgets and a calendar 
(date-picker) from django app.

And I use dynamic addition of formset forms.


When I render a template for the first time, all widgets work fine. *But 
when I add new formset form, widgets of this new form don't work.*


I think, this 

 ('formset:add') 
is somehow related to my problem, but I can't figure how to use it.

I also found this: 

$('.django-select2').djangoSelect2();

With this line dropdowns start working, but they become empty.


For adding new form I use 'empty form' and this jQuery:


$('.buttons').on('click', '#add_form', function() {
var form_idx = $('#id_resolution_set-TOTAL_FORMS').val();
$('#form_set').append($('#empty_form').html().replace(/__prefix__/g, 
form_idx));
$('#id_resolution_set-TOTAL_FORMS').val(parseInt(form_idx) + 1);
});



Form in HTML:

{% if mat_id == None %}

{% else %}

{% endif %}

{% csrf_token %}

{% for field in form_matter %}

{% if field.errors %}
{{ field.errors }}
{% endif %}
{{ field.label_tag }}
{{ field }}

{% endfor %}

RESOLUTIONS


{{ formset_resolutions.management_form }}
{% for form in formset_resolutions %}

{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{% for field in form.visible_fields %}

{% if field.errors %}
{{ field.errors }}
{% endif %}
{{ field.label_tag 
}}
{{ field }}

{% endfor %}

{% endfor %}


ADD
SAVE



{% for field in formset_resolutions.empty_form.visible_fields %}

{% if field.errors %}
{{ field.errors }}
{% endif %}
{{ field.label_tag }}
{{ field }}

{% endfor %}





Other scripts:




{{ form_matter.media.js }}


{{ form_matter.media.js }} are:









-- 
You received this message because you are subscribed to the Google Groups 
"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/109371d8-73ba-4a84-94be-f66e3bd81c96%40googlegroups.com.


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

2019-10-01 Thread Dilipkumar Noone
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/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/3292dd2d-b5b7-4b65-8d67-8b3276e4f94f%40googlegroups.com.


Re: Entire Application in Django shuts down with single error

2019-10-01 Thread Aldian Fazrihady
`runserver` is a development server to help you debug your code, so
crashing is a feature.

 To use django on production/staging, please follow this guide:
https://docs.djangoproject.com/en/2.2/howto/deployment/

On Tue, Oct 1, 2019 at 6:14 PM Amit Sharma  wrote:

> I am new to Python and django , I worked on C# and php as developer
> earlier. My problem here is Entire Application in Django shuts down with
> single error.
>
> for example i start my website with "python3 manage.py runserver
> 0.0.0.0:8000" example:-- i have two pages home and register
> 1) if i make error in register page code(register.py) , It shuts down home
> page too. Is there a way to prevent that as in php and C# in both one page
> do not effect other.
> 2) how to work in django with team one errors full team hangs.
>
> 3) How to work with live working websites things may become too risky.
>
> 4) can we make django development as friendly as C#, PHP  . and
> other programming language
>
> also i am not able to find article related to this. kindly 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/7d81706a-2f84-4f55-a25c-1bae726a8879%40googlegroups.com
> 
> .
>


-- 
Regards,

Aldian Fazrihady
http://aldianfazrihady.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/CAN7EoAZQKYBvkn42j9P9iv01koXAZRzyPBXWDE6KQ3yp0Ysb4w%40mail.gmail.com.


Re: I'm just started with Django, I'm getting this error after even following the steps provided for RHEL OS?

2019-10-01 Thread Sachin Puri
This is the error message I get when I don't specify the python version.
Try this command:

python3 manage.py runserver

On Tue, 1 Oct 2019, 16:44 Amar Tiwary,  wrote:

>
> --
> You received this message because you are subscribed to the Google Groups
> "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/f937a1d3-6b40-4b05-babe-210a8fd8610c%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/CAApu%3D5NaDA2MNK8TAcGTREuSkH71xQW0qnKdhsyF-W6vOGOsgg%40mail.gmail.com.


Re: Make an app public

2019-10-01 Thread Kasper Laudrup

Hi Tomas,

On 01/10/2019 11.26, Tomas Javurek wrote:
All the django tutorials show the sam thing. How to get the server 
running and view it on localhost. I am just wondering about the most 
important thing. How to make it public and see it under certain domain?




Have a look here:

https://docs.djangoproject.com/en/2.2/howto/deployment/

Kind regards,

Kasper Laudrup

--
You received this message because you are subscribed to the Google Groups "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/a71017fa-a5c5-2357-2220-7e68fe423751%40stacktrace.dk.


Entire Application in Django shuts down with single error

2019-10-01 Thread Amit Sharma
I am new to Python and django , I worked on C# and php as developer 
earlier. My problem here is Entire Application in Django shuts down with 
single error.

for example i start my website with "python3 manage.py runserver 
0.0.0.0:8000" example:-- i have two pages home and register
1) if i make error in register page code(register.py) , It shuts down home 
page too. Is there a way to prevent that as in php and C# in both one page 
do not effect other.
2) how to work in django with team one errors full team hangs.

3) How to work with live working websites things may become too risky.

4) can we make django development as friendly as C#, PHP  . and 
other programming language

also i am not able to find article related to this. kindly 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/7d81706a-2f84-4f55-a25c-1bae726a8879%40googlegroups.com.


Make an app public

2019-10-01 Thread Tomas Javurek
All the django tutorials show the sam thing. How to get the server running 
and view it on localhost. I am just wondering about the most important 
thing. How to make it public and see it under certain domain?

-- 
You received this message because you are subscribed to the Google Groups 
"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/4fb0b2a4-95ef-41ba-98ae-c2f648ffa136%40googlegroups.com.


Django bugfix releases: 2.2.6, 2.1.13, and 1.11.25

2019-10-01 Thread Carlton Gibson
Details are available on the Django project weblog:

https://www.djangoproject.com/weblog/2019/oct/01/bugfix-releases/

-- 
You received this message because you are subscribed to the Google Groups 
"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/94382ACE-5E45-4BE5-BE4E-9AA900B425E2%40gmail.com.


Re: Database connection closed after each request?

2019-10-01 Thread deb.dasit2013
Hi Mike,
I tried with custom persistent connection, but results in same error. My 
environment is Django + postgres + nginx + gunicorn

On Saturday, August 29, 2009 at 5:38:58 PM UTC+5:30, Mike wrote:
>
> Hi, 
>
> I made some small custom psycopg2 backend that implements persistent 
> connection using global variable. With this I was able to improve the 
> amount of requests per second from 350 to 1600 (on very simple page 
> with few selects) Just save it in the file called base.py in any 
> directory (e.g. postgresql_psycopg2_persistent) and set in settings: 
>
> DATABASE_ENGINE to projectname.postgresql_psycopg2_persistent 
>
> Here is a source: http://dpaste.com/hold/86948/ 
>
> # Custom DB backend postgresql_psycopg2 based 
> # implements persistent database connection using global variable 
>
> from django.db.backends.postgresql_psycopg2.base import DatabaseError, 
> DatabaseWrapper as BaseDatabaseWrapper, \ 
> IntegrityError 
> from psycopg2 import OperationalError 
>
> connection = None 
>
> class DatabaseWrapper(BaseDatabaseWrapper): 
> def _cursor(self, *args, **kwargs): 
> global connection 
> if connection is not None and self.connection is None: 
> try: # Check if connection is alive 
> connection.cursor().execute('SELECT 1') 
> except OperationalError: # The connection is not working, 
> need reconnect 
> connection = None 
> else: 
> self.connection = connection 
> cursor = super(DatabaseWrapper, self)._cursor(*args, **kwargs) 
> if connection is None and self.connection is not None: 
> connection = self.connection 
> return cursor 
>
> def close(self): 
> if self.connection is not None: 
> self.connection.commit() 
> self.connection = None 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/00ae685a-16c9-443e-92be-5150eddbf27a%40googlegroups.com.