Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Hummingbird
Although I have gone through the docs of Django ORM, let me re-read
it.
Then I will come back to this thread with specific question.

Thanks for your reply.

On Jul 8, 8:57 pm, Tom Evans  wrote:
> On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird  wrote:
> > @Cal,
> > My apologies if my post has hurted you.
> > I didn't mean that.
> > I understand that all these open source projects are run by people who
> > don't get paid for it.
>
> > My point was quite different. It was about knowledge sharing.
> > We can re-phrase the question if nobody understands what we mean to
> > ask.
> > Actually, we are not asking for any exact code or any spoon-feeding.
> > We are asking whether anybody has developed a solution similar to
> > CursorAdaptor in VFP
> > Ed Leafe & Paul McNett have done marvelous work in this area (DABO
> > desktop framework).
>
> > Instead of making this post very long by giving details of what is a
> > CursorAdaptor, pl. refer to --
> >http://msdn.microsoft.com/en-us/library/d993hde7(v=vs.80).aspx
>
> > Regarding your remark of "Don't expect an instant answer"--
> > -- OP was dated 30th June.
> > Today is 8th July (an instant???)
>
> > Again, pl. excuse me if I have said anything wrong.
> > @qMax:  Have you got any way around your question?
>
> > ---Vineet
>
> Hi Vineet
>
> The problem both you and the OP have is that you asked extremely vague
> questions. I've re-read the OPs post a number of times, and all I can
> see is some extremely vague discussion on how the ORM represents
> tables as model instances. I still don't see a question there, or at
> least one I can answer.
>
> Your question is only vaguely related to the OPs (in that it deals
> with the ORM). On mailing lists, some people find replying to another
> thread with a different question of your own almost as rude as TYPING
> IN ALL CAPS. It is best to start a new thread rather than hijacking
> someone elses. Secondly, continually bumping a thread each day is also
> very annoying. Both of these things will dissuade people from replying
> to you, so bear that in mind.
>
> Netiquette apart, your question is vague. You describe a system where
> by you can update various tables, updating the ones you want. This is
> a basic feature of ORMs - have you read the tutorial or any of the
> documentation on django's ORM?
>
> I think the basic point is that you are far too vague about what you
> want. You can't just point at us at some MS relational layer
> documentation from 2005 and expect us to wade through it, work out
> what you are currently doing, work out if that is applicable to
> Django's ORM and formulate a plan for you. You are going to need to do
> some of the work yourself.
>
> There are more ORMs out there than you can imagine. You need to work
> out what you want from a framework, and evaluate the frameworks out
> there to find the suitable one for your project. We can help by
> telling you about the Django one, but you need to help by telling us
> what you want to do with it (consider creating, reading, updating and
> deleting items as something that all the frameworks will do).
>
> I think you will find people here will be willing and responsive to
> help you, once you figure out what it is that you want from Django,
> and start asking precise questions about what Django can support.
>
> Cheers
>
> Tom

-- 
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.



zyyzj想要聊天

2011-07-08 Thread zyyzj
---

zyyzj希望通过 Google 的一些最炫酷的新产品与您保持更密切的联系。

如果您已经拥有 Gmail 或 Google Talk,请访问:
http://mail.google.com/mail/b-9f0e3fbec7-176c78f291-kEyz49ybPM7nlSfYFeoG2lxHo5o
您需要点击此链接才能与zyyzj聊天。

要获取 Gmail(Google 提供的免费电子邮件帐户,存储空间超过 2,800 MB)并与zyyzj聊天,请访问:
http://mail.google.com/mail/a-9f0e3fbec7-176c78f291-kEyz49ybPM7nlSfYFeoG2lxHo5o

GmailGmail 提供以下功能:
- 可在 Gmail 上直接进行即时消息传送
- 强大的垃圾邮件防护功能
- 可用于查找邮件的内置搜索功能,以及实用的邮件整理方法(将邮件整理到“会话”中)
- 没有弹出式广告或不相干的横幅广告,只显示文字广告和与邮件内容相关的信息
以上所有功能均免费为您提供。此外,我们还提供了更多服务!开通 Gmail 帐户后,您还可以访问 Google Talk(Google 的即时消息传输服务):

http://www.google.com/talk/intl/zh-CN/

Google Talk 提供以下功能:
- 无需下载即可供您在任何地方使用的基于网络的聊天功能
- 与 Gmail 帐户同步的通讯录
- 免费、高品质的 PC 间语音呼叫服务(下载 Google Talk 客户端后)

我们一直致力于增加新的功能并不断改进服务,因此我们还可能会定期请您提供意见和建议。感谢您为我们的产品改进所提供的帮助!

此致
Google 小组敬上

要了解关于 Gmail 和 Google Talk 的详细信息,请访问:
http://mail.google.com/mail/help/intl/zh_CN/about.html
http://www.google.com/talk/intl/zh-CN/about.html

(如果点击本邮件中提供的网址不起作用,请将其复制并粘贴到浏览器的地址栏中)。

-- 
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.



Re: Storing visitor information

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Sat, Jul 9, 2011 at 12:16 AM, Alexei  wrote:

> Hi,
>
> I have a Django website that basically just displays a bunch of items
> from a database with searching, filtering, etc.  The site is publicly
> accessible, with no login or anything.  What I want to do is the first
> time a user visits the site, prompt them for a filter choice, then
> save that filter choice (on their machine would be preferable, would a
> browser cookie work here?) so that every future time they visit the
> website, it's displayed with that filter.
>
> So I have two specific questions here:
>
> 1)  What's the best way to store their choice?
>

In the session or the user profile, where else would it go :X


>
> 2)  What's the best way to collect their choice?  The way I'm
> envisioning this behaving is the first time they visit the site,
> they're presented with a "pop-up" of sorts, that basically asks for
> their filter choice, the continues on to the main site page with their
> filter choice enabled.  The problem I'm having is that the filter
> choice that they pick changes the content that would be displayed on
> the website.  Is there a way to avoid reloading the entire page once I
> have their filter choice?
>
> Here's a decent example of something like the popup I'm trying to
> create:  http://www.wizards.com/wpn/events/rules.aspx


This really isn't a Django question.. but there again, I have been flooding
the list recently with off-topic conversations, so I can't exactly preach
lol.

If the choice of the popup changes the content on the page, then either your
page needs to have some sort of Ajax interface, or you send them to a
landing page (like the age verification pages do), and then redirect
accordingly.


>
> Thanks,
> -Alexei
>
> --
> 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.
>
>

-- 
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.



Storing visitor information

2011-07-08 Thread Alexei
Hi,

I have a Django website that basically just displays a bunch of items
from a database with searching, filtering, etc.  The site is publicly
accessible, with no login or anything.  What I want to do is the first
time a user visits the site, prompt them for a filter choice, then
save that filter choice (on their machine would be preferable, would a
browser cookie work here?) so that every future time they visit the
website, it's displayed with that filter.

So I have two specific questions here:

1)  What's the best way to store their choice?

2)  What's the best way to collect their choice?  The way I'm
envisioning this behaving is the first time they visit the site,
they're presented with a "pop-up" of sorts, that basically asks for
their filter choice, the continues on to the main site page with their
filter choice enabled.  The problem I'm having is that the filter
choice that they pick changes the content that would be displayed on
the website.  Is there a way to avoid reloading the entire page once I
have their filter choice?

Here's a decent example of something like the popup I'm trying to
create:  http://www.wizards.com/wpn/events/rules.aspx

Thanks,
-Alexei

-- 
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.



How to automatically add a url param to url tags (it is used ubiquitously throughout application)?

2011-07-08 Thread br
 Here's a snippet from my base urls.py:

(r'^(?P[\w-]+)/manager/mobile/',
include('mobilepolls.manager.urls')),
(r'^(?P[\w-]+)/manager/display/',
include('screens.manager.urls')),
(r'^(?P[\w-]+)/display/', include ('screens.urls')),

Each of those apps then defines its own urls.py with various different
url patterns.

My problem is that I'm having to repeat the following:
  {% url . . .  org_slug=organization.slug %}

nearly everywhere I ever use a url tag in a template (probably 50x or
more), because the org_slug is ubiquitous in almost all urls, but is
always just retreived from the current user's organization. Doesn't
seem very DRY and is a bit error-prone.  Is there anyway to automate
this with a custom tag or middleware or something so that i can just
assume that "org_slug=organization.slug" part of each url tag or add
it if there is a org_slug regex param in the url?


Background: We recently added organizations in our application to
provide a single-DB multi-tenancy of sorts.  A user's organization is
reflected in most of the URL's he/she navigates to.  As a shortcut to
not always have to access the organization via the
user.get_profile().organization, I add the current organization (which
is just a lazy functional reference to a user profile object's
organization property) to the request via middleware and to each
request context via a context processor .

Thanks,

Ben

-- 
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.



Re: Serving static files weirdness

2011-07-08 Thread neridaj
Got it working by changing the following:

STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/
static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, 'static'),
)

On Jul 8, 2:47 pm, neridaj  wrote:
> I'm using Django version 1.3 and the Django devserver. My admin media
> is the default: ADMIN_MEDIA_PREFIX = '/static/admin/'
>
> On Jul 8, 1:49 am, bruno desthuilliers 
> wrote:
>
>
>
>
>
>
>
> > On Jul 8, 4:40 am, neridaj  wrote:
>
> > > I had mystaticfiles being served form media i.e., the tree looked
> > > like this:
>
> > > media/
> > > /css
> > > /js
> > > /images
>
> > > with this in my url conf:
> > > if settings.SERVE_MEDIA_FROM_DJANGO:
> > >     urlpatterns += patterns('',
> > >     (r'^media/(?P.*)$', 'django.views.static.serve',
> > > {'document_root': r'media'}),
> > >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > > { 'document_root': r'media/js/tiny_mc' }),
> > > )
>
> > > I then switched it to this:
>
> > >static/
> > > /css
> > > /js
> > > /images
>
> > > with this in my url conf:
> > > if settings.SERVE_MEDIA_FROM_DJANGO:
> > >     urlpatterns += patterns('',
> > >     (r'^static/(?P.*)$', 'django.views.static.serve',
> > > {'document_root': r'static'}),
> > >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > > { 'document_root': r'static/js/tiny_mc' }),
> > > )
>
> > > I don't understand why changing media tostatichas stopped django
> > > fromservingstaticfiles, any ideas?
>
> > settings.MEDIA_URL and MEDIA_ROOT ?

-- 
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.



Re: Serving static files weirdness

2011-07-08 Thread neridaj
I'm using Django version 1.3 and the Django devserver. My admin media
is the default: ADMIN_MEDIA_PREFIX = '/static/admin/'

On Jul 8, 1:49 am, bruno desthuilliers 
wrote:
> On Jul 8, 4:40 am, neridaj  wrote:
>
>
>
>
>
>
>
>
>
> > I had mystaticfiles being served form media i.e., the tree looked
> > like this:
>
> > media/
> > /css
> > /js
> > /images
>
> > with this in my url conf:
> > if settings.SERVE_MEDIA_FROM_DJANGO:
> >     urlpatterns += patterns('',
> >     (r'^media/(?P.*)$', 'django.views.static.serve',
> > {'document_root': r'media'}),
> >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > { 'document_root': r'media/js/tiny_mc' }),
> > )
>
> > I then switched it to this:
>
> >static/
> > /css
> > /js
> > /images
>
> > with this in my url conf:
> > if settings.SERVE_MEDIA_FROM_DJANGO:
> >     urlpatterns += patterns('',
> >     (r'^static/(?P.*)$', 'django.views.static.serve',
> > {'document_root': r'static'}),
> >     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> > { 'document_root': r'static/js/tiny_mc' }),
> > )
>
> > I don't understand why changing media tostatichas stopped django
> > fromservingstaticfiles, any ideas?
>
> settings.MEDIA_URL and MEDIA_ROOT ?

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Perfect, thank you!

On Fri, Jul 8, 2011 at 9:46 PM, Roberto De Ioris  wrote:

>
> > Hi Roberto,
> >
> > Wonder if you might be able to give me some advice..
> >
> > Is there is a way to limit the address space of any other binary,
> > without relying on /etc/security/limits.conf??
> >
> > For example, is it possible to do something like this:
> >
> > ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
> >
> > ^^ that would then wrap the binary, enforcing a maximum address space of
> > 256M.
> >
> > As you gave the option --limit-as to uwsgi, which can apply to any
> > python webapp, I was wondering if it's possible for us to do the same,
> > but without compiling the original binary into uwsgi.
> >
> > Let me know if the above doesn't make any sense lol.
> >
> > Cal
> >
>
>
> you can use the --worker-exec option.
>
> This is used to run php-fastcgi (or other software requiring specific
> environment) under the uWSGI environment
>
> uwsgi --limit-as 256 --worker-exec /bin/ls
>
> As others have already said to you, remember that limits set by a parent
> are inherited by all of the children. So running apps via fork+exec or via
> attach-daemon in uWSGI will set their limit automatically.
>
> --
> Roberto De Ioris
> http://unbit.it
>
> --
> 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.
>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Roberto De Ioris

> Hi Roberto,
>
> Wonder if you might be able to give me some advice..
>
> Is there is a way to limit the address space of any other binary,
> without relying on /etc/security/limits.conf??
>
> For example, is it possible to do something like this:
>
> ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
>
> ^^ that would then wrap the binary, enforcing a maximum address space of
> 256M.
>
> As you gave the option --limit-as to uwsgi, which can apply to any
> python webapp, I was wondering if it's possible for us to do the same,
> but without compiling the original binary into uwsgi.
>
> Let me know if the above doesn't make any sense lol.
>
> Cal
>


you can use the --worker-exec option.

This is used to run php-fastcgi (or other software requiring specific
environment) under the uWSGI environment

uwsgi --limit-as 256 --worker-exec /bin/ls

As others have already said to you, remember that limits set by a parent
are inherited by all of the children. So running apps via fork+exec or via
attach-daemon in uWSGI will set their limit automatically.

--
Roberto De Ioris
http://unbit.it

-- 
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.



Re: Can't get /admin/ or any page to load

2011-07-08 Thread Andre Terra
Hello, Brent

As always, please post full the traceback and urls.py. Use dpaste.com.



Cheers,
André

On Fri, Jul 8, 2011 at 4:33 PM, Brent  wrote:

> When I go to 127.0.0.1:8000/admin/ I receive this error:
>
> Caught ViewDoesNotExist while rendering: Tried base in module
> django.views.generic. Error was: 'django.views.generic.base' is not a
> callable.
>
> I followed the django tutorial here:
> https://docs.djangoproject.com/en/dev/intro/tutorial01/
> and it worked fine, but I want to restructure my directories. I moved
> a bunch of files around, and I updated the new changes in settings.py
> and some other files. But it still won't work.
>
> I've spent several hours on this, so it would be very appreciated if
> someone could tell me where to look to fix this.
>
> Thanks in advance.
>
> --
> 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.
>
>

-- 
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.



Can't get /admin/ or any page to load

2011-07-08 Thread Brent
When I go to 127.0.0.1:8000/admin/ I receive this error:

Caught ViewDoesNotExist while rendering: Tried base in module
django.views.generic. Error was: 'django.views.generic.base' is not a
callable.

I followed the django tutorial here: 
https://docs.djangoproject.com/en/dev/intro/tutorial01/
and it worked fine, but I want to restructure my directories. I moved
a bunch of files around, and I updated the new changes in settings.py
and some other files. But it still won't work.

I've spent several hours on this, so it would be very appreciated if
someone could tell me where to look to fix this.

Thanks in advance.

-- 
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.



Re: Model translation

2011-07-08 Thread Tomáš Ehrlich
Yes, transmeta is straightforward and simple. This is the main
advantage, but also the biggest disadvantage. Moreover, i'm scared of
altering big tables with lots of columns every time I want to add
another language.

On 8 čnc, 21:06, smac...@flagstonesoftware.com wrote:
> +1 for transmeta but I only use it for short text fields which contain  
> user supplied data which translated in the admin and or reference data  
> or other fields which are constant. It quickly gets unmanagable as you  
> add fields.
>
>  From what you describe multilingual is probably better suited since  
> the different translations are easier to manage in the admin. However  
> it probably only fits the core of your requirements unless you stored  
> all translatable fields in their own tables in which case it would be  
> easier to add and manage all the other information about the  
> translations.
>
> Stuart MacKay
> Lisbon, Portgual

-- 
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.



Re: Model translation

2011-07-08 Thread smackay
+1 for transmeta but I only use it for short text fields which contain  
user supplied data which translated in the admin and or reference data  
or other fields which are constant. It quickly gets unmanagable as you  
add fields.


From what you describe multilingual is probably better suited since  
the different translations are easier to manage in the admin. However  
it probably only fits the core of your requirements unless you stored  
all translatable fields in their own tables in which case it would be  
easier to add and manage all the other information about the  
translations.


Stuart MacKay
Lisbon, Portgual


--
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.



Re: Confusion about the new staticfiles contrib app

2011-07-08 Thread Gour-Gadadhara Dasa
On Tue, 25 Jan 2011 21:46:39 -0800 (PST)
Brian Neal  wrote:

Hiya,

> I'm trying to cut over my project to use the new staticfiles
> application. I'm using the dev server with DEBUG = True on a recent
> SVN trunk checkout. My STATIC_URL is '/static/' and my MEDIA_URL is
> 'http://localhost:8000/media/' in this environment.

I'm in a similar boat...trying (again) with Django-1.3

> Eventually I came to the conclusion that I had do this:
> 
> urls.py:
> if settings.DEBUG:
>urlpatterns += patterns('django.contrib.staticfiles.views',
>   (r'^media/(?P.*)$', 'serve', {'document_root':
> settings.MEDIA_ROOT}),
>)

My project is at ~/home/gour/www/zinnia in virtual env.

Zinnia (blog engine) media files are symlinked to:

/usr/home/gour/www/zinnia/lib/python2.7/site-packages/zinnia/media/zinnia --> 
/usr/home/gour/www/zinnia/blog/static

and in order to see media files I've the following in my settings.py:

[...]

PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))

MEDIA_ROOT = os.path.join(PROJECT_PATH, "static")

MEDIA_URL = '/media/'

ADMIN_MEDIA_PREFIX = '/media/admin/'

[...]

and here is the snippet from urls.py:

from django.conf import settings

if settings.DEBUG:
urlpatterns += patterns('',
url(r'^media/(?P.*)$', 'django.views.static.serve', {
'document_root': settings.MEDIA_ROOT,
}),
   )

The above snippet is from dev-docs, while the 1.3 doc says:

from django.conf import settings

if settings.DEBUG:
urlpatterns += patterns('django.contrib.staticfiles.views',
url(r'^static/(?P.*)$', 'serve'),
)


Now I'm told on #django that this is obsolete and from 1.3 one is supposed to
use:

django.contrib.staticfiles 

and I tried to add it to INSTALLED_APPS, defined STATIC_ROOT, STATIC_URL,
STATICFILES_DIRS..and adding:

urlpatterns += staticfiles_urlpatterns() to urls.py, but all what I get is 404 
errors.

> The docs don't seem to mention using this view for this purpose.
> Should they?

This is my confusion as well. The doc says:


This view is automatically enabled by runserver (with a DEBUG setting set to
True). To use the view with a different local development server, add the
following snippet to the end of your primary URL configuration:

from django.conf import settings

if settings.DEBUG:
urlpatterns += patterns('django.contrib.staticfiles.views',
url(r'^static/(?P.*)$', 'serve'),
)



and based on the avove it seems that if one just wants to use runserver there
should not be need for the django.contrib.staticfiles.views view, but, based on
my experience I was not able to render media files without using the above
snippet in urls.py, so my humgble request is whether someone can provide
correct info how to serve app's media (static) files in django-1.3 when using
runserver in development?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


Re: User based objects

2011-07-08 Thread Praveen Krishna R
*Shawn, Once again **thank you very much for your help,
*
*here is my code, if anybody could make use of it (I have changed my actual
model/form names)! *
*
*
*
class SampleForm(forms.Form):
head = forms.CharField()
body = forms.CharField(widget = forms.Textarea)
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
super(SampleForm, self).__init__(*args, **kwargs)
self.fields['mychoicefield'] = forms.ModelChoiceField(queryset =
MySampleModel.objects.filter(user__username__iexact = self.user.username))

in the view I use
new_form = SampleForm(user = request.user)
**

*
On Fri, Jul 8, 2011 at 8:36 PM, Shawn Milochik  wrote:

> On Fri, Jul 8, 2011 at 10:28 AM, Praveen Krishna R
>  wrote:
> > Thank you, Shawn, I didn't knew that! I'm trying on that way now!
> >
>
> You're welcome. The one 'gotcha' is that you're going to have to
> remove the user from the kwargs before you call the __init__ of the
> superclass. Otherwise you'll get an 'unexpected keyword argument'
> exception.
>
> Example:
>
>
>def __init__(self, *args, **kwargs):
>
>self.user = kwargs.pop('user')
>
>super(MyForm, self).__init__(*args, **kwargs)
>
>
> You can then use self.user in your form's functions for filtering --
> probably starting right in __init__ after the super() call to set
> self.fields['field_name'].choices to be whatever they should be.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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.



Re: anybody using PhoneGap with Django

2011-07-08 Thread John Fabiani
On Friday, July 08, 2011 10:41:02 am br wrote:
> I am currently in the middle of a project where we are planning on
> using Django with PhoneGap . . . Haven't completed yet, or gotten to
> the PhoneGap part of it, so can't report its success or not yet.
> 
> Basically, we are using jQuery Mobile to develop a complete mobile
> application that operates on a pair of cached JSON objects, one to
> define the page flow of the application and the page contents, and the
> other to store form results to be returned to the server or stored in
> localstorage.  I am not using Django templates for anything, but
> rather just going to use TastyPie to provide a REST interface for the
> app's models in order to provide and receive the JSON objects to and
> from the front end. So essentially- just using Django for the back
> end. We also looked at Sencha touch vs. jQMobile for the front end but
> went with jQ Mobile because my front end developer was much more
> comfortable with it and was already familiar with jQuery.  Once we get
> the thing working as an addressable mobile web app, we intend to
> package and wrap it as a PhoneGap app.   I can post an update on our
> success or failures in a month or so when the project has come
> together more.  As of now, just he front end is completed to operate
> on the JSON objects and I am working on the models and REST interface
> for it.
> 
> Ben

Interesting!  Are you avoiding the templates because you feel they will slow 
the app down?  I wonder if PhoneGap would have issues with templates?

I like the idea of going with jQMobile because I like jQuery very much too.  

The REST interface would also be interesting - let us know how that goes!

Johnf

-- 
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.



Re: RegistrationForm subclass not showing up

2011-07-08 Thread CareerDhaba tech
I believe you are using an older version of django_registration, since there
is no reference to the backend in your code. The backend is an addition in
the latest (0.8) version of django_registration.

Did you download the code from here?
http://readthedocs.org/docs/django-registration/en/latest/index.html


On Fri, Jul 8, 2011 at 3:39 PM, katstevens  wrote:

> Thanks for your answer, but unfortunately that hasn't helped - on
> further investigation I think the problem is somewhere else, as the
> original RegistrationForm class instance (in registration.forms)
> doesn't seem to be being called correctly by registration.views (so no
> wonder RegistrationFormTermsOfService isn't working!). I tried making
> some small changes to the labels in the RegistrationForm class and it
> is still displaying the default label values in my template. For
> example, the class declaration now looks like:
>
>  class RegistrationForm(forms.Form):
> # all the other fields
> # ...
> password1 =
> forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict,
> render_value=False),
>label=_(u'different password label'))
>
> In registration.views I've imported the form as follows
>
>  from registration.forms import RegistrationForm
>
> And used the default view declaration:
>
>  def register(request, success_url=None,
> form_class=RegistrationForm, profile_callback=None,
> template_name='registration/registration_form.html',
> extra_context=None):
>if request.method == 'POST':
>   # do post stuff
>else:
>   # instantiate blank form
>form = form_class()
>
> Finally, on the registration_form.html template I've tried calling the
> fields explicitly rather than using the form.as_table tag:
>
>  {{ form.password1.label_tag }}
>  {{ form.password1 }}
>
> The page displays these fields fine, yet the label still gives the
> default label value of 'password' instead of 'different password
> label'. I'm not getting any syntax errors, and I've rebooted my server
> for good measure with the same results. Therefore I assume that either
> form = form_class() isn't actually instantiating RegistrationForm
> properly in the view, or there is some sort of overriding default
> being called from a different location (maybe django.contrib.auth?).
>
> Also - I can't see the form_call field that you mention - does this
> refer to the parameter 'form_class=RegistrationForm' I've used above
> in my registration view?
>
> Thanks again!
>
> On Jul 8, 7:08 am, CareerDhaba tech  wrote:
> > Hi Kat,
> >
> > You have to tell the your registration view to use the
> > RegistrationFormTermsofService. First, import that class from forms and
> > change your form_call from None to to RegistrationFormTermsofService.
> >
> > Hope this helps.
> >
> >
> >
> >
> >
> >
> >
> > On Thu, Jul 7, 2011 at 5:34 PM, katstevens 
> wrote:
> > > Hi - I'm new to Django and am using django-registration to set up new
> > > users.
> >
> > > The basic RegistrationForm shows up fine in my template (which just
> > > uses {{ form.as_table }} to generate fields inside the form HTML), but
> > > I now want to use the RegistrationFormTermsOfService subclass instead.
> >
> > > I set it as a parameter in urls.py as follows:
> > >   url(r'^register/$',
> > >   register,
> > >   {'form_class':
> > > RegistrationFormTermsOfService},
> > >   name='registration_register'),
> >
> > > ... but the original RegistrationForm is still showing instead. Any
> > > ideas why this would be? Do I have to remove the default 'form_class'
> > > value in the register declaration in views.py (as that still gives
> > > RegistrationForm as the default)? Or do I need to alter my template?
> >
> > > I'm sure I'm missing something really obvious - any help gratefully
> > > received.
> >
> > > Kat
> >
> > > --
> > > 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.
>
> --
> 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.
>
>

-- 
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.

Re: Getting a subclass from an abstract Model

2011-07-08 Thread Micky Hulse
Try adding the below to your base class:


objects = models.Manager() # Admin uses this manager.

Sent from my iPhone

-- 
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.



Re: anybody using PhoneGap with Django

2011-07-08 Thread br
I am currently in the middle of a project where we are planning on
using Django with PhoneGap . . . Haven't completed yet, or gotten to
the PhoneGap part of it, so can't report its success or not yet.

Basically, we are using jQuery Mobile to develop a complete mobile
application that operates on a pair of cached JSON objects, one to
define the page flow of the application and the page contents, and the
other to store form results to be returned to the server or stored in
localstorage.  I am not using Django templates for anything, but
rather just going to use TastyPie to provide a REST interface for the
app's models in order to provide and receive the JSON objects to and
from the front end. So essentially- just using Django for the back
end. We also looked at Sencha touch vs. jQMobile for the front end but
went with jQ Mobile because my front end developer was much more
comfortable with it and was already familiar with jQuery.  Once we get
the thing working as an addressable mobile web app, we intend to
package and wrap it as a PhoneGap app.   I can post an update on our
success or failures in a month or so when the project has come
together more.  As of now, just he front end is completed to operate
on the JSON objects and I am working on the models and REST interface
for it.

Ben

On Jul 8, 8:01 am, Brian Bouterse  wrote:
> I would be interested to hear this as well...
>
>
>
>
>
>
>
>
>
> On Fri, Jul 8, 2011 at 12:44 AM, John Fabiani  wrote:
> > On Thursday, July 07, 2011 08:48:51 pm Andy McKay wrote:
> > > On 2011-07-07, at 2:22 PM, John Fabiani wrote:
> > > > I'm wondering if anyone has had any success with PhoneGap and Django?
>
> > > Yes.
> > > --
> > >   Andy McKay
> > >   a...@clearwind.ca
> > >   twitter: @andymckay
>
> > LOL - I guess I could have asked a better question.  Can I assume you have
> > had
> > success with Django and PhoneGap?  If so would you take the time to explain
> > in
> > a general your experience with PhoneGap.  I have been told that the
> > combination is very slow - although I don't see any reason that it would
> > be.
> > I was also told that debugging was very difficult.
>
> > Johnf
>
> > --
> > 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.
>
> --
> Brian Bouterse
> ITng Services

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 5:37 PM, Brian Bouterse  wrote:

> I'm going to try to get a pypy installation built from source that has
> nginx/gunicorn/django.  I will share back what I can come up with. If anyone
> else is doing similar things share back your findings please.


I'm going to try do the same with uwsgi, will let you know what I find.


>
> I don't use shed skin, but I believe pypy is much more mature.  As evident
> from the large donation from the python software foundation at pycon this
> past spring, pypy is poised to become *the* interpreter, if speed is your
> goal.  The python software foundation wants to support the work of pypy and
> their donation was the only one given at pycon 2011.  CPython will continue
> to serve as the reference python interpreter.
>
> I was talking with the pypy authors at pycon this past spring and they
> anecdotally that django and pypy are being used in production on some sites.
>  The folks in the pypy community could probably comment more on this than I
> could.
>

Our portfolio of sites receive many hundreds of thousands of webapp hits per
day, so once something semi stable has been put together, I'll most likely
split off like 1 ~ 5% of our traffic at our load balancer for testing.


>
> Brian
>
> On Fri, Jul 8, 2011 at 11:03 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>>
>>
>> On Fri, Jul 8, 2011 at 3:53 PM, Venkatraman S  wrote:
>>
>>> Cal,
>>>
>>> Quiet frankly, it looks to me that if you are spending some effort on
>>> this - better start with django on pypy.
>>> And then probably we can move to 'one-binary' idea.
>>
>>
>> I much prefer the idea of a true single binary (the way facebook approach
>> it) with everything statically compiled in, over the concept of a self
>> extracting chroot, as the latter does sound quite messy.
>>
>> However, I'd need to find out if nginx/uwsgi/pypy/django would play
>> together nicely.. so I'm going to spend some hours getting my hands dirty
>> and seeing what works..- besides, it's a good opportunity to brush up on my
>> C :)
>>
>>
>>>
>>>
>>> -V
>>>
>>> --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>
>
> --
> Brian Bouterse
> ITng Services
>
> --
> 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.
>

-- 
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.



Re: Model translation

2011-07-08 Thread urukay
Hi Tomas,

i'm using transmeta in my project. But in the way you are/want. Just
using it to translate some short strings (and longer in FAQ).
And there's no problem to add another language inproduction server
(see manage.py help for more info)

Radovan
http://www.yau.sk

On 8. Júl, 18:56 h., Tomáš Ehrlich  wrote:
> Hi there,
> I just want to open discussion about this topic again, because I
> didn't find any solution which 100% fits my needs.
>
> What I want:
>  - store translations in other table (1:N)
>  - storing additional info, if necessary (translation_date,
> translation_edit_date, translator_name, etc)
>  - keeping the original model API with additional methods (missing
> translations, translations count, etc)
>  - group permissions for translators
>  - per-site fallback language
>
> Before developing my own library, I was searching this mailing list
> and 
> found:http://code.google.com/p/django-transmeta/http://code.google.com/p/django-multilingual/
>
> I don't like transmeta with it's column_ln idea. Problems are:
>  - translating big columns (like text column)
>  - adding another language on production server
>
> Multiligual app looks better but it lacks documentation.
>
> Does anyone use one of these (especially multilingual app) in
> production?
>
> 
> My idea is:
>
> # Create model as usual with specific Meta options
> class Article(model18n.Model):
>     pub_date = models.DateField()
>     category = models.ForeignField()
>     title = models.CharField()
>     slug = models.SlugField()
>     content = models.TextField()
>
>     class Meta:
>         translate = ('title', 'slug', 'content')
>         translate_with = ArticleTranslate  # optional specification of
> translation model
>
> # Specify translation model, if necessary
> class ArticleTranslate(model18n.Translations):
>     # id, foreign_id, lang, title, slug, content are created
> implicitly
>     date_translate = models.DateField()
>     translator = models.ForeignField() # user who done translation
>
> These two models will create:
> CREATE TABLE "articles_article" (
>     "id" serial NOT NULL PRIMARY KEY,
>     "pub_date" date NOT NULL,
>     "category_id" integer NOT NULL,  -- not sure about proper syntax,
> nevermind
> ) -- yes, translated field are not in primary table. This table keeps
> only structure and common data
>
> CREATE TABLE "articles_article_translate" (
>     "id" serial NOT NULL PRIMARY KEY,
>     "article_id" integer NOT NULL,
>     "title" varchar(5) NOT NULL,
>     "date_translated" date NOT NULL,
>     "translator" integer NOT NULL,
>     "title" varchar(200) NOT NULL,
>     "slug" varchar(200) NOT NULL,
>     "content" text NOT NULL,
> )
>
> And working with them is like usual:
>
> >>> article = Article(content="Dummy text", title="Dummy title", ...) # 
> >>> creates default language entry
> >>> article.save()
> >>> article.add_language("cs", content="Textovy obsah", title="Textovy 
> >>> nazev", ...)
> >>> article.save()
> ...
> >>> article = Article.objects.all() # implicitly join default language
> >>> article.content
> Dummy text
> >>> translation.activate('cs')
> >>> article.content # call another SQL query
>
> Textovy nazev
>
> Reasons for this are:
>  - usually you need select from table only one language (only in admin
> you need to select all related languages)
>  - separating data structure from translated content
>
> Problems are:
>  - language variants - you are translating for en_US, en_GB, default
> (fallback) language is cs_CZ. When US user access model entry only
> with en_GB and cs_CZ, there shoudl be fallback to en_GB, rather than
> cs_CZ. Query should respect ACCEPT_LANGUAGE preferences. For now, I
> don't have idea how to solve this with "single" query.
>
> ===
> Summary:
>
> 1. Does anyone use transmeta or multilingual (especially multilingual
> app) in production?
> 2. How are you translating models?
> 3. What do you think about my solution?

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Shawn Milochik

On 07/08/2011 12:53 PM, Jacob Kaplan-Moss wrote:

Hi folks --

Also see http://simonwillison.net/2009/Jan/7/ratelimitcache/ for a
discussion of a similar technique built on top of memcached.

Jacob



Thanks for that link. There's some really good stuff in the comments. 
I'm seriously considering adding a user-agent hash to this mix, to fix a 
theoretical problem I've already imagined for my solution, namely 
someone in my office locking our whole IP with potentially disastrous 
effects to the rest of the company, requiring a supervisord restart to 
wipe the in-memory database.


The solution itself is interesting, and powerful because it can be used 
to decorate a view. However, as our app requires authentication for all 
users, I'm not interested in any rate limiting per se -- just 
anti-brute-force.


--
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Interesting approach.

Although, I don't like the "get multi" approach, too much overhead.

I personally prefer to configure an amount of time, combined with the max
hits, then do the following:



class IPThrottleException(exception): pass
import time
MAX_INTERVAL = 180 # seconds
MAX_ATTEMPTS = 10
_t = time.time() # grab current ts
_t = int(_t / MAX_INTERVAL) # figure out which "period" we are in, based on
max interval
_ip = request.META.get('REMOTE_ADDR')
_key = "__ip_throttle__%s__%s" % (
_t,
_ip
)

_c = cache.get(_key)
if not c:
cache.set(_key, 0)
cache.incr(_key, 1)
elif _c > MAX_ATTEMPTS:
raise IPThrottleException, "Max attempts reached"
else:
cache.incr(_key, 1)



On Fri, Jul 8, 2011 at 5:53 PM, Jacob Kaplan-Moss wrote:

> Hi folks --
>
> Also see http://simonwillison.net/2009/Jan/7/ratelimitcache/ for a
> discussion of a similar technique built on top of memcached.
>
> Jacob
>
> --
> 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.
>
>

-- 
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.



Model translation

2011-07-08 Thread Tomáš Ehrlich
Hi there,
I just want to open discussion about this topic again, because I
didn't find any solution which 100% fits my needs.

What I want:
 - store translations in other table (1:N)
 - storing additional info, if necessary (translation_date,
translation_edit_date, translator_name, etc)
 - keeping the original model API with additional methods (missing
translations, translations count, etc)
 - group permissions for translators
 - per-site fallback language

Before developing my own library, I was searching this mailing list
and found:
http://code.google.com/p/django-transmeta/
http://code.google.com/p/django-multilingual/

I don't like transmeta with it's column_ln idea. Problems are:
 - translating big columns (like text column)
 - adding another language on production server

Multiligual app looks better but it lacks documentation.

Does anyone use one of these (especially multilingual app) in
production?



My idea is:

# Create model as usual with specific Meta options
class Article(model18n.Model):
pub_date = models.DateField()
category = models.ForeignField()
title = models.CharField()
slug = models.SlugField()
content = models.TextField()

class Meta:
translate = ('title', 'slug', 'content')
translate_with = ArticleTranslate  # optional specification of
translation model

# Specify translation model, if necessary
class ArticleTranslate(model18n.Translations):
# id, foreign_id, lang, title, slug, content are created
implicitly
date_translate = models.DateField()
translator = models.ForeignField() # user who done translation


These two models will create:
CREATE TABLE "articles_article" (
"id" serial NOT NULL PRIMARY KEY,
"pub_date" date NOT NULL,
"category_id" integer NOT NULL,  -- not sure about proper syntax,
nevermind
) -- yes, translated field are not in primary table. This table keeps
only structure and common data

CREATE TABLE "articles_article_translate" (
"id" serial NOT NULL PRIMARY KEY,
"article_id" integer NOT NULL,
"title" varchar(5) NOT NULL,
"date_translated" date NOT NULL,
"translator" integer NOT NULL,
"title" varchar(200) NOT NULL,
"slug" varchar(200) NOT NULL,
"content" text NOT NULL,
)


And working with them is like usual:

>>> article = Article(content="Dummy text", title="Dummy title", ...) # creates 
>>> default language entry
>>> article.save()
>>> article.add_language("cs", content="Textovy obsah", title="Textovy nazev", 
>>> ...)
>>> article.save()
...
>>> article = Article.objects.all() # implicitly join default language
>>> article.content
Dummy text
>>> translation.activate('cs')
>>> article.content # call another SQL query
Textovy nazev

Reasons for this are:
 - usually you need select from table only one language (only in admin
you need to select all related languages)
 - separating data structure from translated content

Problems are:
 - language variants - you are translating for en_US, en_GB, default
(fallback) language is cs_CZ. When US user access model entry only
with en_GB and cs_CZ, there shoudl be fallback to en_GB, rather than
cs_CZ. Query should respect ACCEPT_LANGUAGE preferences. For now, I
don't have idea how to solve this with "single" query.


===
Summary:

1. Does anyone use transmeta or multilingual (especially multilingual
app) in production?
2. How are you translating models?
3. What do you think about my solution?

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Jacob Kaplan-Moss
Hi folks --

Also see http://simonwillison.net/2009/Jan/7/ratelimitcache/ for a
discussion of a similar technique built on top of memcached.

Jacob

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 5:37 PM, Shawn Milochik  wrote:

> On Fri, Jul 8, 2011 at 12:32 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
> >
> >
> > Have you considered using an atomic caching server for storing the state
> of
> > an IPs 'throttle' count?
> > It has the added benefit of giving you future support for distributed
> use,
> > wouldn't be as performance heavy as writing to a database, and deals with
> > any race condition problems quite nicely.
> >
>
> No, I haven't. We're not using caching otherwise, and don't have any
> needs for distributed use right now.
>

Ah that's fair enough. I assume your webapp is single threaded??


>
> And, sqlite3 in memory is ridiculously fast, so I don't believe
> performance will ever be an issue there. I see you alluded to that in
> your follow-up post.
> I haven't benchmarked it, but it's more than fast enough for my needs.
>

Come to think of it, I'd imagine it's somewhat faster than using a cache
backend (when taking the tcp overhead into consideration), just without the
added benefits of distributed access.


>
> --
> 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.
>
>

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Shawn Milochik
On Fri, Jul 8, 2011 at 12:32 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
>
>
> Have you considered using an atomic caching server for storing the state of
> an IPs 'throttle' count?
> It has the added benefit of giving you future support for distributed use,
> wouldn't be as performance heavy as writing to a database, and deals with
> any race condition problems quite nicely.
>

No, I haven't. We're not using caching otherwise, and don't have any
needs for distributed use right now.

And, sqlite3 in memory is ridiculously fast, so I don't believe
performance will ever be an issue there. I see you alluded to that in
your follow-up post.
I haven't benchmarked it, but it's more than fast enough for my needs.

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
I'm going to try to get a pypy installation built from source that has
nginx/gunicorn/django.  I will share back what I can come up with. If anyone
else is doing similar things share back your findings please.

I don't use shed skin, but I believe pypy is much more mature.  As evident
from the large donation from the python software foundation at pycon this
past spring, pypy is poised to become *the* interpreter, if speed is your
goal.  The python software foundation wants to support the work of pypy and
their donation was the only one given at pycon 2011.  CPython will continue
to serve as the reference python interpreter.

I was talking with the pypy authors at pycon this past spring and they
anecdotally that django and pypy are being used in production on some sites.
 The folks in the pypy community could probably comment more on this than I
could.

Brian

On Fri, Jul 8, 2011 at 11:03 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

>
>
> On Fri, Jul 8, 2011 at 3:53 PM, Venkatraman S  wrote:
>
>> Cal,
>>
>> Quiet frankly, it looks to me that if you are spending some effort on this
>> - better start with django on pypy.
>> And then probably we can move to 'one-binary' idea.
>
>
> I much prefer the idea of a true single binary (the way facebook approach
> it) with everything statically compiled in, over the concept of a self
> extracting chroot, as the latter does sound quite messy.
>
> However, I'd need to find out if nginx/uwsgi/pypy/django would play
> together nicely.. so I'm going to spend some hours getting my hands dirty
> and seeing what works..- besides, it's a good opportunity to brush up on my
> C :)
>
>
>>
>>
>> -V
>>
>> --
>> 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.
>>
>
>  --
> 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.
>



-- 
Brian Bouterse
ITng Services

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 5:32 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

>
>
> On Fri, Jul 8, 2011 at 5:03 PM, Shawn Milochik  wrote:
>
>> This topic came up on the list a few months back, and I just wanted to
>> share the solution I've put into place.
>>
>> Short version:
>>
>> 1. Ensure that my Web server (nginx) passes the user's real IP address in
>> the request.
>>
>> 2. For POST requests to the login URL only (to avoid any performance
>> side-effects), keep a rolling count of number of requests by the IP in the
>> past five minutes and use that to limit the number of attempts. Return
>> HttpResponseForbidden with a message about too many log in attempts.
>>
>> Justification:
>>
>>I'm using IP instead of user because this prevents an attacker from
>> inconveniencing a legit user or getting a "fresh start" just by guessing a
>> different username.
>>
>>I'm throttling instead of locking the account (temporarily or
>> permanently) to prevent attackers from locking out legitimate users.
>>
>> Details (implemented in middleware):
>>
>>Middleware file creates an in-memory sqlite3 database.
>>
>
> Have you considered using an atomic caching server for storing the state of
> an IPs 'throttle' count?
>
> It has the added benefit of giving you future support for distributed use,
> wouldn't be as performance heavy as writing to a database, and deals with
> any race condition problems quite nicely.
>

-  "wouldn't be as performance heavy as writing to a database"

Sorry, I shouldn't have included that, as I don't know how resource hungry
the sqlite3 libs are when writing directly to memory, in comparison to the
overhead of using django cache backend.


>
>>
>>All requests that aren't POSTs or to the login URL are ignored.
>>
>>POST requests to the login URL cause these actions, in this order:
>>Get count of requests in last five minutes.
>>Return HttpResponseForbidden message if count is excessive.
>>Delete database entries greater than five minutes old.
>>Log this attempt.
>>
>> That's it. Pretty simple and effective. I hope others find it useful, and
>> point out any flaws I may have missed.
>>
>>
>> --
>> 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+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 5:03 PM, Shawn Milochik  wrote:

> This topic came up on the list a few months back, and I just wanted to
> share the solution I've put into place.
>
> Short version:
>
> 1. Ensure that my Web server (nginx) passes the user's real IP address in
> the request.
>
> 2. For POST requests to the login URL only (to avoid any performance
> side-effects), keep a rolling count of number of requests by the IP in the
> past five minutes and use that to limit the number of attempts. Return
> HttpResponseForbidden with a message about too many log in attempts.
>
> Justification:
>
>I'm using IP instead of user because this prevents an attacker from
> inconveniencing a legit user or getting a "fresh start" just by guessing a
> different username.
>
>I'm throttling instead of locking the account (temporarily or
> permanently) to prevent attackers from locking out legitimate users.
>
> Details (implemented in middleware):
>
>Middleware file creates an in-memory sqlite3 database.
>

Have you considered using an atomic caching server for storing the state of
an IPs 'throttle' count?

It has the added benefit of giving you future support for distributed use,
wouldn't be as performance heavy as writing to a database, and deals with
any race condition problems quite nicely.


>
>All requests that aren't POSTs or to the login URL are ignored.
>
>POST requests to the login URL cause these actions, in this order:
>Get count of requests in last five minutes.
>Return HttpResponseForbidden message if count is excessive.
>Delete database entries greater than five minutes old.
>Log this attempt.
>
> That's it. Pretty simple and effective. I hope others find it useful, and
> point out any flaws I may have missed.
>
>
> --
> 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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Shawn Milochik
I'm not familiar with shm, so I can't answer that.

I don't share the in-memory db with anything else; we have a very
small user-base for our commercial application, and only need one
Django instance. If I wanted to trigger other activity based on this
I'd probably use ZeroMQ.

Sorry I can't be more helpful in your situation.

-- 
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.



Re: No module named registrationprofiles

2011-07-08 Thread arjun
thanks a lot!

On Jul 8, 8:46 pm, Karen Tracey  wrote:
> On Jul 8, 11:40 am, arjun  wrote:
>
> > i am running django-registration, django-profiles apps.
> > and getting the error 'No module named registrationprofiles' while
> > syncdb command is used..
> > wat cud be the reason?
>
> A missing comma between the two entries in INSTALLED_APPS.
>
> Karen

-- 
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.



Re: throttling login attempts to avoid brute force attacks

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 5:03 PM, Shawn Milochik  wrote:
>    Middleware file creates an in-memory sqlite3 database.

How do you share this in memory db with the other processes? Can one
create sqlite databases that use shm?

Intrigued.

Cheers

Tom

-- 
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.



throttling login attempts to avoid brute force attacks

2011-07-08 Thread Shawn Milochik
This topic came up on the list a few months back, and I just wanted to 
share the solution I've put into place.


Short version:

1. Ensure that my Web server (nginx) passes the user's real IP address 
in the request.


2. For POST requests to the login URL only (to avoid any performance 
side-effects), keep a rolling count of number of requests by the IP in 
the past five minutes and use that to limit the number of attempts. 
Return HttpResponseForbidden with a message about too many log in attempts.


Justification:

I'm using IP instead of user because this prevents an attacker from 
inconveniencing a legit user or getting a "fresh start" just by guessing 
a different username.


I'm throttling instead of locking the account (temporarily or 
permanently) to prevent attackers from locking out legitimate users.


Details (implemented in middleware):

Middleware file creates an in-memory sqlite3 database.

All requests that aren't POSTs or to the login URL are ignored.

POST requests to the login URL cause these actions, in this order:
Get count of requests in last five minutes.
Return HttpResponseForbidden message if count is excessive.
Delete database entries greater than five minutes old.
Log this attempt.

That's it. Pretty simple and effective. I hope others find it useful, 
and point out any flaws I may have missed.



--
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.



Getting a subclass from an abstract Model

2011-07-08 Thread gontran
Hello everyone,


my models are defined like this:

class MyBaseModel(models.Model):
.
class Meta:
abstract = True

class ClassA(MyBaseModel):
..

class ClassB(MyBaseModel):
..

Then I'm trying to get a subclass of MyBaseModel by doing this:

for s in MyBaseModel.__subclasses__():
if s.__name__ ==  "ClassA":
MyClass = s
elif s.__name__ ==  "ClassB":
MyClass = s
q = MyClass.objects.all()===> Raise an AttributeError: type object
'ClassA' has no attribute '_default_manager'

I don't understand why it raises this error, what am I missing?


Thank you very much for your help.

Cheers,

Gontran

-- 
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.



Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird  wrote:
> @Cal,
> My apologies if my post has hurted you.
> I didn't mean that.
> I understand that all these open source projects are run by people who
> don't get paid for it.
>
> My point was quite different. It was about knowledge sharing.
> We can re-phrase the question if nobody understands what we mean to
> ask.
> Actually, we are not asking for any exact code or any spoon-feeding.
> We are asking whether anybody has developed a solution similar to
> CursorAdaptor in VFP
> Ed Leafe & Paul McNett have done marvelous work in this area (DABO
> desktop framework).
>
> Instead of making this post very long by giving details of what is a
> CursorAdaptor, pl. refer to --
> http://msdn.microsoft.com/en-us/library/d993hde7(v=vs.80).aspx
>
> Regarding your remark of "Don't expect an instant answer"--
> -- OP was dated 30th June.
> Today is 8th July (an instant???)
>
> Again, pl. excuse me if I have said anything wrong.
> @qMax:  Have you got any way around your question?
>
> ---Vineet
>

Hi Vineet

The problem both you and the OP have is that you asked extremely vague
questions. I've re-read the OPs post a number of times, and all I can
see is some extremely vague discussion on how the ORM represents
tables as model instances. I still don't see a question there, or at
least one I can answer.

Your question is only vaguely related to the OPs (in that it deals
with the ORM). On mailing lists, some people find replying to another
thread with a different question of your own almost as rude as TYPING
IN ALL CAPS. It is best to start a new thread rather than hijacking
someone elses. Secondly, continually bumping a thread each day is also
very annoying. Both of these things will dissuade people from replying
to you, so bear that in mind.

Netiquette apart, your question is vague. You describe a system where
by you can update various tables, updating the ones you want. This is
a basic feature of ORMs - have you read the tutorial or any of the
documentation on django's ORM?

I think the basic point is that you are far too vague about what you
want. You can't just point at us at some MS relational layer
documentation from 2005 and expect us to wade through it, work out
what you are currently doing, work out if that is applicable to
Django's ORM and formulate a plan for you. You are going to need to do
some of the work yourself.

There are more ORMs out there than you can imagine. You need to work
out what you want from a framework, and evaluate the frameworks out
there to find the suitable one for your project. We can help by
telling you about the Django one, but you need to help by telling us
what you want to do with it (consider creating, reading, updating and
deleting items as something that all the frameworks will do).

I think you will find people here will be willing and responsive to
help you, once you figure out what it is that you want from Django,
and start asking precise questions about what Django can support.

Cheers

Tom

-- 
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.



Re: No module named registrationprofiles

2011-07-08 Thread Karen Tracey
On Jul 8, 11:40 am, arjun  wrote:
> i am running django-registration, django-profiles apps.
> and getting the error 'No module named registrationprofiles' while
> syncdb command is used..
> wat cud be the reason?

A missing comma between the two entries in INSTALLED_APPS.

Karen

-- 
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.



No module named registrationprofiles

2011-07-08 Thread arjun
i am running django-registration, django-profiles apps.
and getting the error 'No module named registrationprofiles' while
syncdb command is used..
wat cud be the reason?

-- 
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.



Re: What is an "application instance"

2011-07-08 Thread Andre Terra
For the record, there is a plan to refactor the concept of 'app' completely,
granted any recent development on that front seems to be mostly restricted
to discussions in django-developers. I believe the proposed changes draw
from the way the admin encapsulates itself in an App class.

https://github.com/django/django/tree/soc2010%2Fapp-loading
http://groups.google.com/group/django-developers/search?&q=app+loading


Cheers,
André

On Fri, Jul 8, 2011 at 11:58 AM, Tom Evans  wrote:

> On Fri, Jul 8, 2011 at 3:43 PM, Thomas Denmark  wrote:
> > Thanks Tom. So I have now read about AdminSite.
> >
> > It seems like they have encapsulated an application into a class. It
> > is the first time I see this. And to use the application, one must
> > instantiate the class. To have several instances, you just instantiate
> > several. That seems kind of straight forward.
> >
> > But it leaves me with more questions.
> >
> > 1) Is there a recipe for encapsulating an application as a class? I
> > can see that the AdminSite has no super class. And I did not find much
> > with googling.
> >
> > 2) All the Django documentation, that I have read has only dealt with
> > building applications like folders with a few files: models.py,
> > views.py and urls.py. That is what happens, when one writes 'admin.py
> > startapp foo'. Is it possible to make several instances of such an
> > application?
> >
> > Thomas
> >
> >
>
> It's really to do with the URL namespace, and nothing to do with
> classes, that is just how the admin is encapsulated.
>
> If you have a project called 'foo' then you might include it's URLs like
> so:
>
>  urlpatterns = patterns(
> (r'^foo/', include('foo.urls')),
>  )
>
> If you wanted to include a second instance of it, you would do this:
>
>  urlpatterns = patterns(
> (r'^foo/', include('foo.urls'), app_name='foo'),
> (r'^bar/', include('foo.urls'), namespace='bar', app_name='foo'),
>  )
>
> So now you have two instances of 'foo' installed. When reversing
> 'foo:some_named_url', Django will look at the current app - if it is
> 'bar', the URLs will resolve to the 'bar' instance. The key thing here
> is that the templates are the same, and Django DTRT when working out
> which urlconf to use.
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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.



Re: Interesting Python obfuscation techniques from DEFCON18 (June 2010)

2011-07-08 Thread creecode
Hello Cal,

Interesting read.  Thanks for posting.

Toodle-looo..
creecode

-- 
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/-/TY4ToUB67AQJ.
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: Using Jinja2

2011-07-08 Thread Shawn Milochik
Did you guys know that Armin Ronacher (the author of Jinja2) is actively 
working on this for Google Summer of Code?


https://www.djangoproject.com/weblog/2011/apr/25/gsoc/

If you're interested in the development of Django it's very informative 
to subscribe to django-developers and lurk. You can also see his status 
updates there.



--
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.



Re: Using Jinja2

2011-07-08 Thread Tomáš Ehrlich
Hi there,
this looks interesting:
http://jinja.pocoo.org/docs/switching/#django

I'll try it soon

On 8 čnc, 16:43, Venkatraman S  wrote:
> On Fri, Jul 8, 2011 at 8:03 PM, akaariai  wrote:
>
> > Trying jinja2 in your project is hard - you are using some template
> > tags, and you would need to port them to jinja2. Then you would need
> > to rewrite your templates so that they work under jinja2. This would
> > take some time for sure.
>
> > What you could do is check out the profiler suggested in this thread.
> > Jinja2 is generally somewhere from 5x to 10x faster that Django
> > templates. So if you can see that half of your time is spent in
> > template rendering, then you could probably almost double the speed of
> > your application using Jinja2. If you don't want to do that, you can
> > check how fast your code is without any template rendering: just
> > return HttpResponse("") from your view. But remember to evaluate your
> > queries, querysets are evaluated only on access. This will give you
> > some clue how much Jinja2 would benefit you.
>
> All the benchmarking that i have seen till now has clearly placed Jinja2
> perform
> way better than django templates and this has made me think; as i like
> taking
> the juice our of every piece of code.
>
> Having said that, i want to brainstorm on how the djano ecosystem can be
> made in
> such a way that the apps that are written are template-engine agnostic.
> For eg, i use many 3rd party apps like endless-pagination, ajax-selects,
> uni-form etc which are mainly 'template-specific' apps. (And i *love* all
> these apps to the core!)
>
> # How easy/tough is it to move a site which already uses django templates
> over to jinja2?
> # What are the points that one should be aware of?
>
> -V 

-- 
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.



Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 4:01 PM, Hummingbird wrote:

> @Cal,
> My apologies if my post has hurted you.
> I didn't mean that.
> I understand that all these open source projects are run by people who
> don't get paid for it.
>
> My point was quite different. It was about knowledge sharing.
> We can re-phrase the question if nobody understands what we mean to
> ask.
> Actually, we are not asking for any exact code or any spoon-feeding.
> We are asking whether anybody has developed a solution similar to
> CursorAdaptor in VFP
>

Being a completely non-Microsoft person, I'm afraid I can't answer your
question.

However, that page contains a lot of tedious info, and I doubt someone would
take the time to read through it.

Could you please explain exactly what features "CursorAdapter" has, that you
are looking for in Django?



> Ed Leafe & Paul McNett have done marvelous work in this area (DABO
> desktop framework).
>
> Instead of making this post very long by giving details of what is a
> CursorAdaptor, pl. refer to --
> http://msdn.microsoft.com/en-us/library/d993hde7(v=vs.80).aspx
>
> Regarding your remark of "Don't expect an instant answer"--
> -- OP was dated 30th June.
> Today is 8th July (an instant???)
>
> Again, pl. excuse me if I have said anything wrong.
> @qMax:  Have you got any way around your question?
>
> ---Vineet
>
> On Jul 8, 6:38 pm, "Cal Leeming [Simplicity Media Ltd]"
>  wrote:
> > Hummingbird,
> >
> > If there is no reply to a question, it's either because people are
> > busy, no one knows the answer, or because the OP did not make any
> > sense. Personally, I read the post and thought "this post makes no
> > sense". OP may want to re-phrase their original post in the form of a
> > real set of questions. If in doubt, please refer to the following
> > document:
> >
> > https://code.djangoproject.com/wiki/UsingTheMailingList
> >
> > In regards to your comment of "Nobody understood the gravity of our
> > post", I refer you to the following line in the above document:
> >
> > Don't expect an instant or one-shot answer. (django-users is *NOT*
> > your personal tutor.)
> >
> > Cal
> >
> >
> >
> > On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird 
> wrote:
> > > Not to put too fine a point on this.
> > > I was hopeful to get some reply on this list (I heard that django
> > > community is superbly active).
> > > But it seems that either this post of mine alongwith "qMax" (OP) was
> > > extremely silly,
> > > OR
> > > Nobody understood the gravity of our post.
> > > In data-centric business apps (not like Yet Another Blog or Movie
> > > Upload), such complexities as we mention in the above post, are a
> > > regular part of life.
> >
> > > Regards,
> > > Vineet
> >
> > > On Jul 5, 9:28 pm, Hummingbird  wrote:
> > >> Can anybody pl. share his/her experience on this issue?
> > >> Thanks.
> >
> > >> On Jul 2, 10:39 am, Hummingbird  wrote:
> >
> > >> > Hi !
> > >> > I have a similar situation.
> > >> > (disclaimer:-- I have tried turbogears & web2py before.
> > >> > But could not find the following functionality there.
> > >> > So I have signed-in here to see whether I can get it in django).
> >
> > >> > My form is composed of fields from various tables.
> > >> > When a user interacts with form, he/she may add/edit/delete/keep
> > >> > unchanged certain fields,
> > >> > After saving the form, I need to understand---
> > >> > 1) which table(s) should receive SQL add statement,
> > >> > 2) which one(s) need update stmt,
> > >> > 3) which one(s) to receive delete stmt.
> >
> > >> > Some examples of (desktop) frameworks having this feature:--
> > >> > i) CursorAdaptor in VFP
> > >> > ii) DABO desktop framework
> > >> > But I am looking for a web framework having this feature.
> >
> > >> > Without a proper method (rather class) to handle it, it would be
> very
> > >> > messy.
> > >> > There will be code repetitions, etc.
> >
> > >> > I am eager to know whether there is any facility to do the above
> thing
> > >> > in django.
> > >> > In that case, I will happily switch to django.
> > >> > Any comments/advise/knowledge-sharing highly appreciated.
> >
> > >> > Thanks.
> >
> > >> > On Jun 30, 9:23 am, qMax  wrote:
> >
> > >> > > Hello here.
> >
> > >> > > My application task is to integrate several applications, and it
> > >> > > should manipulate objects, spread among several tables in several
> > >> > > databases. Final object is constructed by 'joining' tables by
> single
> > >> > > field (or derivatives).
> > >> > > A user should see such objects as solid entities and manipulate
> them
> > >> > > with basic CRUD operations (with search).
> > >> > > Backend should synchronize all changes in all databases.
> > >> > > And i wish i could use admin site for that.
> >
> > >> > > If i guess correctly, all required magic should go into custom
> > >> > > QuerySet implementation to properly translate CRUD operations on
> > >> > > models into various distributed requests on databases, like
> zigzag-
> > >> > > joins, etc ins

Re: Manytoone Form

2011-07-08 Thread Shawn Milochik
Add the field in your ModelForm, just as you would with a form. You're
allowed to do that.

Override the __init__ of your ModelForm subclass and populate the choices.

Override the clean and clean_field functions (if necessary).

Override the save() to populate the field in the other model from your
custom field.

-- 
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.



Re: User based objects

2011-07-08 Thread Shawn Milochik
On Fri, Jul 8, 2011 at 10:28 AM, Praveen Krishna R
 wrote:
> Thank you, Shawn, I didn't knew that! I'm trying on that way now!
>

You're welcome. The one 'gotcha' is that you're going to have to
remove the user from the kwargs before you call the __init__ of the
superclass. Otherwise you'll get an 'unexpected keyword argument'
exception.

Example:


def __init__(self, *args, **kwargs):

self.user = kwargs.pop('user')

super(MyForm, self).__init__(*args, **kwargs)


You can then use self.user in your form's functions for filtering --
probably starting right in __init__ after the super() call to set
self.fields['field_name'].choices to be whatever they should be.

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 3:53 PM, Venkatraman S  wrote:

> Cal,
>
> Quiet frankly, it looks to me that if you are spending some effort on this
> - better start with django on pypy.
> And then probably we can move to 'one-binary' idea.


I much prefer the idea of a true single binary (the way facebook approach
it) with everything statically compiled in, over the concept of a self
extracting chroot, as the latter does sound quite messy.

However, I'd need to find out if nginx/uwsgi/pypy/django would play together
nicely.. so I'm going to spend some hours getting my hands dirty and seeing
what works..- besides, it's a good opportunity to brush up on my C :)


>
>
> -V
>
> --
> 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.
>

-- 
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.



Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Hummingbird
@Cal,
My apologies if my post has hurted you.
I didn't mean that.
I understand that all these open source projects are run by people who
don't get paid for it.

My point was quite different. It was about knowledge sharing.
We can re-phrase the question if nobody understands what we mean to
ask.
Actually, we are not asking for any exact code or any spoon-feeding.
We are asking whether anybody has developed a solution similar to
CursorAdaptor in VFP
Ed Leafe & Paul McNett have done marvelous work in this area (DABO
desktop framework).

Instead of making this post very long by giving details of what is a
CursorAdaptor, pl. refer to --
http://msdn.microsoft.com/en-us/library/d993hde7(v=vs.80).aspx

Regarding your remark of "Don't expect an instant answer"--
-- OP was dated 30th June.
Today is 8th July (an instant???)

Again, pl. excuse me if I have said anything wrong.
@qMax:  Have you got any way around your question?

---Vineet

On Jul 8, 6:38 pm, "Cal Leeming [Simplicity Media Ltd]"
 wrote:
> Hummingbird,
>
> If there is no reply to a question, it's either because people are
> busy, no one knows the answer, or because the OP did not make any
> sense. Personally, I read the post and thought "this post makes no
> sense". OP may want to re-phrase their original post in the form of a
> real set of questions. If in doubt, please refer to the following
> document:
>
> https://code.djangoproject.com/wiki/UsingTheMailingList
>
> In regards to your comment of "Nobody understood the gravity of our
> post", I refer you to the following line in the above document:
>
> Don't expect an instant or one-shot answer. (django-users is *NOT*
> your personal tutor.)
>
> Cal
>
>
>
> On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird  wrote:
> > Not to put too fine a point on this.
> > I was hopeful to get some reply on this list (I heard that django
> > community is superbly active).
> > But it seems that either this post of mine alongwith "qMax" (OP) was
> > extremely silly,
> > OR
> > Nobody understood the gravity of our post.
> > In data-centric business apps (not like Yet Another Blog or Movie
> > Upload), such complexities as we mention in the above post, are a
> > regular part of life.
>
> > Regards,
> > Vineet
>
> > On Jul 5, 9:28 pm, Hummingbird  wrote:
> >> Can anybody pl. share his/her experience on this issue?
> >> Thanks.
>
> >> On Jul 2, 10:39 am, Hummingbird  wrote:
>
> >> > Hi !
> >> > I have a similar situation.
> >> > (disclaimer:-- I have tried turbogears & web2py before.
> >> > But could not find the following functionality there.
> >> > So I have signed-in here to see whether I can get it in django).
>
> >> > My form is composed of fields from various tables.
> >> > When a user interacts with form, he/she may add/edit/delete/keep
> >> > unchanged certain fields,
> >> > After saving the form, I need to understand---
> >> > 1) which table(s) should receive SQL add statement,
> >> > 2) which one(s) need update stmt,
> >> > 3) which one(s) to receive delete stmt.
>
> >> > Some examples of (desktop) frameworks having this feature:--
> >> > i) CursorAdaptor in VFP
> >> > ii) DABO desktop framework
> >> > But I am looking for a web framework having this feature.
>
> >> > Without a proper method (rather class) to handle it, it would be very
> >> > messy.
> >> > There will be code repetitions, etc.
>
> >> > I am eager to know whether there is any facility to do the above thing
> >> > in django.
> >> > In that case, I will happily switch to django.
> >> > Any comments/advise/knowledge-sharing highly appreciated.
>
> >> > Thanks.
>
> >> > On Jun 30, 9:23 am, qMax  wrote:
>
> >> > > Hello here.
>
> >> > > My application task is to integrate several applications, and it
> >> > > should manipulate objects, spread among several tables in several
> >> > > databases. Final object is constructed by 'joining' tables by single
> >> > > field (or derivatives).
> >> > > A user should see such objects as solid entities and manipulate them
> >> > > with basic CRUD operations (with search).
> >> > > Backend should synchronize all changes in all databases.
> >> > > And i wish i could use admin site for that.
>
> >> > > If i guess correctly, all required magic should go into custom
> >> > > QuerySet implementation to properly translate CRUD operations on
> >> > > models into various distributed requests on databases, like zigzag-
> >> > > joins, etc instead of usual sql.Queries.
>
> >> > > I wonder if QuerySet is the only consolidation of such interface.
> >> > > What else should i customize to make it work? (i see at least
> >> > > db.models.Manager should be customized to use another queryset impl)
> >> > > Also, how to figure out what subset of QuerySet interface is used in
> >> > > admin site?
>
> >> > > Maybe, someone already managed similar task and there are some 
> >> > > recipes?- Hide quoted text -
>
> >> > - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -
>
> > --
> > You received this message because you are sub

Re: What is an "application instance"

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 3:43 PM, Thomas Denmark  wrote:
> Thanks Tom. So I have now read about AdminSite.
>
> It seems like they have encapsulated an application into a class. It
> is the first time I see this. And to use the application, one must
> instantiate the class. To have several instances, you just instantiate
> several. That seems kind of straight forward.
>
> But it leaves me with more questions.
>
> 1) Is there a recipe for encapsulating an application as a class? I
> can see that the AdminSite has no super class. And I did not find much
> with googling.
>
> 2) All the Django documentation, that I have read has only dealt with
> building applications like folders with a few files: models.py,
> views.py and urls.py. That is what happens, when one writes 'admin.py
> startapp foo'. Is it possible to make several instances of such an
> application?
>
> Thomas
>
>

It's really to do with the URL namespace, and nothing to do with
classes, that is just how the admin is encapsulated.

If you have a project called 'foo' then you might include it's URLs like so:

  urlpatterns = patterns(
 (r'^foo/', include('foo.urls')),
  )

If you wanted to include a second instance of it, you would do this:

  urlpatterns = patterns(
 (r'^foo/', include('foo.urls'), app_name='foo'),
 (r'^bar/', include('foo.urls'), namespace='bar', app_name='foo'),
  )

So now you have two instances of 'foo' installed. When reversing
'foo:some_named_url', Django will look at the current app - if it is
'bar', the URLs will resolve to the 'bar' instance. The key thing here
is that the templates are the same, and Django DTRT when working out
which urlconf to use.

Cheers

Tom

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Venkatraman S
Cal,

Quiet frankly, it looks to me that if you are spending some effort on this -
better start with django on pypy.
And then probably we can move to 'one-binary' idea.

-V

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 3:26 PM, Javier Guerra Giraldez
wrote:

> On Fri, Jul 8, 2011 at 9:18 AM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
> > In the above scenario, ulimit would apply that limit to everything
> > within that forked supervisord instance, correct?
> >
> > Therefore, if nginx-wrapper calls ulimit at almost the exact same
> > point as other-wrapper, there could be a race condition between the
> > time it takes to jump from ulimit to the binary, where the wrong
> > address space is inherited.
>
> if nginx-wrapper and other-wrapper is each one a different process,
> then ulimit would affect only to that process and descendants.  it
> doesn't propagate to brother-processes
>

Ah, that's exactly what I needed to know.

Thanks :)


>
> besides, this is posix we're talking about; there are no race
> conditions in calling executables or atomic system calls


> --
> Javier
>
> --
> 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.
>
>

-- 
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.



Re: What is an "application instance"

2011-07-08 Thread Thomas Denmark
Thanks Tom. So I have now read about AdminSite.

It seems like they have encapsulated an application into a class. It
is the first time I see this. And to use the application, one must
instantiate the class. To have several instances, you just instantiate
several. That seems kind of straight forward.

But it leaves me with more questions.

1) Is there a recipe for encapsulating an application as a class? I
can see that the AdminSite has no super class. And I did not find much
with googling.

2) All the Django documentation, that I have read has only dealt with
building applications like folders with a few files: models.py,
views.py and urls.py. That is what happens, when one writes 'admin.py
startapp foo'. Is it possible to make several instances of such an
application?

Thomas



On Jul 8, 12:02 pm, Tom Evans  wrote:
> On Fri, Jul 8, 2011 at 10:45 AM, Thomas Larsen Wessel  
> wrote:
>
> > I'm reading the URL Dispatcher documentation, at
> >https://docs.djangoproject.com/en/dev/topics/http/urls/.
>
> > It mentions "application instance" several times. I do not know / understand
> > what an application instance is.
>
> > Could somebody please explain this, preferably with an example which
> > demonstrates having several instances of an application.
>
> > Thanks
>
> Eg, having two instances of the admin app:
>
> https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#multiple-adm...
>
> Cheers
>
> Tom

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
I'd imagine this would probably join the same bucket as "shedskin", as it's
experimental, lacking feature support, and little known compatibility
testing.

On Fri, Jul 8, 2011 at 3:35 PM, Venkatraman S  wrote:

> And btw, AlexGaylnor, recently wrote a python 
> decompiler;
> probably this can be leveraged ?
>
>
> -V
>
> --
> 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.
>

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 3:24 PM, Brian Bouterse  wrote:

> I've been thinking about this for a day or two now, and here are some
> thoughts:
>
> One option to possibly compile python to C++ is shed 
> skin,
> to translate python code into a C binary.  Note that the compiled C code is
> statically compiled which produces a C instruction stream that is static
> (independant of the actual control flow).  I haven't run shed skin myself,
> and there are language restrictions shed skin requires that would need to be
> looked into since I'm not familiar with django's comatibility with shed
> skin.
>

Shedskin also looks interesting, but worries me slightly on it's lack of
known compatibility with Django.


>
> Note that the statically built C code might be less efficient than a Just
> In Time compiled counterpart.  I have used pypy  before
> which makes python code run fast  and run my own
> speed tests versus python code run through CPython, and pypy significantly
> (over double typically) outperforms the same code run through CPython.  What
> you would get with pypy would not be a single, pre-compiled binary, but the
> speed ups of running django (and potentially nginx and gunicorn, etc)
> through a pypy interpreter could potentially outperform a statically built
> one.  After all the PHP to C translation speedup that facebook claims is
> just over a 50% increase (anecdotally told in the video), pypy already does
> that for me versus the CPython.  I have also heard of folks using pypy in
> production serving django sites, so I think Django is ready for this.
>

Wow, I didn't know about pypy, those benchmarks are very impressive, and
should certainly be considered for a project like this.


>
> I think also value the bundling of the web server, static content, and
> application together is the value so that you don't have to manage the
> stack. Requiring it to be a *single* binary is nice, but I don't think buys
> you much really.  After all you could always just tar up the entire project
> and deliver it that way.
>

Another possible issue about compiling everything as a single binary, is
that we could get very strange compatibility problems between components.

An easier way would be to compile a single compressed binary (containing a
tar with the chroot/stack/webapp), which then self extracted into memory.

I'm torn between both to be honest. A true single binary is cleaner, but a
self extracting binary is easier.

If we opt'd for having a true single binary, there would defo need to be
some other experienced C coders on the project, as my knowledge of C is weak
and progress would be painfully slow lol.


>
> What still needs to be figured out is how to get pypy reading the nginx and
> gunicorn C code natively and then switching over and using JIT compilation
> on the python code from the gunicorn->django entry point.
>

One of the principles is to eventually allow this to work with other
languages (such as PHP or Ruby), so we can't lock it down too heavily to
Python.


>
> I would love to hear what others think about this type of thinking.
>
> Best,
> Brian
>
> On Fri, Jul 8, 2011 at 5:55 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> Also, one of the things you mentioned (about security updates of the
>> chroot) is something i have been pondering today. Although a single compile
>> will mean recompile everytime a security announce is released, this is
>> unavoidable.
>>
>> This is my idea for handling security announcements:
>>
>> The single binary will have support for monitoring various sources for
>> indications as to whether or not there is a security announcement for one or
>> more of its internal componants. Within the configuration, the user can set
>> an email address which these alerts are sent to. To avoid any single person
>> being the weak link, we'll make it monitor not only the official project
>> announce, but also remote security repos, to give it hints as to whether or
>> not there is a security release for any specific component.
>>
>> The above idea will need some tweaking ofc, or maybe someone else could
>> think of a better way to do this..?
>>
>> This also makes me think about build control. I guess each project would
>> end up having a build file for future rebuilds, would it be wise to
>> integrate this into the binary, as a backup incase the original is lost??
>>
>> So many thoughts..
>>
>> Cal
>> On 8 Jul 2011 10:47, "Cal Leeming [Simplicity Media Ltd]" <
>> cal.leem...@simplicitymedialtd.co.uk> wrote:
>> > Hi Bjarni,
>> >
>> > Thanks for your input. As pointed out earlier in the thread, the end
>> goal is
>> > to provide a single binary that is entirely host independant, contains
>> the
>> > chroot/stack needed by the webapp etc.
>> >
>> > You really need to watch the facebook video link i included earlier in
>> the
>> > thread to understand what we're trying 

Using Jinja2

2011-07-08 Thread Venkatraman S
On Fri, Jul 8, 2011 at 8:03 PM, akaariai  wrote:

>
> Trying jinja2 in your project is hard - you are using some template
> tags, and you would need to port them to jinja2. Then you would need
> to rewrite your templates so that they work under jinja2. This would
> take some time for sure.
>
> What you could do is check out the profiler suggested in this thread.
> Jinja2 is generally somewhere from 5x to 10x faster that Django
> templates. So if you can see that half of your time is spent in
> template rendering, then you could probably almost double the speed of
> your application using Jinja2. If you don't want to do that, you can
> check how fast your code is without any template rendering: just
> return HttpResponse("") from your view. But remember to evaluate your
> queries, querysets are evaluated only on access. This will give you
> some clue how much Jinja2 would benefit you.
>

All the benchmarking that i have seen till now has clearly placed Jinja2
perform
way better than django templates and this has made me think; as i like
taking
the juice our of every piece of code.

Having said that, i want to brainstorm on how the djano ecosystem can be
made in
such a way that the apps that are written are template-engine agnostic.
For eg, i use many 3rd party apps like endless-pagination, ajax-selects,
uni-form etc which are mainly 'template-specific' apps. (And i *love* all
these apps to the core!)

# How easy/tough is it to move a site which already uses django templates
over to jinja2?
# What are the points that one should be aware of?

-V 

-- 
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.



Re: django/python performance vs play/java

2011-07-08 Thread Venkatraman S
On Fri, Jul 8, 2011 at 8:03 PM, akaariai  wrote:

>
> Trying jinja2 in your project is hard - you are using some template
> tags, and you would need to port them to jinja2. Then you would need
> to rewrite your templates so that they work under jinja2. This would
> take some time for sure.
>
> What you could do is check out the profiler suggested in this thread.
> Jinja2 is generally somewhere from 5x to 10x faster that Django
> templates. So if you can see that half of your time is spent in
> template rendering, then you could probably almost double the speed of
> your application using Jinja2. If you don't want to do that, you can
> check how fast your code is without any template rendering: just
> return HttpResponse("") from your view. But remember to evaluate your
> queries, querysets are evaluated only on access. This will give you
> some clue how much Jinja2 would benefit you.
>

Actually, i was just wondering more about this. I recently tweaked my app
and cleaned up
all the expensive queries etc; and wanted to know the issues with jinja2.

I am starting a different thread on this; so that its easy to track.

-V

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Venkatraman S
And btw, AlexGaylnor, recently wrote a python
decompiler;
probably this can be leveraged ?

-V

-- 
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.



Re: django/python performance vs play/java

2011-07-08 Thread akaariai
On Jul 8, 4:03 pm, drakkan  wrote:
> I have no time to try jinja2 now, I guess it should speed up django a
> bit

Trying jinja2 in your project is hard - you are using some template
tags, and you would need to port them to jinja2. Then you would need
to rewrite your templates so that they work under jinja2. This would
take some time for sure.

What you could do is check out the profiler suggested in this thread.
Jinja2 is generally somewhere from 5x to 10x faster that Django
templates. So if you can see that half of your time is spent in
template rendering, then you could probably almost double the speed of
your application using Jinja2. If you don't want to do that, you can
check how fast your code is without any template rendering: just
return HttpResponse("") from your view. But remember to evaluate your
queries, querysets are evaluated only on access. This will give you
some clue how much Jinja2 would benefit you.

 - Anssi

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Venkatraman S
On Fri, Jul 8, 2011 at 7:54 PM, Brian Bouterse  wrote:

> I have also heard of folks using pypy in production serving django sites,
> so I think Django is ready for this.


Interesting. Can you share more on this. Any caveats/tradeoffs?


-V

-- 
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.



Re: User based objects

2011-07-08 Thread Praveen Krishna R
*Thank you, Shawn, I didn't knew that! I'm trying on that way now!
*
On Fri, Jul 8, 2011 at 6:52 PM, Shawn Milochik  wrote:

> You can certainly pass request.user to the form from your view.
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Javier Guerra Giraldez
On Fri, Jul 8, 2011 at 9:18 AM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> In the above scenario, ulimit would apply that limit to everything
> within that forked supervisord instance, correct?
>
> Therefore, if nginx-wrapper calls ulimit at almost the exact same
> point as other-wrapper, there could be a race condition between the
> time it takes to jump from ulimit to the binary, where the wrong
> address space is inherited.

if nginx-wrapper and other-wrapper is each one a different process,
then ulimit would affect only to that process and descendants.  it
doesn't propagate to brother-processes

besides, this is posix we're talking about; there are no race
conditions in calling executables or atomic system calls

-- 
Javier

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Brian Bouterse
I've been thinking about this for a day or two now, and here are some
thoughts:

One option to possibly compile python to C++ is shed
skin,
to translate python code into a C binary.  Note that the compiled C code is
statically compiled which produces a C instruction stream that is static
(independant of the actual control flow).  I haven't run shed skin myself,
and there are language restrictions shed skin requires that would need to be
looked into since I'm not familiar with django's comatibility with shed
skin.

Note that the statically built C code might be less efficient than a Just In
Time compiled counterpart.  I have used pypy  before which
makes python code run fast  and run my own speed
tests versus python code run through CPython, and pypy significantly (over
double typically) outperforms the same code run through CPython.  What you
would get with pypy would not be a single, pre-compiled binary, but the
speed ups of running django (and potentially nginx and gunicorn, etc)
through a pypy interpreter could potentially outperform a statically built
one.  After all the PHP to C translation speedup that facebook claims is
just over a 50% increase (anecdotally told in the video), pypy already does
that for me versus the CPython.  I have also heard of folks using pypy in
production serving django sites, so I think Django is ready for this.

I think also value the bundling of the web server, static content, and
application together is the value so that you don't have to manage the
stack. Requiring it to be a *single* binary is nice, but I don't think buys
you much really.  After all you could always just tar up the entire project
and deliver it that way.

What still needs to be figured out is how to get pypy reading the nginx and
gunicorn C code natively and then switching over and using JIT compilation
on the python code from the gunicorn->django entry point.

I would love to hear what others think about this type of thinking.

Best,
Brian

On Fri, Jul 8, 2011 at 5:55 AM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Also, one of the things you mentioned (about security updates of the
> chroot) is something i have been pondering today. Although a single compile
> will mean recompile everytime a security announce is released, this is
> unavoidable.
>
> This is my idea for handling security announcements:
>
> The single binary will have support for monitoring various sources for
> indications as to whether or not there is a security announcement for one or
> more of its internal componants. Within the configuration, the user can set
> an email address which these alerts are sent to. To avoid any single person
> being the weak link, we'll make it monitor not only the official project
> announce, but also remote security repos, to give it hints as to whether or
> not there is a security release for any specific component.
>
> The above idea will need some tweaking ofc, or maybe someone else could
> think of a better way to do this..?
>
> This also makes me think about build control. I guess each project would
> end up having a build file for future rebuilds, would it be wise to
> integrate this into the binary, as a backup incase the original is lost??
>
> So many thoughts..
>
> Cal
> On 8 Jul 2011 10:47, "Cal Leeming [Simplicity Media Ltd]" <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
> > Hi Bjarni,
> >
> > Thanks for your input. As pointed out earlier in the thread, the end goal
> is
> > to provide a single binary that is entirely host independant, contains
> the
> > chroot/stack needed by the webapp etc.
> >
> > You really need to watch the facebook video link i included earlier in
> the
> > thread to understand what we're trying to achieve.
> >
> > Im drawing up the design principles today, which should give you a better
> > idea.. but in a nutshell, imagine a single binary which would run
> entirely
> > from memory, be completely host independant, contain everything the
> webapp
> > needed (stack/chroot/deps etc), and have a nice ncurses interface to
> > configure this all from (with features like automatic memory usage
> > calculation / configuration - something which is overlooked oh so many
> > times)
> > On 8 Jul 2011 08:53, "Bjarni Rúnar Einarsson"  wrote:
>
> --
> 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.
>



-- 
Brian Bouterse
ITng Services

-- 
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+uns

Manytoone Form

2011-07-08 Thread Magrelo
Hello everyone,

I've created a onetomany relationship between two models. The form
that has the foreignkey I can use the formset without problems, but
now I want to fill this relation through the form of the model that
has the many, I know I can retrieve the that using the *_set, but how
I create a MultipleChoiceField form element of this data?

Thanks for any help!

Regards,

Thiago

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 3:18 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> On Fri, Jul 8, 2011 at 3:13 PM, Tom Evans  wrote:
>> On Fri, Jul 8, 2011 at 3:04 PM, Cal Leeming [Simplicity Media Ltd]
>>  wrote:
>>> Although I'm sure both methods would work, would you recommend any
>>> particular preference? (as my preference is merely on the fact that
>>> having a wrapper seems a lot cleaner).
>>>
>>> I guess the custom binary I was trying to think of earlier used the
>>> setrlimit/fork method mentioned above.
>>
>> There is only one way to modify limits, and that is setrlimit, which
>> is how ulimit is implemented. Given ulimit and setrlimit are both in
>> POSIX, I don't see why anyone would write their own wrapper to do
>> this.
>
> My worries were that in the event of children processes spawning some

processes spawning from*

> a single parent, both executing ulimit, there could potentially be a
> race condition.
>
> For example:
>
> shell
>> supervisord (forks, and shell exits)
>    > calls nginx-wrapper
>        > calls ulimit
>        > calls nginx
>    > calls other-wrapper
>        > calls ulimit
>        > calls other
>
> In the above scenario, ulimit would apply that limit to everything
> within that forked supervisord instance, correct?
>
> Therefore, if nginx-wrapper calls ulimit at almost the exact same
> point as other-wrapper, there could be a race condition between the
> time it takes to jump from ulimit to the binary, where the wrong
> address space is inherited.
>
> Or have I understood that wrong??
>
>>
>> The way I typically add limits is to edit the rc (startup) script, and
>> add a call to ulimit there. This applies the limit to the process
>> which launches the daemon, its a simple clean one liner, and doesn't
>> require massaging command line arguments into a sh -c '' line (or
>> bash).
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Jul 8, 2011 at 3:13 PM, Tom Evans  wrote:
> On Fri, Jul 8, 2011 at 3:04 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
>> Although I'm sure both methods would work, would you recommend any
>> particular preference? (as my preference is merely on the fact that
>> having a wrapper seems a lot cleaner).
>>
>> I guess the custom binary I was trying to think of earlier used the
>> setrlimit/fork method mentioned above.
>
> There is only one way to modify limits, and that is setrlimit, which
> is how ulimit is implemented. Given ulimit and setrlimit are both in
> POSIX, I don't see why anyone would write their own wrapper to do
> this.

My worries were that in the event of children processes spawning some
a single parent, both executing ulimit, there could potentially be a
race condition.

For example:

shell
> supervisord (forks, and shell exits)
> calls nginx-wrapper
> calls ulimit
> calls nginx
> calls other-wrapper
> calls ulimit
> calls other

In the above scenario, ulimit would apply that limit to everything
within that forked supervisord instance, correct?

Therefore, if nginx-wrapper calls ulimit at almost the exact same
point as other-wrapper, there could be a race condition between the
time it takes to jump from ulimit to the binary, where the wrong
address space is inherited.

Or have I understood that wrong??

>
> The way I typically add limits is to edit the rc (startup) script, and
> add a call to ulimit there. This applies the limit to the process
> which launches the daemon, its a simple clean one liner, and doesn't
> require massaging command line arguments into a sh -c '' line (or
> bash).
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 3:04 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Although I'm sure both methods would work, would you recommend any
> particular preference? (as my preference is merely on the fact that
> having a wrapper seems a lot cleaner).
>
> I guess the custom binary I was trying to think of earlier used the
> setrlimit/fork method mentioned above.

There is only one way to modify limits, and that is setrlimit, which
is how ulimit is implemented. Given ulimit and setrlimit are both in
POSIX, I don't see why anyone would write their own wrapper to do
this.

The way I typically add limits is to edit the rc (startup) script, and
add a call to ulimit there. This applies the limit to the process
which launches the daemon, its a simple clean one liner, and doesn't
require massaging command line arguments into a sh -c '' line (or
bash).

Cheers

Tom

-- 
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.



Interesting Python obfuscation techniques from DEFCON18 (June 2010)

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Not sure if anyone else has seen this:

http://www.defcon.org/images/defcon-18/dc-18-presentations/RSmith/DEFCON-18-RSmith-pyREtic.pdf

Well worth reading if you are into this sort of thing.

Cal

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Here is what I've come up with so far:

https://github.com/foxx/jennifer/wiki/Design-Sketch

I've enabled public edit mode, so feel free to add/change.

Cal

On Fri, Jul 8, 2011 at 10:55 AM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Also, one of the things you mentioned (about security updates of the chroot)
> is something i have been pondering today. Although a single compile will
> mean recompile everytime a security announce is released, this is
> unavoidable.
>
> This is my idea for handling security announcements:
>
> The single binary will have support for monitoring various sources for
> indications as to whether or not there is a security announcement for one or
> more of its internal componants. Within the configuration, the user can set
> an email address which these alerts are sent to. To avoid any single person
> being the weak link, we'll make it monitor not only the official project
> announce, but also remote security repos, to give it hints as to whether or
> not there is a security release for any specific component.
>
> The above idea will need some tweaking ofc, or maybe someone else could
> think of a better way to do this..?
>
> This also makes me think about build control. I guess each project would end
> up having a build file for future rebuilds, would it be wise to integrate
> this into the binary, as a backup incase the original is lost??
>
> So many thoughts..
>
> Cal
>
> On 8 Jul 2011 10:47, "Cal Leeming [Simplicity Media Ltd]"
>  wrote:
>> Hi Bjarni,
>>
>> Thanks for your input. As pointed out earlier in the thread, the end goal
>> is
>> to provide a single binary that is entirely host independant, contains the
>> chroot/stack needed by the webapp etc.
>>
>> You really need to watch the facebook video link i included earlier in the
>> thread to understand what we're trying to achieve.
>>
>> Im drawing up the design principles today, which should give you a better
>> idea.. but in a nutshell, imagine a single binary which would run entirely
>> from memory, be completely host independant, contain everything the webapp
>> needed (stack/chroot/deps etc), and have a nice ncurses interface to
>> configure this all from (with features like automatic memory usage
>> calculation / configuration - something which is overlooked oh so many
>> times)
>> On 8 Jul 2011 08:53, "Bjarni Rúnar Einarsson"  wrote:
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
My responses below.

On Fri, Jul 8, 2011 at 2:55 PM, Michal Petrucha  wrote:
> On Fri, Jul 08, 2011 at 02:43:11PM +0100, Cal Leeming [Simplicity Media Ltd] 
> wrote:
>> Sorry, I should have given a bit more detail.
>>
>> Using ulimit is going to be an issue as it relies on the host allowing
>> users to modify their ulimit (some aren't allowed). It also then
>> applies that rule to any other processes within that user, which is
>> bad as different processes may need different limits.
>
> My bash(1) man page says the following:
> "Provides control over the resources available to the shell and to
> processes started by it, on systems that allow such control."
>
> Also, setrlimit(3) states this:
> "A child process created via fork(2) inherits its parent's resource
> limits.  Resource limits are preserved across execve(2)."

Ah, I found setrlimit earlier, but I somehow missed the section about
fork() inheriting the parent's resource limits (guess I skimmed
through the man too quickly), so many thanks for clarifying this.

>
> Which means, if you set a ulimit in a process, only the process itself
> and its children are affected. At least that's how I understand it.
>
> My understanding is backed by the fact that online judges used in ACM
> ICPC-like contest use setrlimit in their sandboxes to limit the memory
> for submitted solutions. (-;

Ack.

>
>> I have seen other examples in the past of binaries being wrapped,
>> which then applied a memory limit, but I can't for the life of me
>> remember what it was called. :(
>
> Just running it as
> bash -c 'ulimit -S ; command' should be enough.
> Or if you want, you can create your own wrapper in C which calls
> setrlimit and then execs the binary.

Although I'm sure both methods would work, would you recommend any
particular preference? (as my preference is merely on the fact that
having a wrapper seems a lot cleaner).

I guess the custom binary I was trying to think of earlier used the
setrlimit/fork method mentioned above.

>
> Michal
>

-- 
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.



Re: anybody using PhoneGap with Django

2011-07-08 Thread Brian Bouterse
I would be interested to hear this as well...

On Fri, Jul 8, 2011 at 12:44 AM, John Fabiani  wrote:

> On Thursday, July 07, 2011 08:48:51 pm Andy McKay wrote:
> > On 2011-07-07, at 2:22 PM, John Fabiani wrote:
> > > I'm wondering if anyone has had any success with PhoneGap and Django?
> >
> > Yes.
> > --
> >   Andy McKay
> >   a...@clearwind.ca
> >   twitter: @andymckay
>
> LOL - I guess I could have asked a better question.  Can I assume you have
> had
> success with Django and PhoneGap?  If so would you take the time to explain
> in
> a general your experience with PhoneGap.  I have been told that the
> combination is very slow - although I don't see any reason that it would
> be.
> I was also told that debugging was very difficult.
>
> Johnf
>
> --
> 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.
>
>


-- 
Brian Bouterse
ITng Services

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Michal Petrucha
On Fri, Jul 08, 2011 at 02:43:11PM +0100, Cal Leeming [Simplicity Media Ltd] 
wrote:
> Sorry, I should have given a bit more detail.
> 
> Using ulimit is going to be an issue as it relies on the host allowing
> users to modify their ulimit (some aren't allowed). It also then
> applies that rule to any other processes within that user, which is
> bad as different processes may need different limits.

My bash(1) man page says the following:
"Provides control over the resources available to the shell and to
processes started by it, on systems that allow such control."

Also, setrlimit(3) states this:
"A child process created via fork(2) inherits its parent's resource
limits.  Resource limits are preserved across execve(2)."

Which means, if you set a ulimit in a process, only the process itself
and its children are affected. At least that's how I understand it.

My understanding is backed by the fact that online judges used in ACM
ICPC-like contest use setrlimit in their sandboxes to limit the memory
for submitted solutions. (-;

> I have seen other examples in the past of binaries being wrapped,
> which then applied a memory limit, but I can't for the life of me
> remember what it was called. :(

Just running it as
bash -c 'ulimit -S ; command' should be enough.
Or if you want, you can create your own wrapper in C which calls
setrlimit and then execs the binary.

Michal


signature.asc
Description: Digital signature


Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Hmm, I should have posted this to a C mailing list, as it's extremely
off topic for Django.

I'll move this discussion to a different list.. but here's what I've
found so far (for anyone interested).

Within C code, setting 'rlim_max' allows you to set a floor limit for
a process (http://linux.die.net/man/2/setrlimit). However, I am yet to
find out if this limit is inherited after spawning/forking.


On Fri, Jul 8, 2011 at 2:43 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Thank you for taking the time to reply though!
>
> On Fri, Jul 8, 2011 at 2:33 PM, Tom Evans  wrote:
>> On Fri, Jul 8, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd]
>>  wrote:
>>> Hi Roberto,
>>>
>>> Wonder if you might be able to give me some advice..
>>>
>>> Is there is a way to limit the address space of any other binary,
>>> without relying on /etc/security/limits.conf??
>>>
>>> For example, is it possible to do something like this:
>>>
>>> ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
>>>
>>> ^^ that would then wrap the binary, enforcing a maximum address space of 
>>> 256M.
>>>
>>> As you gave the option --limit-as to uwsgi, which can apply to any
>>> python webapp, I was wondering if it's possible for us to do the same,
>>> but without compiling the original binary into uwsgi.
>>>
>>> Let me know if the above doesn't make any sense lol.
>>>
>>> Cal
>>>
>>
>> ulimit -a
>>
>> Eg: ulimit -s 4096
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 2:43 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Sorry, I should have given a bit more detail.
>
> Using ulimit is going to be an issue as it relies on the host allowing
> users to modify their ulimit (some aren't allowed). It also then
> applies that rule to any other processes within that user, which is
> bad as different processes may need different limits.

ulimit doesn't do that. ulimit as a user only allows a user to lower
their hard limits to something in the range (0, hard limit). Only
super user can increase limits.

It also only applies to processes created after ulimit has run.
Therefore, your server start script could (probably should) apply
limits to the server processes, whilst not affecting the users limits
in their shell or other processes.

>
> I have seen other examples in the past of binaries being wrapped,
> which then applied a memory limit, but I can't for the life of me
> remember what it was called. :(
>

It's called ulimit. This is the designed use for it.

Cheers

Tom

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Thank you for taking the time to reply though!

On Fri, Jul 8, 2011 at 2:33 PM, Tom Evans  wrote:
> On Fri, Jul 8, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
>> Hi Roberto,
>>
>> Wonder if you might be able to give me some advice..
>>
>> Is there is a way to limit the address space of any other binary,
>> without relying on /etc/security/limits.conf??
>>
>> For example, is it possible to do something like this:
>>
>> ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
>>
>> ^^ that would then wrap the binary, enforcing a maximum address space of 
>> 256M.
>>
>> As you gave the option --limit-as to uwsgi, which can apply to any
>> python webapp, I was wondering if it's possible for us to do the same,
>> but without compiling the original binary into uwsgi.
>>
>> Let me know if the above doesn't make any sense lol.
>>
>> Cal
>>
>
> ulimit -a
>
> Eg: ulimit -s 4096
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Sorry, I should have given a bit more detail.

Using ulimit is going to be an issue as it relies on the host allowing
users to modify their ulimit (some aren't allowed). It also then
applies that rule to any other processes within that user, which is
bad as different processes may need different limits.

I have seen other examples in the past of binaries being wrapped,
which then applied a memory limit, but I can't for the life of me
remember what it was called. :(

On Fri, Jul 8, 2011 at 2:33 PM, Tom Evans  wrote:
> On Fri, Jul 8, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
>> Hi Roberto,
>>
>> Wonder if you might be able to give me some advice..
>>
>> Is there is a way to limit the address space of any other binary,
>> without relying on /etc/security/limits.conf??
>>
>> For example, is it possible to do something like this:
>>
>> ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
>>
>> ^^ that would then wrap the binary, enforcing a maximum address space of 
>> 256M.
>>
>> As you gave the option --limit-as to uwsgi, which can apply to any
>> python webapp, I was wondering if it's possible for us to do the same,
>> but without compiling the original binary into uwsgi.
>>
>> Let me know if the above doesn't make any sense lol.
>>
>> Cal
>>
>
> ulimit -a
>
> Eg: ulimit -s 4096
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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.



Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Hummingbird,

If there is no reply to a question, it's either because people are
busy, no one knows the answer, or because the OP did not make any
sense. Personally, I read the post and thought "this post makes no
sense". OP may want to re-phrase their original post in the form of a
real set of questions. If in doubt, please refer to the following
document:

https://code.djangoproject.com/wiki/UsingTheMailingList

In regards to your comment of "Nobody understood the gravity of our
post", I refer you to the following line in the above document:

Don't expect an instant or one-shot answer. (django-users is *NOT*
your personal tutor.)

Cal

On Fri, Jul 8, 2011 at 2:19 PM, Hummingbird  wrote:
> Not to put too fine a point on this.
> I was hopeful to get some reply on this list (I heard that django
> community is superbly active).
> But it seems that either this post of mine alongwith "qMax" (OP) was
> extremely silly,
> OR
> Nobody understood the gravity of our post.
> In data-centric business apps (not like Yet Another Blog or Movie
> Upload), such complexities as we mention in the above post, are a
> regular part of life.
>
> Regards,
> Vineet
>
> On Jul 5, 9:28 pm, Hummingbird  wrote:
>> Can anybody pl. share his/her experience on this issue?
>> Thanks.
>>
>> On Jul 2, 10:39 am, Hummingbird  wrote:
>>
>>
>>
>> > Hi !
>> > I have a similar situation.
>> > (disclaimer:-- I have tried turbogears & web2py before.
>> > But could not find the following functionality there.
>> > So I have signed-in here to see whether I can get it in django).
>>
>> > My form is composed of fields from various tables.
>> > When a user interacts with form, he/she may add/edit/delete/keep
>> > unchanged certain fields,
>> > After saving the form, I need to understand---
>> > 1) which table(s) should receive SQL add statement,
>> > 2) which one(s) need update stmt,
>> > 3) which one(s) to receive delete stmt.
>>
>> > Some examples of (desktop) frameworks having this feature:--
>> > i) CursorAdaptor in VFP
>> > ii) DABO desktop framework
>> > But I am looking for a web framework having this feature.
>>
>> > Without a proper method (rather class) to handle it, it would be very
>> > messy.
>> > There will be code repetitions, etc.
>>
>> > I am eager to know whether there is any facility to do the above thing
>> > in django.
>> > In that case, I will happily switch to django.
>> > Any comments/advise/knowledge-sharing highly appreciated.
>>
>> > Thanks.
>>
>> > On Jun 30, 9:23 am, qMax  wrote:
>>
>> > > Hello here.
>>
>> > > My application task is to integrate several applications, and it
>> > > should manipulate objects, spread among several tables in several
>> > > databases. Final object is constructed by 'joining' tables by single
>> > > field (or derivatives).
>> > > A user should see such objects as solid entities and manipulate them
>> > > with basic CRUD operations (with search).
>> > > Backend should synchronize all changes in all databases.
>> > > And i wish i could use admin site for that.
>>
>> > > If i guess correctly, all required magic should go into custom
>> > > QuerySet implementation to properly translate CRUD operations on
>> > > models into various distributed requests on databases, like zigzag-
>> > > joins, etc instead of usual sql.Queries.
>>
>> > > I wonder if QuerySet is the only consolidation of such interface.
>> > > What else should i customize to make it work? (i see at least
>> > > db.models.Manager should be customized to use another queryset impl)
>> > > Also, how to figure out what subset of QuerySet interface is used in
>> > > admin site?
>>
>> > > Maybe, someone already managed similar task and there are some recipes?- 
>> > > Hide quoted text -
>>
>> > - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
>
> --
> 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.
>
>

-- 
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.



Re: Limiting the address space of any other binary..?

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 2:23 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Hi Roberto,
>
> Wonder if you might be able to give me some advice..
>
> Is there is a way to limit the address space of any other binary,
> without relying on /etc/security/limits.conf??
>
> For example, is it possible to do something like this:
>
> ./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here
>
> ^^ that would then wrap the binary, enforcing a maximum address space of 256M.
>
> As you gave the option --limit-as to uwsgi, which can apply to any
> python webapp, I was wondering if it's possible for us to do the same,
> but without compiling the original binary into uwsgi.
>
> Let me know if the above doesn't make any sense lol.
>
> Cal
>

ulimit -a

Eg: ulimit -s 4096

Cheers

Tom

-- 
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.



Re: NoReverseMatch in django production server

2011-07-08 Thread urukay
Hi,

try this in obras urls.py:

obras urls.py:

from django.conf.urls.defaults import *

urlpatterns = patterns('obras.views',
url(r'^presobra/$', 'pres_obra', name='pres_obra'),
)


Radovan
http://www.yau.sk

On 7. Júl, 22:17 h., mf  wrote:
> The project is working fine in the dev server but when I try to use it
> in the production sv(Gunicorn + Nginx), NoReverseMatch error appears.
> I checked the code several times and I can't find the error.
>
> urls.py:
>
> from django.conf.urls.defaults import patterns, include, url
> from django.conf import settings
>
> urlpatterns = patterns('',
>     (r'^obras/', include('obras.urls')),
> )
> obras urls.py:
>
> from django.conf.urls.defaults import *
> from obras import views
>
> urlpatterns = patterns('',
>     url(r'^presobra/$', views.pres_obra, name='pres_obra'),
> )
> Error message:
>
> Request URL:http://127.0.0.1:/admin/
>
> Python Path:
> ['/srv/www/antingprojects.com.ar/gobras', ... ']
>
> Exception Value:
> Caught NoReverseMatch while rendering: Reverse for 'pres_obra' with
> arguments '()' and keyword arguments '{}' not found.
>
> Template error
>
> In template /srv/www/antingprojects.com.ar/gobras/templates/admin/
> index.html, error at line 75 Caught NoReverseMatch while rendering:
> Reverse for 'pres_obra' with arguments '()' and keyword arguments '{}'
> not found.
>
> 75      Presupuestos-Obras
> settings.py:
>
> import os.path
> PROJECT_DIR = os.path.dirname(__file__)
> ROOT_URLCONF = 'gobras.urls'
> Project structure:
>
> -gobras
> --obras
> --media

-- 
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.



Limiting the address space of any other binary..?

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Hi Roberto,

Wonder if you might be able to give me some advice..

Is there is a way to limit the address space of any other binary,
without relying on /etc/security/limits.conf??

For example, is it possible to do something like this:

./magic-here --limit-as=256M -- /usr/sbin/some-legacy-binary-here

^^ that would then wrap the binary, enforcing a maximum address space of 256M.

As you gave the option --limit-as to uwsgi, which can apply to any
python webapp, I was wondering if it's possible for us to do the same,
but without compiling the original binary into uwsgi.

Let me know if the above doesn't make any sense lol.

Cal

-- 
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.



Re: User based objects

2011-07-08 Thread Shawn Milochik
You can certainly pass request.user to the form from your view.

-- 
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.



User based objects

2011-07-08 Thread Praveen Krishna R
*Hi,
*
*
*
*This is one of my Model which has an owner, column - user.*
*
*
*
class MiscList(models.Model):
name = models.CharField(max_length= 30)
user = models.ForeignKey(User);
count = models.IntegerField()
createdate = models.DateTimeField(auto_now_add = True)
**
def __unicode__(self):
**
return self.name

*
*
In one of my forms I would like to have this list filtered by the currently
logged in user.
Anyone of you have solved a scenario like this.
Since this is not a view I am not able to pass request.user object to the
form, in any way, what is the
preferred way of doing this ?
*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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.



Re: Managing objects spred among several tables/databases.

2011-07-08 Thread Hummingbird
Not to put too fine a point on this.
I was hopeful to get some reply on this list (I heard that django
community is superbly active).
But it seems that either this post of mine alongwith "qMax" (OP) was
extremely silly,
OR
Nobody understood the gravity of our post.
In data-centric business apps (not like Yet Another Blog or Movie
Upload), such complexities as we mention in the above post, are a
regular part of life.

Regards,
Vineet

On Jul 5, 9:28 pm, Hummingbird  wrote:
> Can anybody pl. share his/her experience on this issue?
> Thanks.
>
> On Jul 2, 10:39 am, Hummingbird  wrote:
>
>
>
> > Hi !
> > I have a similar situation.
> > (disclaimer:-- I have tried turbogears & web2py before.
> > But could not find the following functionality there.
> > So I have signed-in here to see whether I can get it in django).
>
> > My form is composed of fields from various tables.
> > When a user interacts with form, he/she may add/edit/delete/keep
> > unchanged certain fields,
> > After saving the form, I need to understand---
> > 1) which table(s) should receive SQL add statement,
> > 2) which one(s) need update stmt,
> > 3) which one(s) to receive delete stmt.
>
> > Some examples of (desktop) frameworks having this feature:--
> > i) CursorAdaptor in VFP
> > ii) DABO desktop framework
> > But I am looking for a web framework having this feature.
>
> > Without a proper method (rather class) to handle it, it would be very
> > messy.
> > There will be code repetitions, etc.
>
> > I am eager to know whether there is any facility to do the above thing
> > in django.
> > In that case, I will happily switch to django.
> > Any comments/advise/knowledge-sharing highly appreciated.
>
> > Thanks.
>
> > On Jun 30, 9:23 am, qMax  wrote:
>
> > > Hello here.
>
> > > My application task is to integrate several applications, and it
> > > should manipulate objects, spread among several tables in several
> > > databases. Final object is constructed by 'joining' tables by single
> > > field (or derivatives).
> > > A user should see such objects as solid entities and manipulate them
> > > with basic CRUD operations (with search).
> > > Backend should synchronize all changes in all databases.
> > > And i wish i could use admin site for that.
>
> > > If i guess correctly, all required magic should go into custom
> > > QuerySet implementation to properly translate CRUD operations on
> > > models into various distributed requests on databases, like zigzag-
> > > joins, etc instead of usual sql.Queries.
>
> > > I wonder if QuerySet is the only consolidation of such interface.
> > > What else should i customize to make it work? (i see at least
> > > db.models.Manager should be customized to use another queryset impl)
> > > Also, how to figure out what subset of QuerySet interface is used in
> > > admin site?
>
> > > Maybe, someone already managed similar task and there are some recipes?- 
> > > Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
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.



Re: django/python performance vs play/java

2011-07-08 Thread drakkan


On 8 Lug, 14:44, Thomas Guettler  wrote:
> On 06.07.2011 15:33, drakkan wrote:> On 6 Lug, 14:03, akaariai 
>  wrote:
> >> On Jul 5, 10:54 pm, drakkan  wrote:
>
> ...
>
> > using pgpool I get a 2,5x performance improvement thanks! I'll try on
> > intel atom again to see if there I have more improvements
>
> Hi,
>
> I am interessted in the result. Please post them to the list.

test from my laptop

django+uwsgi+pgpool2:

Requests per second:71.40 [#/sec] (mean)

Percentage of the requests served within a certain time (ms)
  50% 56
  66% 64
  75% 70
  80% 73
  90% 81
  95% 86
  98% 93
  99% 98
 100%134 (longest request)


without pgpool2:

Requests per second:35.87 [#/sec] (mean)

Percentage of the requests served within a certain time (ms)
  50%107
  66%119
  75%128
  80%135
  90%154
  95%171
  98%196
  99%213
 100%306 (longest request)


play 1.2.2 default options and default template engine (no japid)

Requests per second:186.12 [#/sec] (mean)

Percentage of the requests served within a certain time (ms)
  50% 20
  66% 23
  75% 26
  80% 27
  90% 32
  95% 35
  98% 42
  99% 47
 100% 68 (longest request)

the db is postgres 8.4

I have no time to try jinja2 now, I guess it should speed up django a
bit,

drakkan


>
>   Thomas
>
> --
> Thomas Guettler,http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de

-- 
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.



Re: RegistrationForm subclass not showing up

2011-07-08 Thread Andre Terra
If I remember this correctly, there's a variable somewhere in
django-registration that defines the form to be used.

grep (or ack!) the source for RegistrationForm and see if you can find it

Cheers,
Andre

On 7/8/11, katstevens  wrote:
> Thanks for your answer, but unfortunately that hasn't helped - on
> further investigation I think the problem is somewhere else, as the
> original RegistrationForm class instance (in registration.forms)
> doesn't seem to be being called correctly by registration.views (so no
> wonder RegistrationFormTermsOfService isn't working!). I tried making
> some small changes to the labels in the RegistrationForm class and it
> is still displaying the default label values in my template. For
> example, the class declaration now looks like:
>
>  class RegistrationForm(forms.Form):
>  # all the other fields
>  # ...
>  password1 =
> forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict,
> render_value=False),
> label=_(u'different password label'))
>
> In registration.views I've imported the form as follows
>
>  from registration.forms import RegistrationForm
>
> And used the default view declaration:
>
>  def register(request, success_url=None,
>  form_class=RegistrationForm, profile_callback=None,
>  template_name='registration/registration_form.html',
>  extra_context=None):
> if request.method == 'POST':
># do post stuff
> else:
># instantiate blank form
> form = form_class()
>
> Finally, on the registration_form.html template I've tried calling the
> fields explicitly rather than using the form.as_table tag:
>
>   {{ form.password1.label_tag }}
>   {{ form.password1 }}
>
> The page displays these fields fine, yet the label still gives the
> default label value of 'password' instead of 'different password
> label'. I'm not getting any syntax errors, and I've rebooted my server
> for good measure with the same results. Therefore I assume that either
> form = form_class() isn't actually instantiating RegistrationForm
> properly in the view, or there is some sort of overriding default
> being called from a different location (maybe django.contrib.auth?).
>
> Also - I can't see the form_call field that you mention - does this
> refer to the parameter 'form_class=RegistrationForm' I've used above
> in my registration view?
>
> Thanks again!
>
> On Jul 8, 7:08 am, CareerDhaba tech  wrote:
>> Hi Kat,
>>
>> You have to tell the your registration view to use the
>> RegistrationFormTermsofService. First, import that class from forms and
>> change your form_call from None to to RegistrationFormTermsofService.
>>
>> Hope this helps.
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Jul 7, 2011 at 5:34 PM, katstevens  wrote:
>> > Hi - I'm new to Django and am using django-registration to set up new
>> > users.
>>
>> > The basic RegistrationForm shows up fine in my template (which just
>> > uses {{ form.as_table }} to generate fields inside the form HTML), but
>> > I now want to use the RegistrationFormTermsOfService subclass instead.
>>
>> > I set it as a parameter in urls.py as follows:
>> >                       url(r'^register/$',
>> >                           register,
>> >                           {'form_class':
>> > RegistrationFormTermsOfService},
>> >                           name='registration_register'),
>>
>> > ... but the original RegistrationForm is still showing instead. Any
>> > ideas why this would be? Do I have to remove the default 'form_class'
>> > value in the register declaration in views.py (as that still gives
>> > RegistrationForm as the default)? Or do I need to alter my template?
>>
>> > I'm sure I'm missing something really obvious - any help gratefully
>> > received.
>>
>> > Kat
>>
>> > --
>> > 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.
>
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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.



Re: django/python performance vs play/java

2011-07-08 Thread Thomas Guettler


On 06.07.2011 15:33, drakkan wrote:
> On 6 Lug, 14:03, akaariai  wrote:
>> On Jul 5, 10:54 pm, drakkan  wrote:
...

> using pgpool I get a 2,5x performance improvement thanks! I'll try on
> intel atom again to see if there I have more improvements

Hi,

I am interessted in the result. Please post them to the list.

  Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

-- 
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.



Re: MultipleObjectsReturned using MongoDB

2011-07-08 Thread delegbede
Whenever you use a get(), it is expecting to return one item. Use filter() and 
see if the error comes up again and then I can take a deeper look at the error. 
Regards. 
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: Ademar 
Sender: django-users@googlegroups.com
Date: Fri, 8 Jul 2011 04:45:54 
To: Django users
Reply-To: django-users@googlegroups.com
Subject: MultipleObjectsReturned using MongoDB

hi,

im new in django and mongodb and im trying to use the admin with
mongodb.
i installed everything and there's no errors on the server but after i
access the admin page it gives me the error
'MultipleObjectsReturned at /admin/

get() returned more than one Session -- it returned 2! Lookup
parameters were {'session_key': 'c98dd3a7da992eb0e29073e4ec88eb3f',
'expire_date__gt': datetime.datetime(2011, 7, 8, 6, 39, 46, 801191)};

ok, from that i know there are 2 session with the same session_key, i
access the mongodb and i delete one of them and it works. Next time
i'll log in, the same error happens.

can someone help?

-- 
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.

-- 
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.



MultipleObjectsReturned using MongoDB

2011-07-08 Thread Ademar
hi,

im new in django and mongodb and im trying to use the admin with
mongodb.
i installed everything and there's no errors on the server but after i
access the admin page it gives me the error
'MultipleObjectsReturned at /admin/

get() returned more than one Session -- it returned 2! Lookup
parameters were {'session_key': 'c98dd3a7da992eb0e29073e4ec88eb3f',
'expire_date__gt': datetime.datetime(2011, 7, 8, 6, 39, 46, 801191)};

ok, from that i know there are 2 session with the same session_key, i
access the mongodb and i delete one of them and it works. Next time
i'll log in, the same error happens.

can someone help?

-- 
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.



[ANN] cfp for PyCon India closing soon

2011-07-08 Thread Kenneth Gonsalves
hi,

for those of you who would like to visit India:

http://in.pycon.org/2011/
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



Re: RegistrationForm subclass not showing up

2011-07-08 Thread katstevens
Thanks for your answer, but unfortunately that hasn't helped - on
further investigation I think the problem is somewhere else, as the
original RegistrationForm class instance (in registration.forms)
doesn't seem to be being called correctly by registration.views (so no
wonder RegistrationFormTermsOfService isn't working!). I tried making
some small changes to the labels in the RegistrationForm class and it
is still displaying the default label values in my template. For
example, the class declaration now looks like:

 class RegistrationForm(forms.Form):
 # all the other fields
 # ...
 password1 =
forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict,
render_value=False),
label=_(u'different password label'))

In registration.views I've imported the form as follows

 from registration.forms import RegistrationForm

And used the default view declaration:

 def register(request, success_url=None,
 form_class=RegistrationForm, profile_callback=None,
 template_name='registration/registration_form.html',
 extra_context=None):
if request.method == 'POST':
   # do post stuff
else:
   # instantiate blank form
form = form_class()

Finally, on the registration_form.html template I've tried calling the
fields explicitly rather than using the form.as_table tag:

  {{ form.password1.label_tag }}
  {{ form.password1 }}

The page displays these fields fine, yet the label still gives the
default label value of 'password' instead of 'different password
label'. I'm not getting any syntax errors, and I've rebooted my server
for good measure with the same results. Therefore I assume that either
form = form_class() isn't actually instantiating RegistrationForm
properly in the view, or there is some sort of overriding default
being called from a different location (maybe django.contrib.auth?).

Also - I can't see the form_call field that you mention - does this
refer to the parameter 'form_class=RegistrationForm' I've used above
in my registration view?

Thanks again!

On Jul 8, 7:08 am, CareerDhaba tech  wrote:
> Hi Kat,
>
> You have to tell the your registration view to use the
> RegistrationFormTermsofService. First, import that class from forms and
> change your form_call from None to to RegistrationFormTermsofService.
>
> Hope this helps.
>
>
>
>
>
>
>
> On Thu, Jul 7, 2011 at 5:34 PM, katstevens  wrote:
> > Hi - I'm new to Django and am using django-registration to set up new
> > users.
>
> > The basic RegistrationForm shows up fine in my template (which just
> > uses {{ form.as_table }} to generate fields inside the form HTML), but
> > I now want to use the RegistrationFormTermsOfService subclass instead.
>
> > I set it as a parameter in urls.py as follows:
> >                       url(r'^register/$',
> >                           register,
> >                           {'form_class':
> > RegistrationFormTermsOfService},
> >                           name='registration_register'),
>
> > ... but the original RegistrationForm is still showing instead. Any
> > ideas why this would be? Do I have to remove the default 'form_class'
> > value in the register declaration in views.py (as that still gives
> > RegistrationForm as the default)? Or do I need to alter my template?
>
> > I'm sure I'm missing something really obvious - any help gratefully
> > received.
>
> > Kat
>
> > --
> > 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.

-- 
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.



Re: What is an "application instance"

2011-07-08 Thread Tom Evans
On Fri, Jul 8, 2011 at 10:45 AM, Thomas Larsen Wessel  wrote:
> I'm reading the URL Dispatcher documentation, at
> https://docs.djangoproject.com/en/dev/topics/http/urls/.
>
> It mentions "application instance" several times. I do not know / understand
> what an application instance is.
>
> Could somebody please explain this, preferably with an example which
> demonstrates having several instances of an application.
>
> Thanks
>

Eg, having two instances of the admin app:

https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#multiple-admin-sites-in-the-same-urlconf

Cheers

Tom

-- 
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.



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
On 8 Jul 2011 01:51, "Kenneth Gonsalves"  wrote:
>
> On Thu, 2011-07-07 at 10:46 -0400, Shawn Milochik wrote:
> > > mentioned.  With a threaded mail client, I use Mutt, they're much
> > > easier to keep up with than anything web based.
> > >
> >
> > +1
> >
> > I prefer this mailing list to anything else. It's far superior to IRC
> > and a forum site (such as Stack Overflow) in my opinion, because I
> > don't have to "go looking for it."
> >
> > If I even filter a mailing list so it doesn't go into my inbox I end
> > up falling behind and deleting all the messages unread. The only way I
> > actively participate in this list is because it hits my inbox.
>
> +1

+1 also, this is exactly what i end up doing too.

> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> 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.
>

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Also, one of the things you mentioned (about security updates of the chroot)
is something i have been pondering today. Although a single compile will
mean recompile everytime a security announce is released, this is
unavoidable.

This is my idea for handling security announcements:

The single binary will have support for monitoring various sources for
indications as to whether or not there is a security announcement for one or
more of its internal componants. Within the configuration, the user can set
an email address which these alerts are sent to. To avoid any single person
being the weak link, we'll make it monitor not only the official project
announce, but also remote security repos, to give it hints as to whether or
not there is a security release for any specific component.

The above idea will need some tweaking ofc, or maybe someone else could
think of a better way to do this..?

This also makes me think about build control. I guess each project would end
up having a build file for future rebuilds, would it be wise to integrate
this into the binary, as a backup incase the original is lost??

So many thoughts..

Cal
On 8 Jul 2011 10:47, "Cal Leeming [Simplicity Media Ltd]" <
cal.leem...@simplicitymedialtd.co.uk> wrote:
> Hi Bjarni,
>
> Thanks for your input. As pointed out earlier in the thread, the end goal
is
> to provide a single binary that is entirely host independant, contains the
> chroot/stack needed by the webapp etc.
>
> You really need to watch the facebook video link i included earlier in the
> thread to understand what we're trying to achieve.
>
> Im drawing up the design principles today, which should give you a better
> idea.. but in a nutshell, imagine a single binary which would run entirely
> from memory, be completely host independant, contain everything the webapp
> needed (stack/chroot/deps etc), and have a nice ncurses interface to
> configure this all from (with features like automatic memory usage
> calculation / configuration - something which is overlooked oh so many
> times)
> On 8 Jul 2011 08:53, "Bjarni Rúnar Einarsson"  wrote:

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Cal Leeming [Simplicity Media Ltd]
Hi Bjarni,

Thanks for your input. As pointed out earlier in the thread, the end goal is
to provide a single binary that is entirely host independant, contains the
chroot/stack needed by the webapp etc.

You really need to watch the facebook video link i included earlier in the
thread to understand what we're trying to achieve.

Im drawing up the design principles today, which should give you a better
idea.. but in a nutshell, imagine a single binary which would run entirely
from memory, be completely host independant, contain everything the webapp
needed (stack/chroot/deps etc), and have a nice ncurses interface to
configure this all from (with features like automatic memory usage
calculation / configuration - something which is overlooked oh so many
times)
On 8 Jul 2011 08:53, "Bjarni Rúnar Einarsson"  wrote:

-- 
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.



What is an "application instance"

2011-07-08 Thread Thomas Larsen Wessel
I'm reading the URL Dispatcher documentation, at
https://docs.djangoproject.com/en/dev/topics/http/urls/.

It mentions "application instance" several times. I do not know / understand
what an application instance is.

Could somebody please explain this, preferably with an example which
demonstrates having several instances of an application.

Thanks

-- 
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.



Re: OperationalError: no connection to the server using Django and gunicorn

2011-07-08 Thread Adrian Ribao
I still have the same problem using gevent with gunicorn, but it works with
synchronous workers.

Did you find a solution?

2011/7/1 Андрей Махнач 

> I'm getting this error randomly
> and it throws 500error to nginx (I'm using nginx+gunicorn)
>
> and it appears really randomly ;)
>
> On Jul 1, 10:16 am, Adrián Ribao Martínez  wrote:
> > I think that the error comes only when starting the server.
> >
> > Reload the page about 10 times and check if you still get the error.
> >
> > Regards,
> >
> > Adrián
> >
> >
> >
> >
> >
> >
> >
> > > Hi Adrian,
> >
> > > Have you solved this weird issue?
> >
> > > if yes, please tell me how.
> >
> > > Best regards,
> > > Andrey Makhnach
> >
> > > On May 27, 12:53 pm, Adrián Ribao  wrote:
> > > > I'm doing it manually because I'm just testing:
> >
> > > > ./manage.py run_gunicorn -c gunicorn.conf.py
> >
> > > > where gunicorn.conf.py
> >
> > > > # -*- coding: utf-8 -*-
> > > > import multiprocessing
> >
> > > > bind = "127.0.0.1:8000"
> > > > workers = multiprocessing.cpu_count() * 2 + 1
> > > > worker_class = 'gevent'
> >
> > > > On 27 mayo, 02:23, Shawn Milochik  wrote:
> >
> > > > > What's the command you're using to run it?
> >
> > > > > Are you in screen? Are you using supervisor or anything like that?
>
> --
> 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.
>
>

-- 
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.



Re: cropping of an image

2011-07-08 Thread Thomas Augestad Weholt
There are several options. Take a look at django-photofile. It rotates photos 
based on exif-info as well. If you don't want to use the entire app you should 
be able to rip out just the cropping part. 


Sendt fra min iPad

Den 7. juli 2011 kl. 22:16 skrev jaspreet kaur :

> Hello everyone
> I want the code for including an image with crop feature.
> Please help me 
> Thanks in advance
> Jaspreet
> -- 
> 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.

-- 
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.



Re: Serving static files weirdness

2011-07-08 Thread bruno desthuilliers
On Jul 8, 4:40 am, neridaj  wrote:
> I had my static files being served form media i.e., the tree looked
> like this:
>
> media/
> /css
> /js
> /images
>
> with this in my url conf:
> if settings.SERVE_MEDIA_FROM_DJANGO:
>     urlpatterns += patterns('',
>     (r'^media/(?P.*)$', 'django.views.static.serve',
> {'document_root': r'media'}),
>     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'media/js/tiny_mc' }),
> )
>
> I then switched it to this:
>
> static/
> /css
> /js
> /images
>
> with this in my url conf:
> if settings.SERVE_MEDIA_FROM_DJANGO:
>     urlpatterns += patterns('',
>     (r'^static/(?P.*)$', 'django.views.static.serve',
> {'document_root': r'static'}),
>     (r'^tiny_mce/(?P.*)$', 'django.views.static.serve',
> { 'document_root': r'static/js/tiny_mc' }),
> )
>
> I don't understand why changing media to static has stopped django
> from serving static files, any ideas?

settings.MEDIA_URL and MEDIA_ROOT ?




-- 
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.



Re: Speed of search question

2011-07-08 Thread Benedict Verheyen
On 7/07/2011 11:31, Marc Aymerich wrote:

> Hi Benedict,
> If you're concerned about the performance of your django apps, I
> recomend you this app:
> https://github.com/robhudson/django-debug-toolbar/commits/master/
> 
> Besides many other interesting things, It shows you the DB queries
> that your views perform and how many time takes.
> 
> 

Hi,

thanks this seems like a very usefull application !

Regards,
Benedict

-- 
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.



Re: Some thoughts on a package/stack compile system for easy distribution of webapps..

2011-07-08 Thread Bjarni Rúnar Einarsson
On Fri, Jul 8, 2011 at 5:22 AM, Roberto De Ioris  wrote:

> > 2011/7/8 Bjarni Rúnar Einarsson 
> >
> > Nice script; but i (and also i guess Cal) were thinking more in the terms
> > of having a single binary.
> >
>
> [DISCLAIMER] i still have not tried pybreeder
>
> Having a single blob file (the .py file generated by pybreeder) will allow
> us to "link" it to the uwsgi binary generating another binary with python
> code embedded. This is pretty easy to accomplish. I will try it in the
> next few days.
>

Cool!  Let me know if you have any problems, I'm very open to input and
suggestions at this stage.

I do wonder whether in practice it is really necessary to bundle everything
into one file. If the goal is to simplify deployment, than Breeder lets you
simplifiy installation to:

   * apt-get install 
   * cp big-snake.py /usr/local/bin/app.py

Where big-snake.py is all your custom code, combined by Breeder.  This of
course assumes that all the custom code is pure Python and all the
dependencies are available from apt (or some other standard repo) - but I
think that may actually be the common case.

Maybe this is "good enough"?  It also has the advantage (or disadvantage,
depending on your needs) that anything maintained by the operating system
packager will still receive security updates, you won't have to rebuild your
binary and redeploy everytime someone fixes a bug.

Just a thought.

-- 
Bjarni R. Einarsson
Founder, lead developer of PageKite.

Make localhost servers visible to the world: http://pagekite.net/

-- 
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.