How to fetch latitude and longitude from location field and save them separately in db (Django 2.0.6+Python3.6)?

2018-06-20 Thread prateek gupta
Hi All, I have created a model in Django 2.0.6+Python 3.6 which maps to a table in Database i.e. store table This store table has columns- id, name, address, location, latitude, longitude. Currently user don't have to manually fill the location field, it is filled with latitude,longitude

Re: Django 1.11 Serving Large files for download ??

2018-06-20 Thread Gokul Swaminathan
Hi Julio, Thank you for that. You mean to say that we have to leave it web server rather then Django. But the files have to be authenticated based on the request. When a person requests for a file only his respective file has to be provided for download. With a bit of googling i

Re: Aggregation issue

2018-06-20 Thread Gallusz Abaligeti
Hi! Yes exactly, the ordering meta was ordering = ('company', 'financial_year',) and addig order_by('financial_year') to the QuerySet solved the problem ( https://stackoverflow.com/questions/50944536/django-aggregation-issue) Thanks, Gallusz 2018. június 20., szerda 16:23:40 UTC+2 időpontban

Re: Forms in Bootstrap 4 Modals?

2018-06-20 Thread Alexander Joseph
Actually on second thought, since this is a private github repo and theres a lot of stuff in there i wouldnt want to make public, copying it/cleaning it up to make it a public repo would be a bit of an ordeal so I'll just post my code here. So going through this tutorial -

Re: Help with context_processor

2018-06-20 Thread Mikkel Kromann
Thank you both. Clearly, I also missed some important points about dictionaries. Mistakes are good teachers, but it surely helps having competent people on a mailing list :) I'll sum up the simple solution to context processors that worked for me, if somebody would find it useful some day.

Re: Help with context_processor

2018-06-20 Thread Andréas Kühne
Hi Matthew, That's true, You would then be able to get the dictionary values once more. Hadn't thought of that. Good point! Thanks :-) Regards, Andréas 2018-06-20 15:55 GMT+02:00 Matthew Pava : > Well, you can access a dictionary like a list using these: > > items.keys(), template: > >

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

2018-06-20 Thread weiwei . hsieh
I use Amazon Redshift database and Django 2.0.6. My redshift database settings is as below: DATABASES = { 'default': { 'NAME': 'my_db_name', 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'USER': 'my_username', 'PASSWORD': 'my_password',

Re: Forms in Bootstrap 4 Modals?

2018-06-20 Thread Alexander Joseph
No problem! Thanks so much for your help, I've been struggling with this for longer than I'd like to say and havent been able to find any help. Since I'm using a lot of mixins that I'd like to use with this view I'll work my way through the CBV-based tutorial up until the spot where I'm having

Re: Forms in Bootstrap 4 Modals?

2018-06-20 Thread C. Kirby
Ok, great. I am more versed with FBVs than CBVs, but if you are doing a one form trial run I can figure it out. It sounds like you are correctly rendering javascript to the client when they do a GET for the form, but when they do a POST (either correct or with validation errors) you are

Re: I am trying to create polls project as mentiioned in the django website

2018-06-20 Thread itsnate_b
Hi Syed, Take a look at this part of the error: File "/home/ssyed/polls/bin/mysite/mysite/urls.py", line 20, in path('polls/', include('polls.urls')), NameError: name 'include' is not defined It appears that you have missed the addition of 'include' in your urls.py file. The tutorial

Re: Aggregation issue

2018-06-20 Thread Simon Charette
Hello Gallusz, This is probably caused by the `Financial.Meta.ordering` that you didn't include in your snippet. I assume it's currently defined as ('name', 'financial_year')? In order to get rid of it you'll want to clear it up using an empty call to order_by():

RE: Help with context_processor

2018-06-20 Thread Matthew Pava
Well, you can access a dictionary like a list using these: items.keys(), template: for k in items.keys items.values(), template: for v in items.values items.items(), template: for k, v in items.items From: django-users@googlegroups.com

Re: Regarding an issue

2018-06-20 Thread MTS BOUR
Well you only have /admin and /music in urls.py you need to add / when you configure your ulrpatterns Le mer. 20 juin 2018 13:47, Julio Biason a écrit : > Hi Mayank, > > You tried to access "/"; there is no url associated with this path, so > it's a 404. The only valid URLs are `/admin` and

Re: Regarding an issue

2018-06-20 Thread Julio Biason
Hi Mayank, You tried to access "/"; there is no url associated with this path, so it's a 404. The only valid URLs are `/admin` and `/music`. If you want to see something when accessing `/`, you need to create a view for it and associate it in your `urls.py`. On Wed, Jun 20, 2018 at 9:39 AM,

Re: Django 1.11 Serving Large files for download ??

2018-06-20 Thread Julio Biason
Hi Gokul, Well, since this is for intranet, you may be lucky. For large downloads, you can put your facing server (nginx, apache) to point directly to the media directory. For example, if your media files are being stored on `/srv/myserver/media`, and have an URL of `/media`, you could add a

Regarding an issue

2018-06-20 Thread Mayank Bhatia
hi all I am getting an error while creating the views when i try to run the server this Page not found (404) error is being generated. but the admin section works fine. i am attaching the image.i have also tried making migrations but nothing happened. kindly help to solve this asap. -- You

Security Check in Django

2018-06-20 Thread Jerrina Paul
Hi, We started migrating a java project to Django .Our present code we are using different filters for security. Mainly we are checking below filters · Session hijacking check · XSS attach check · CSRF check · Path manipulation check(directory traversal attack) ·

Aggregation issue

2018-06-20 Thread Gallusz Abaligeti
Hi Folks! I have a little problem in connection with aggregation through Django's ORM. The sketch of my model is very simple with some custom field types (but those types are irrelevant in the problem): # Fields types class MoneyField(models.DecimalField): def __init__(self, *args,

Django 1.11 Serving Large files for download ??

2018-06-20 Thread Gokul Swaminathan
How to serve large file for download. Also it should handle simultaneous requests. I have to serve the web application in Intranet environment. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: I am trying to create polls project as mentiioned in the django website

2018-06-20 Thread Sujad Syed
Hi, I have tried my best to do this as good as possible, but i still encountered the error. *ERROR :* (polls) ssyed@ssyed:~/polls/bin/mysite$ python manage.py runserver Performing system checks... Unhandled exception in thread started by .wrapper at 0x7f996a794598> Traceback (most recent call

Re: How to auto fill latitude and longitude fields in Django2.0.6?

2018-06-20 Thread prateek gupta
I am working in Singapore and trying to store details of different merchants of Singapore. So if any merchant wants to add a new store, I am giving him this option build on Django. So once he entered his store address, the lat/long fields will be auto-fill and location field will show the map.

Re: Help with context_processor

2018-06-20 Thread Andréas Kühne
Hi Mikkel, No - you can't loop over a dictionary that way. However - You don't need to resort to doing that either. If you want to loop over something use a list. Like this: return { 'items': [ {'name': 'year', 'readable': 'Year', 'urlname': 'year_list' }, {'name': 'region',

Re: How to auto fill latitude and longitude fields in Django2.0.6?

2018-06-20 Thread anthony.flury via Django users
You need access to a service (or data set) which translates addresses to latitude/longitude. It will depend on your country whether this information is available and/or whether you need to pay for access to that service, and how that service Which countries will your application cover - maybe