Re: Run manage.py test app_name command from view

2017-11-26 Thread Matemática A3K
On Mon, Nov 27, 2017 at 3:21 AM, Joshua O. Morales < joshuao.morale...@gmail.com> wrote: > I tried it out, but I'm still getting 400 error. > 400 means "Bad Request", if was something wrong inside the view, the server should return a 500 (Internal Server Error). I think probably it isn't executin

Re: Run manage.py test app_name command from view

2017-11-26 Thread Joshua O. Morales
I tried it out, but I'm still getting 400 error. I attached a copy of the tests.py of the app. Maybe you'll find something I can't. views.py: from django.shortcuts import render from django.core.management import call_command def start_scraping(request): call_command('test','seleniumapp')

Re: How to select the proper column when I use ForeignKey?

2017-11-26 Thread Matemática A3K
What Django shows in that dropdown is the __str__() method of the object, define it to your needs in A :) On Sun, Nov 26, 2017 at 7:49 PM, Kubilay Yazoğlu wrote: > Hello. I have two models. In one of them, I declared a foreign key to the > other one. Since this is done in Django by only specifyi

Re: How do I limit my login form to just email and password?

2017-11-26 Thread Matemática A3K
On Sun, Nov 26, 2017 at 8:57 PM, Tom Tanner wrote: > Adding `exclude=["username"]` does nothing. Same if I replace "username" > with "email" or "user". > it's one or another, you either use 'include' or 'exclude' > > On Sunday, November 26, 2017 at 2:44:44 PM UTC-5, Matemática A3K wrote: >> >>

Re: How do I limit my login form to just email and password?

2017-11-26 Thread Tom Tanner
Adding `exclude=["username"]` does nothing. Same if I replace "username" with "email" or "user". On Sunday, November 26, 2017 at 2:44:44 PM UTC-5, Matemática A3K wrote: > > > > On Sun, Nov 26, 2017 at 12:55 AM, Tom Tanner > wrote: > >> My `models.py` has this: >> class MyUser(AbstractBaseUser):

How to select the proper column when I use ForeignKey?

2017-11-26 Thread Kubilay Yazoğlu
Hello. I have two models. In one of them, I declared a foreign key to the other one. Since this is done in Django by only specifying the Class name, without specifying the field name(column name), when I try to create an object in admin panel, it pulls the wrong column information. Two models A

Re: How to configure NGINX to run Django app in a subpath?

2017-11-26 Thread Matemática A3K
I don't know / remember how to do it in Gunicorn, but here is an example with uWSGI: https://stackoverflow.com/questions/35792409/nginx-serving-django-in-a-subdirectory-through-uwsgi The main thing is that you will have to deal with "/pmapp" prefix in your routing / urls. You can deal with this in

Re: How to configure NGINX to run Django app in a subpath?

2017-11-26 Thread mohammad k
https://jee-appy.blogspot.com/2017/01/deply-django-with-nginx.html On Sun, Nov 26, 2017 at 11:26 PM, Luca Moiana wrote: > Hi, > > Sorry for the slight OT but after days of search I have no clue. > > > Following this DigitalOcean tutorial >

Re: How do I limit my login form to just email and password?

2017-11-26 Thread mohammad k
forms.py : class LoginUserForm(forms.Form): email = forms.CharField( widget=forms.EmailInput(attrs={'autofocus': True, 'placeholder': 'Email'}), required=True, label='Email :', max_length=255 ) password = forms.CharField( widget=forms.PasswordInp

How to configure NGINX to run Django app in a subpath?

2017-11-26 Thread Luca Moiana
Hi, Sorry for the slight OT but after days of search I have no clue. Following this DigitalOcean tutorial I was able to setup Django + Postgres + Gunicorn + NGINX running D

Re: How do I limit my login form to just email and password?

2017-11-26 Thread Matemática A3K
On Sun, Nov 26, 2017 at 12:55 AM, Tom Tanner wrote: > My `models.py` has this: > class MyUser(AbstractBaseUser): > email= models.CharField(max_length=254, unique=True) > USERNAME_FIELD= "email" > > My `forms.py` has this: > class LoginForm(AuthenticationForm): > email= forms.EmailField(label=_

Re: Run manage.py test app_name command from view

2017-11-26 Thread Matemática A3K
On Sun, Nov 26, 2017 at 11:03 AM, Joshua O. Morales < joshuao.morale...@gmail.com> wrote: > What I would like to do is to execute the tests.py by clicking a certain > button. I am trying to run the tests.py via views.py, but it gives me a > 400 Bad Request error. Is there any other solution? > Y

Re: How to define a url that does not belong to any app?

2017-11-26 Thread Kubilay Yazoğlu
SOLVED. Looks like I've done a silly mistake. Thanks for your answers though. Mistake was to write href="learnmore.html" in home page html. I changed this to href="{% url 'learnmore' %}, learnmore is the name of the view function of learnmore page. 26 Kasım 2017 Pazar 02:00:25 UTC+3 tarihinde

Re: Building a web app for use of third party python package

2017-11-26 Thread Derek
I am not aware of such a way; I think HttpResponse does a single thing. But you could create a page which embeds a link to the results file and redirect the user to that (I often find that having an "outcomes" page with some explanation is attached is helpful to the user). Like many similar

Re: Django Channels and multi-tenant will this be a world of hurt?

2017-11-26 Thread Andrew Godwin
I've never used attach-daemon so I can't help you there I'm afraid. As long as it does sensible process-management things it's probably alright? Andrew On Sat, Nov 25, 2017 at 5:17 PM, Filbert wrote: > Andrew, > Thanks for the response. Seeing that I am keeping uWSGI for the > non-websocket pat

Run manage.py test app_name command from view

2017-11-26 Thread Joshua O. Morales
What I would like to do is to execute the tests.py by clicking a certain button. I am trying to run the tests.py via views.py, but it gives me a 400 Bad Request error. Is there any other solution? Your help would be very much appreciated. Here's a snippet of the code: from django.core.manageme

Re: Wants to make webpage auto reload whenever database is update.

2017-11-26 Thread Unnati C
it's working, Thanks... On Sunday, November 26, 2017 at 11:24:39 AM UTC+5:30, Shree Kant Bohra wrote: > > Use this following code to reload page every few seconds as required - > > > setTimeout(function () { > location.reload(); > }, 60 * 1000); > > > -- > Shree Kant Bohra > Co-f

Re: Wants to make webpage auto reload whenever database is update.

2017-11-26 Thread Unnati C
I will try this. On Sunday, November 26, 2017 at 2:31:43 PM UTC+5:30, Jani Tiainen wrote: > > Hi. > > You probably could use ajax to poll data and only update visual parts > instead of reloading whole page. > > 26.11.2017 7.21 "Unnati C" > kirjoitti: > >> Thanks for suggestion Yingi Kem, But I a

Re: Wants to make webpage auto reload whenever database is update.

2017-11-26 Thread Jani Tiainen
Hi. You probably could use ajax to poll data and only update visual parts instead of reloading whole page. 26.11.2017 7.21 "Unnati C" kirjoitti: > Thanks for suggestion Yingi Kem, But I am looking for any javascript or > any other logical solution to refresh my web page automatically. > > Unnat