Running a celery worker as a windows service

2018-06-21 Thread Mohammed Noor
Hello guys, I have a celery worker that I need to be running on a server 24/7. Currently, I am running it in a cmd window. But I need to convert this to a background windows service so that it can run always without the danger of being closed by anyone. Any ideas how this can be done? Regards,

Re: python inspectdb got "The error was: function unnest(smallint[]) does not exist"

2018-06-21 Thread Melvyn Sopacua
On woensdag 20 juni 2018 19:12:00 CEST weiwei.hs...@keeptruckin.com wrote: > When I run "python3 manage.py inspectdb", I got below error messages: > > > # Unable to inspect table 'eld_messages' > > # The error was: function unnest(smallint[]) does not exist > > HINT: No function matches the g

Is it possible to construct reversible url names in urls.py using , regex etc

2018-06-21 Thread Mikkel Kromann
I have a lot of models (say 30 or 40) which are so similar, that I have handled them using slightly modified class based views. In urls.py: urlpatterns = [ path('list//',ItemListView.as_view()), path('create//', ItemCreateView.as_view()), path('update//', Ite

Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
Hi All, I have a store address form in Django which have fields like- name, address, location, latitude, longitude etc. I am autofilling the latitude, longitude fields based on address with the help of django package-https://github.com/caioariede/django-location-field In django view after the

Re: Is it possible to construct reversible url names in urls.py using , regex etc

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 10:19:08 CEST Mikkel Kromann wrote: > However, I'd really like to give all my urls names so that they can be > easily reversed (e.g. success links). > urlpatterns = [ > path('list//',ItemListView.as_view(), name= > mName+'_list'), > ] > > From what I

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 10:42:09 CEST prateek gupta wrote: > Issue is in database , latitude/longitude values are blank. > > What I am doing wrong here? Why do you not understand your own code? How did you get that code - you explicitly code it so that it they do NOT end up in the database. S

Re: Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
Thanks for reviewing the code. I am new to Django and just tried to put logic from googling to achieve my goal. That's why I don't understand my code completely. Can you please point out where I am doing this and how can I change this behaviour? On Thursday, June 21, 2018 at 2:48:46 PM UTC+5:

How to select one checkbox at one time DJANGO.

2018-06-21 Thread Sunil Kothiyal
I want to show and hide text input box on checkbox selection. If someone select business should show textbox. Otherwise hide it. TWO_CHOICES = ( ('1', 'Business'), ('2', 'Indivitual'), ) business_or_individual = forms.ChoiceField(required=True, widget=forms.CheckboxSelectMultiple,choices=TWO_C

Re: How to select one checkbox at one time DJANGO.

2018-06-21 Thread Jason
use a radio. https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#radioselect https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio Only one radio button in a given group can be selected at the same time On Thursday, June 21, 2018 at 6:15:34 AM UTC-4, Sunil Kothiyal wro

Re: Running a celery worker as a windows service

2018-06-21 Thread Jason
there's documentation on this http://docs.celeryproject.org/en/latest/userguide/daemonizing.html but not sure if they're compatible with windows. On Thursday, June 21, 2018 at 3:50:03 AM UTC-4, Mohammed Noor wrote: > > Hello guys, > > I have a celery worker that I need to be running on a server

How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Hi All, I need your help in one task. I have created a address form in Django 2.0.6 + Python3.6. In this form once user entered the address, the location field is auto filled with latitude,longitude as below screen shot-

Re: How to select one checkbox at one time DJANGO.

2018-06-21 Thread Sunil Kothiyal
Thank You. Its worked for me. But i am not able to show hide text input on radio button click. Can you help me? On Thu, Jun 21, 2018 at 4:00 PM Jason wrote: > use a radio. > https://docs.djangoproject.com/en/2.0/ref/forms/widgets/#radioselect > > https://developer.mozilla.org/en-US/docs/Web/HTM

Re: How to select one checkbox at one time DJANGO.

2018-06-21 Thread Jason
If you want dynamic behavior on a page as a result of interaction, you're going to have to use javascript. -- 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 dja

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jason
You've been posting here about this regularly (at least four times) with no responses. I don't think anyone here knows how to solve your problem. what else have you looked at? eg, have you asked on stack overflow or other places? -- You received this message because you are subscribed to th

Re: Why some Django fields are not saved in database?

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 11:31:26 CEST prateek gupta wrote: > Thanks for reviewing the code. > > I am new to Django and just tried to put logic from googling to achieve my > goal. > That's why I don't understand my code completely. Try to understand it before applying. The main issue you're fac

Re: Why some Django fields are not saved in database?

2018-06-21 Thread prateek gupta
Thanks for sharing this, I will do the same first. On Thursday, June 21, 2018 at 5:55:42 PM UTC+5:30, Melvyn Sopacua wrote: > > On donderdag 21 juni 2018 11:31:26 CEST prateek gupta wrote: > > > > > Thanks for reviewing the code. > > > > > > I am new to Django and just tried to put logic from g

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Got it Jason, I will not post anymore now. On Thursday, June 21, 2018 at 5:31:13 PM UTC+5:30, Jason wrote: > > You've been posting here about this regularly (at least four times) with > no responses. I don't think anyone here knows how to solve your problem. > what else have you looked at? eg

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Julio Biason
Hi Prateek. You're using Google Maps for the lat/long, right? In this case, I'd suggest that, on the function you receive the data and update the field, you also make a request to some URL to update the lat/long of the current displayed object. On Thu, Jun 21, 2018 at 9:29 AM, prateek gupta wro

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Melvyn Sopacua
On donderdag 21 juni 2018 14:29:17 CEST prateek gupta wrote: > Got it Jason, I will not post anymore now. Well, not the same question at least. The second one was better, since it was specific. What you're asking with this question is too broad and doing it on stackoverflow will yield the same r

Re: Running a celery worker as a windows service

2018-06-21 Thread Mohammed Noor
Thanks. I solved it by writing a batch file to run the celery worker and creating a windows task to run the batch file. On Thu, Jun 21, 2018 at 4:03 PM, Jason wrote: > there's documentation on this http://docs.celeryproject.org/en/latest/ > userguide/daemonizing.html > > but not sure if they're

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jason
Uh, that's not what I mean. You had asked this question multiple times and gotten no response back. If you're relying on this group for your only source of help, that means you lost quite a bit of time getting this done. Where else were you looking? What other options did you try to use? On

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
Thanks for your reply. I was trying to first use in built django library for that https://github.com/caioariede/django-location-field It is showing me a map with location field(conaining latitude,longitude) But I want to save the latitude/longitude values in DB so I am not seeing any way in this

RE: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Matthew Pava
Based on the information of that project, it does not support Django passed version 1.10. What version are you using? Saving of the location should be automatic based on my understanding of that package. You may want to contact the author of that package to get more help. From: django-users@goo

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread Jani Tiainen
Hi, First I really suggest you to take a look at Django GIS functionality. It requires few libs to be installed but gives you tons of functionality. Including fields that can show geometry on map. Next problem is that you want to convert physical address to coordinates. Process is called geocodin

Re: How to fill latitude and longitude values from an existing location field in Django+Python?

2018-06-21 Thread prateek gupta
I am using Django 2.0.6 and yes I am able to use this package . This package is currently showing a map below the address and once I enter the address; it fill the location field and changes the map according. On Thursday, June 21, 2018 at 7:41:22 PM UTC+5:30, Matthew Pava wrote: > > Based on the

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread C. Kirby
Ok, this is good to work with. Let us tackle this issue by issue. The first issue is that your modal is not showing up. I see several possible issues: Replace Click here to show the modal with Create a new wafer design Having the href in the a tag makes it want to load to a new page, but a

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread Alexander Joseph
Awesome! Thanks Kirby, I will try that out and let you know On Thu, Jun 21, 2018 at 10:12 AM, C. Kirby wrote: > Ok, this is good to work with. Let us tackle this issue by issue. The > first issue is that your modal is not showing up. I see several possible > issues: > > Replace > Click here to

Re: saving django session data for anonymous user

2018-06-21 Thread Melvyn Sopacua
On woensdag 13 juni 2018 14:40:05 CEST Siddharth Srivastava wrote: > Thanks Anthony for your prompt reply. current implementation is that i am > using django orm query to pull the user cart details and cart id(session > key) is the key so when user switch from anonymous > user to actual user then

RE: How to fill latitude and longitude values from an existinglocation field in Django+Python?

2018-06-21 Thread Himanshu Gamit
Prateek, Have you tried this module? http://django-map-widgets.readthedocs.io/en/latest/ Thanks Himanshu Sent from Mail for Windows 10 From: prateek gupta Sent: Thursday, June 21, 2018 10:32 AM To: Django users Subject: Re: How to fill latitude and longitude values from an existinglocation fiel

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread Melvyn Sopacua
I have a lot of this stuff worked out, but for Bootstrap 3. I've done this in a UX library I've used for various projects, so it's kinda of a need-driven collection of widgets, CBV's and form components - not exactly something for general use. I've made it available on Gitlab, so you can see h

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread Alexander Joseph
Thanks Melvyn! I will definitely take a look at that. From some of the tutorials it sounds like there are some differences between Bootstrap3/4 in how the ajax calls would need to be structured but I'm interesting in seeing your approach On Thu, Jun 21, 2018 at 1:03 PM, Melvyn Sopacua wrote: > I

Re: Forms in Bootstrap 4 Modals?

2018-06-21 Thread Alexander Joseph
So I changed the link to the button as you suggested, and put the static modal in the gaas_wafer_design_list.html file, and commented out the javascript at the bottom, and the modal is showing up as it should now. Heres my gaas_wafer_design_list.html file, highlighted with the changes {% exten

Re: Django Channels 2.0 - How to init and persist/communicate with only one instance of background worker for every channel_layer.send?

2018-06-21 Thread Andrew Godwin
The worker server tries to keep one application instance open per incoming channel name, but that's no guarantee. It will always make a new instance for different channel names. What kind of behaviour are you expecting? Andrew On Tue, Jun 19, 2018 at 6:45 AM itsnate_b wrote: > I am using Django

prevent AppConfig.ready() from running twice

2018-06-21 Thread clavierplayer
Hello, I am still new to Django, so I apologize if this seems like a silly question. I've not been able to find what I need on Google, StackOverflow, or the Django Docs. I am using Django 2.0.5. I understand that the correct way to run startup code is to subclass AppConfig and override ready(

How to run python script by clicking a HTML button?

2018-06-21 Thread SUBHENDU PANDA
Below is my HTML code... HTML Forms First name: I want is : If you I the "Submit" button, the form-data will be sent to a page called "/myscript.py and will perform the operation". myscript.py: import os def f1(): print ("Below are the files present in yo

Re: How to run python script by clicking a HTML button?

2018-06-21 Thread Jani Tiainen
Hi, Django doesn't exactly work that way. Please do the official tutorial from Django docs to get grasp of basics how things works and are tied together. to 21. kesäk. 2018 klo 23.15 SUBHENDU PANDA kirjoitti: > Below is my HTML code... > > > > > > HTML Forms > > > First name: > > >

Channels 2.0 close code and http response status

2018-06-21 Thread Kirill Tyushchakov
Hello everyone! I'm new in Django Channels. I'm using Channels 2.0 and I have few questions about it. I'm using JsonWebsocketConsumer class for my consumer and I wrote my definition of connect method like this: def connect(self): user = self.scope.get('user') if user.is_anonymous:

Channels 2.0, How can I configure the channels 2.0 to use with the default django's views

2018-06-21 Thread Franklin Sarmiento
Hi everyone!, I'm new with the channels topic, I'm learing the version 2.0, I have a doubt, How can I configure the channels 2.0 to use with the default django's views Thanks a lot -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Invalid URLs passing validation by URLValidator

2018-06-21 Thread Tim Bell
Hi, I've come across some strings which I think aren't valid URLs that nevertheless pass validation by django.core.validators.URLValidator in Django 2.0.6 and 1.11.13. I know URL validation is very tricky, but these seemed to me that they should obviously fail. http://#FOO#/b...@example.com I

Django says a modification was made to Auth user when I didn't, and migration has a timestamp from the future. Help?

2018-06-21 Thread JJ Zolper
Hey everyone, So I did inherit this from someone else but I cannot phanthom how a change to the django auth user would be maintained by git between developers. For some reason when I run makemigrations it thinks the django auth user email field needs to be altered via migration? I'm so lost an

Re: Django says a modification was made to Auth user when I didn't, and migration has a timestamp from the future. Help?

2018-06-21 Thread JJ Zolper
It's Jun 21 at 11:30 pm in my world fyi. On Thursday, June 21, 2018 at 11:34:50 PM UTC-4, JJ Zolper wrote: > > Hey everyone, > > So I did inherit this from someone else but I cannot phanthom how a change > to the django auth user would be maintained by git between developers. > > For some reason