Re: How to generate points kilometers from a road

2021-01-06 Thread hunter.cur...@gmail.com
Have a look at the GEOSGeometry 
class:  https://docs.djangoproject.com/en/3.1/ref/contrib/gis/geos/#geosgeometry
If you just want to specify a location along a linestring, try the 
interpolate method.

On Tuesday, January 5, 2021 at 7:23:43 AM UTC-7 jfa...@inerza.com wrote:

>
> Exactly, what I need is to calculate the point on the road from the 
> kilometer point PK 50 + 350 meters on the road, but not in a straight line 
> but following the road  
>
> El martes, 5 de enero de 2021 a las 14:12:56 UTC, Juan Carlos F. escribió:
>
>> Hi everybody
>>
>> I am new and I need to know if the library or how I could generate the 
>> kilometer points starting from a polyline. 
>>
>> Thanks for the info  
>>
>

-- 
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/f598f572-6aad-40b0-b41c-ab19aaa77b30n%40googlegroups.com.


Re: Docker: NGINX, Postgres, Django, Static, Media Files

2019-07-14 Thread hunter.cur...@gmail.com
Probably the easiest way to do what you are looking for is to use 
cookiecutter-django: https://github.com/pydanny/cookiecutter-django

They are now using Caddy for the web server but if you look in earlier 
versions there are good examples of how to use Nginx if that is your 
preference.

On Sunday, July 14, 2019 at 6:48:09 AM UTC-6, Sebastian Jung wrote:
>
> Hello,
>
> i want i complete ready Docker Container for production that accept all 
> Host of wourld on port 80. I want a docker container for Nginx another for 
> Postgres another for Django and static Files and another container for 
> Media Files. I have not enought experience to get a manual like this: 
> https://github.com/Pawamoy/docker-nginx-postgres-django-example
>
> Can someone give me a package to download?
>
> Regards
>

-- 
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/7f79b866-a45f-4f48-89a4-4c6d79d22bfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Celery/Redis Django 2.0 Design Question

2018-10-28 Thread hunter.cur...@gmail.com
I think you are on the right track. I am doing something similar with 
photos and gps tracks uploaded by users and the celery/redis combo makes it 
easy to run a compute intensive task without blocking the site.
I'm not sure if the celery-signals approach is strictly necessary, 
however.  I am following the architecture laid out in cookiecutter-django  
(using docker) where the 
celery container is a copy of the django container.
That way, when the transformations are complete, the celery task can just 
issue a django style create or update command to access the database.

Good luck!
dave

On Saturday, October 27, 2018 at 6:13:19 PM UTC-6, mark wrote:
>
> I am building a django 2.x site to:
> * upload documents (images, pdfs, and videos)
> * apply metadata to the documents (JSON metadata field)
> * transform the documents (thumbnails, OCR, language translations, image 
> conversion, facial recognition, image blurring, etc.) based on some of the 
> metadata fields
> * display the documents
>
> Since the document transformations are fairly resource intensive and time 
> consuming, I am thinking of using celery to build a state machine for the 
> transformations, using celery tasks to transform the images, and celery 
> signals to update the state of the document as the transformations complete 
> successfully. I looked at django-fsm for this, but I think it will be 
> better to run the transformations as celery tasks than to block the site. 
>
> Does this plan make sense, or am I missing something regarding django and 
> celery/redis.
>
> Thanks!
>
> Mark
>

-- 
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/70a447cf-312a-42dd-9eaf-24db3ef238b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to combine a custom date and time field in Django?

2018-03-26 Thread hunter.cur...@gmail.com
Using database time functions is a bit of a hassle since each database 
seems to have its own syntax for these types.
If you are using MySQL, the function you are calling will only return a 
DATE field, in this case you want to use TIMESTAMP with the parameters all 
combined in a single text string.  
See:  
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_timestamp

For SQLite, you would use datetime, 
see: https://www.sqlite.org/lang_datefunc.html

For PostgreSQL, you would use make_timestamp, 
see https://www.postgresql.org/docs/10/static/functions-datetime.html

Assuming you are using MySQL, I think your code should look like this (not 
tested):

class MyModel(models.Model):
   my_time_field = TimeField()

custom_date = datetime.date.today()  # note the correct calling sequence
objects = MyModel.objects.annotate(
custom_datetime=Func(
custom_date.isoformat() + ' ' + F('my_time_field'),
function='TIMESTAMP'
))



On Sunday, March 25, 2018 at 10:51:25 AM UTC-6, Nirmal Raghavan wrote:
>
> I'm looking for a way to combine a custom date value and a time field in 
> django. My model only contains a time field. Now I have to annotate a new 
> field combining a custom date and the time field. I thought the following 
> code will slve my problem, but it only gives the date value. TimeField is 
> ignored.
>
> Please advise the right way to solve this issue.
>
> class MyModel(models.Model):
>my_time_field = TimeField()
>
> custom_date = datetime.today().date()
> objects = MyModel.objects.annotate(
> custom_datetime=Func(
> custom_date + F('my_time_field'),
> function='DATE'
> ))
>
>

-- 
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/60231531-06ac-45fc-b319-5af780a4c429%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Sample of GeoDjanco websites

2018-03-20 Thread hunter.cur...@gmail.com
I've been using geodjango for a few years now and it's quite useful.
I wrote some blog posts about setting up a server 
here:  https://geoanalytic.github.io/
although some of the info is in need of an update it does discuss using 
leaflet on the front end.

I'd also recommend checking out Geonode, which is a geodjango based 
project: http://geonode.org/
Dave

On Monday, March 19, 2018 at 1:29:04 PM UTC-6, Ezequias Rocha wrote:
>
> Hi
>
> I would like to know if there is any list of websites that are using 
> GeoDjango on the web.
>
> Could anyone tell me if you have experiences putting Leaflet in the 
> frontend and GeoDjango in the backend (geoprocessing).
>
> Sincerely
> Ezequias
>

-- 
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/71ea56da-d52b-499c-ac7a-c4a2ee9588a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pivot Table in django

2018-01-31 Thread hunter.cur...@gmail.com
You could use this library:  https://github.com/martsberger/django-pivot

On Wednesday, January 31, 2018 at 4:55:48 AM UTC-7, harshvardhan singh 
wrote:
>
> Can anyone give me the guidance for "How to build a pivot table in Django"?
> I want to implement something like this: 
> https://pivottable.js.org/examples/
>

-- 
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/5c525f9e-adaa-4e4a-8d37-7d2c652a879a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango with Docker

2016-12-01 Thread hunter.cur...@gmail.com
Hi Tadeo, I've recently gone through this exercise myself, and documented 
my progress in three posts:
https://geoanalytic.github.io/a-production-ready-web-mapping-toolkit-part-1/
https://geoanalytic.github.io/a-production-ready-web-mapping-toolkit-part-2/
https://geoanalytic.github.io/a-production-ready-web-mapping-toolkit-part-3/

It's based on Ubuntu but you should be able to move it to Alpine without 
too much effort.
Dave

On Wednesday, November 30, 2016 at 10:02:59 AM UTC-7, Tadeo C wrote:
>
> Hi, I'm starting a project with GeoDjango and I want to use Docker 
> containers to build the stack (GeoDjango, Nginx, Postgis) preferably Alpine 
> base images.
> Does anyone has successful done this before? Where can I find a useful 
> docker-compose.yml or a tested and working updated image?
> Thanks a lot,
> Tadeo
>

-- 
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/3f10a892-c65d-4f5e-96ce-cca55295c33f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.