Re: Query Distances from User

2012-07-24 Thread Markus Gattol
I see. You could use geolocation and still let the user input his location 
manually though even after you got a result via geolocation. The manual 
result via geocoding you can do in various ways like simple 'user puts in 
address, lat/lng is returned' or maybe even 'user drags marker to his 
position on map, lat/lng is returned'. Several ways to do it really. I'd 
however still use geolocation as a first step to aid user comfort and leave 
it to the user to decide whether or not he wants to correct his location if 
necessary/desired.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jgAhtvlbIfIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Query Distances from User

2012-07-24 Thread Markus Gattol
You're mistaken if you think only mobile devices support geolocation 
queries; current Chrome for example supports it already

 - info: https://developers.google.com/maps/articles/geolocation
 - test your browser: 
http://hpneo.github.com/gmaps/examples/geolocation.html

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/A22jTtb-BKMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



template filter to split string

2012-07-19 Thread Markus Gattol
within the head section of my base.html I am using


{% block title %}
{% if request.path_info == '/' %}
home
{% else %}
{{ request.path_info | slugify }}
{% endif %}
{% endblock %}


to set the title of a page. Certainly slugify isn't perfect so I am looking 
for a filter to turn the request.path string from e.g. /foo/baz/bar into 
bar Is there an easy way to do this or will I end up writing my own filter?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qqi9dTGtc5UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Query Distance from User

2012-07-15 Thread Markus Gattol
I can also recommend https://github.com/HPNeo/gmaps as a wrapper, speeds up 
and simplifies dealing with Google's API a lot.

On Sunday, 15 July 2012 17:30:16 UTC+2, Markus Gattol wrote:
>
> You can use geolocation 
> https://developers.google.com/maps/articles/geolocation and if that's not 
> accurate enough let the user provide his address and with it query Google's 
> https://developers.google.com/maps/documentation/javascript/geocoding API
>
> The tricky bit here is if you want to get the lat/lng back onto your 
> server so you can store it in your database. I ended up using 
> https://github.com/abourget/gevent-socketio and store stuff in MongoDB 
> using mongoengine.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/GlhayzaEkwUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Query Distance from User

2012-07-15 Thread Markus Gattol
You can use geolocation 
https://developers.google.com/maps/articles/geolocation and if that's not 
accurate enough let the user provide his address and with it query Google's 
https://developers.google.com/maps/documentation/javascript/geocoding API

The tricky bit here is if you want to get the lat/lng back onto your server 
so you can store it in your database. I ended up using 
https://github.com/abourget/gevent-socketio and store stuff in MongoDB 
using mongoengine.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/k9QDjpoVxMgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Internationalized URL different per language

2012-07-13 Thread Markus Gattol
Have a look at https://github.com/trapeze/transurlvania

On Friday, 13 July 2012 21:48:54 UTC+2, galgal wrote:
>
> I need to make an urlpattern different for each language, but following to 
> the same view.
>
> for example:
> url(r'^category/(?P[\w-]+)/, 'news.views.category', 
> name='category'), in english
> url(r'^kategoria/(?P[\w-]+)/, 'news.views.category', 
> name='category'), in polish
>
> if you have EN set, "kategoria" won't work. Is it possible?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jkYLDa4jVZQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: geocoding - getting latlng from JavaScript, send to server, store into MongoDB

2012-07-03 Thread Markus Gattol
Answering to my own question: this is what I ended up using 
http://dajaxproject.com/maps/ to send coordinates (latlng) back to the 
server (from the users browser) and then store it in MongoDB. I can then 
easily query MongoDB for near points, send the data back to the users 
browser and draw markers on the map. Good stuff!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/wz2zVQcUbKgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



geocoding - getting latlng from JavaScript, send to server, store into MongoDB

2012-07-02 Thread Markus Gattol
Hi folks,

I am using https://github.com/hmarr/mongoengine and Django 1.4 for my 
current project. MongoDB allows for easy geo queries e.g. you have one 
latlng and want all other points in your database within a certain 
radius...  all that's fine and working already.

Now I want to use Google Maps API v3 to do geocoding ie a user inputs an 
address which I ship off to Google to return with the latlng value to stick 
into MongoDB so I can do my radius queries (the point I was referring to 
above). Geocoding is done using JavaScript running on the users browser 
https://developers.google.com/maps/documentation/javascript/geocoding ie I 
need to get that latlng info (in a JavaScript variable) from the users 
browser onto my server and from there into MongoDB. Storing stuff into 
MongoDB is straight forward, I am not sure about how to get the latlng info 
onto my server though.

Should I simply issue a HTTP POST from JavaScript or decode to JSON and do 
an AJAX call to my server? I am no Django expert yet but maybe there is 
some simpler way to get the latlng information from the JavaScript variable 
and stick it into a request.POST so I can grab it from within a view (just 
as you do it with forms)?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xdzml63oIzsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: online transactions with python

2012-01-31 Thread Markus Gattol
https://github.com/agiliq/merchant the braintree backend is good, so is 
stripe. Depends on your type of transaction and the pricing you get.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/bZO5GTdC9C0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Could someone please give some suggestions about how to set up email sending settings on production.

2012-01-19 Thread Markus Gattol
you either use your own MTA (e.g. postfix) or you use a third party such as 
Amazon SES for which there is a Django application: 
https://github.com/hmarr/django-ses

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/AfpNMgNw07gJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Alternatives to celery

2012-01-16 Thread Markus Gattol
Have a look at https://github.com/dmgctrl/django-ztask It's based on 
ZeroMQ, you can schedule and background tasks in various ways, same machine 
or even across the network.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BFHmXHBbRVsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Simple task dispatching (How heavy is celery + RabbitMQ)

2011-11-28 Thread Markus Gattol
You don't need to roll your own... have a look at 
https://github.com/dmgctrl/django-ztask It's based on ZeroMQ and really 
lightweight compared to any alternative with a broker (yes, it's brokerless 
but that's a good thing I think for most use cases which don't really need 
a broker).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xcmtk-oHe6wJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: help_text line continuation

2011-11-14 Thread Markus Gattol
have a look 
at http://www.markus-gattol.name/ws/python.html#multi-line_strings_expressions 
...it's the same for statements, just put stuff inside ( and )

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/CL-ZY2kTqPoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ZeroMQ / Mongrel2

2011-11-07 Thread Markus Gattol
Maybe sombody has given http://code.google.com/p/django-dmq and Mongrel2 a 
spin already and can report how it went? The reason I am interested is 
because it would allow me to get rid of WSGI altogether and have this stack 
(ZeroMQ being directly Mongrel2 for example):



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lTS_fz9GVYIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Ajax replacement in django

2011-10-12 Thread Markus Gattol
If you don't want to do AJAX but still need to have a bidirectional link 
between client and server then websockets is probably what you want.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-K2_KvDu24UJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: PayPal Adaptive Payments

2011-10-08 Thread Markus Gattol
Rather than reinventing the wheel take a look at 
https://github.com/agiliq/merchant It's possible to split one payment into 
90,5,5 as you want, all you need to do is write a little logic atop 
merchant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mnMNCxghPLsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol

>
>
> Your STATICFILES_DIRS should not be set to static.
> Create a new theme directory, put your files there and update your 
> STATICFILES_DIRS.
> Have a look at 
> http://www.linovia.com/blog/django-staticfiles-troubleshooting/ for an 
> example.
>

Yeah, read that post and I disagree. Introducing yet another name on the 
filesystem (theme) certainly isn't helping people (this thread and many 
others show there's enough confusion already). It makes more sense to have a 
1:1 mapping between variable naming in settings.py and directories on the 
filesystem e.g. STATIC_ROOT to static_root, STATIC_DIRS to static/. 
Plus, Django is not Joomla or Plone or... so thinking in terms of "themes" 
is semantically wrong as it makes you think of Django as a CMS (one layer to 
high).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/qWxdPCVJEucJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol
Here's what I think is semantically good distinction:

PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))   (that's the dir 
containing your settings.py, that dir is usually one dir below your 
virtualenv, I simply name it "pr". You can then use PROJECT_ROOT to 
reference such as:

STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static_root')
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(PROJECT_ROOT, 'static/css'),
os.path.join(PROJECT_ROOT, 'static/img'),
os.path.join(PROJECT_ROOT, 'static/js'),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)


PROJECT_ROOT, "pr" on the filesystem is what you get when you 
run django-admin.py startproject pr after you run mkvirtualenv foo.com 
(foo.com would then be the root of your virtualenv; some also call it 
SITE_ROOT in Django context because they keep web server config, Sass files, 
etc. there). Here's the dir structure I came to enjoy, also because it maps 
nicely to the settings posted above:

sa@sub:~/0/2/sr$ type tad2; tad2
tad2 is aliased to `tree  --charset ascii -ad -L 2  -I 
\.git*\|*\.\~*\|*\.pyc'
.
|-- bin
|-- cache
|-- gems
|   `-- bin
|-- include
|-- lib
|-- log
|-- pid
|-- pkg
|-- pr
|   |-- apps
|   |-- config
|   |-- docs
|   |-- etc -> etcs/development/
|   |-- etcs
|   |-- fixtures
|   |-- formats
|   |-- libs
|   |-- media
|   |-- media_root
|   |-- static
|   |-- static_root
|   |-- templates
|   `-- tests
|-- sass
|-- share
|-- sock
`-- tmp

28 directories
sa@sub:~/0/2/sr$ 



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Xs6NRQ1d-HcJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: STATIC_ROOT confusion

2011-10-08 Thread Markus Gattol
if your STATICFILES_DIRS tuple contains '/a/b/static/img' then it will work 
if you put foo.jpg into /a/b/static/img/foo.jpg and have STATIC_URL = 
'/static/'. STATIC_ROOT doesn't have something to do with that, it's used to 
collect static stuff like CSS files from your apps etc. I think if people 
would set STATIC_ROOT = os.path.join(PROJECT_DIR, 'static_root') it would be 
less confusing to them anyway. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/67SZ7EP1ALQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Web Designer

2011-09-26 Thread Markus Gattol
I'd say most people us a simple text editor such as Vim, Emacs... If you use 
runserver and and your browsers auto-reload for that tab then that's all you 
need. If you want to be a bit speedier then you can use things like 
Sass/Compass for your CSS and maybe HamlPy for your HTML. Both have "watch" 
commands that watch your .sass/.haml files and automatically create the 
.css/.html which would then be picked up be runserver which in turn gets 
reloaded by your browser's tab for which you set the autoload toggle.

for HTML
 - https://github.com/jessemiller/HamlPy

for CSS
 - https://github.com/chriseppstein/compass (is written in Sass)
 - https://github.com/nex3/sass

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TeaOlJLTbK0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Platform system with Django?

2011-09-26 Thread Markus Gattol
Have you had a look at the sites framework yet: 
https://docs.djangoproject.com/en/dev/ref/contrib/sites/ That might just be 
what you're after...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PCEgsyKf-ywJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Virtualenv and Django in Production

2011-09-20 Thread Markus Gattol
 - it's just symlinks i.e. not more overhead
 - you won't clutter your system Python or vice versa when you up/downgrade 
something
 - easy to 
detect http://www.markus-gattol.name/ws/python.html#detect_a_virtualenv
 - if you want a production setup use e.g. gunicorn/nginx or even better 
uwsgi/mongrel2
 - as all the others here, I can strongly recommend using a virtualenv for 
production as well as for development

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QZpISAJq0cEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



two independent Django sites, one user - share User objects

2011-09-12 Thread Markus Gattol
Say I have n (e.g. three) independent Django sites and one user. Rather than 
having n times a password/username I'd like to share this across all n 
sites. Also a users profile [0] and so forth. Now assume I don't want to use 
OpenID, how would I be able to have User objects in sync across n Django 
sites? Maybe using ZeroMQ and have each Django site listen to some actions 
on other Django sites and then replay whatever action takes place on all 
Django sites?


[0] 
https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/8wLFTRFTbG4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django-ztask

2011-06-09 Thread Markus Gattol
since you want feedback, that's 
http://www.reddit.com/r/Python/comments/hve19/django_zeromq_djangoztask/
probably something to watch :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.