Re: Correct way to specifiy database-level column defaults

2013-01-10 Thread donarb
auto_now and auto_now_add don't work at the database level for raw SQL inserts 
or updates.

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



Form validation

2013-01-10 Thread Kristofer
Hello, 

I am using FormWizard with a 12-step form. 

On step 6, I want to perform verification on a field but it depends on fields 
that were entered in steps 2-5. 

I cannot figure out how to get data from the previous steps in the form 
validation for step 6. 

Where is a point in the FormWizard where I can access previous form data and 
can also raise ValidationError on a field? 

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.



storing large amounts of text in the DB

2013-01-10 Thread Mike
My users will upload text documents ranging from hundreds to thousands of 
words.  At the moment I store the text in a TextField.  Is this going to 
cause a performance problem in the future or would it be better to store 
the text on the file system and put a file path in the data model?  The 
text does not need to be indexed and I'm using MySQL.  I suppose the best 
way is to profile the app and see if the text retrieval is a bottleneck but 
I thought someone on this list would already have experience in this.

-- 
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/-/5CA4p7wHPmoJ.
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: Correct way to specifiy database-level column defaults

2013-01-10 Thread Mike S

>
> For `DateField`s and `DateTimeField`s specifically, also take a look at 
> the `auto_now` and `auto_now_add` keyword arguments, documented 
> here: 
> https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.DateField

-- 
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/-/ZpIEjNhAF6QJ.
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 realtime output to browser

2013-01-10 Thread Nikolas Stevenson-Molnar
It would help to know a little more about what you're trying to
accomplish. What sort of content are you wanting to deliver back to the
browser?

If you're trying to stream content (video, audio, etc.) then Django
isn't the best solution for that... you'll want to look for a server
designed to stream static content.

_ Nik

On 1/10/2013 7:23 PM, ximin chen wrote:
> I 'm trying to output something to browser in real-time. I started a
> subprocess.Popen() by django in server side, and I want to redirect
> these output from Popen to browser in real-time way. How to do that?
> Thanks! --
> 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/-/F3Kfe5gO4j0J.
> 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.



Django realtime output to browser

2013-01-10 Thread ximin chen
I 'm trying to output something to browser in real-time. I started a 
subprocess.Popen() by django in server side, and I want to redirect these 
output from Popen to browser in real-time way. How to do that? Thanks!

-- 
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/-/F3Kfe5gO4j0J.
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: Pluggable Q Django App

2013-01-10 Thread ian
Hi Natasha,

I'm looking for the same thing you are, that's how I found your post! Did 
you find anything that can be plugged or wrote your own?

On Tuesday, August 7, 2012 1:53:03 PM UTC-4, natash...@utoronto.ca wrote:
>
> Hi All,
>
> I'm looking to implement a Stack Overflow style Q feed on my site.
>
> I have looked into the following solutions:
> 1) OSQA
> 2) Askbot
> 3) Soclone
>
> The problem with these is that they don't really seem to be standalone 
> apps, and more like fully featured sites.
>
> Any thoughts on a standalone pluggable app with the ability to ask/answer 
> questions, upvoting and downvoting, tagging, etc.? Would rather not 
> re-invent the wheel if it has been done before.
>
> Cheers,
> Natasha
>

-- 
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/-/AN_2jddat9YJ.
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: show an image in django

2013-01-10 Thread @jeffblack360
I think your configuration should allow you to hit your image from your 
browser via the following link:

http://localhost:8000/static/images/gauge_example.jpg

If that works change your replace {{STATIC_URL}} with '/static/'...



On Tuesday, January 8, 2013 8:41:55 AM UTC-6, jianhui chen wrote:
>
> Hi all,
> I want to show an image in project in which the folder DIR looks like this:
> images/a.jpg
> templates/introduction.html
>
> In introduction.html I use
> 
>
> It can show image correctly when I open the "introduction.html" directly 
> using firefox, but it shows ""GET /images/gauge_example.jpg HTTP/1.1" 404 " 
> when I open it in http://127.0.0.1:8000/introduction/, and there is no 
> image in the webpage.
>
> I used the last method in 
> http://stackoverflow.com/questions/2148738/cannot-get-images-to-display-in-simple-django-site.
>  But it doesn't work.
>
> Could anyone give me some suggestions?
>
> jianhui
>
>
>
>
>
>

-- 
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/-/AO-VKasUjWcJ.
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 and Heroku Static Image Files Disappearing

2013-01-10 Thread Filip Wasilewski
Hi,

On Thursday, January 10, 2013 10:14:19 PM UTC+1, That guy wrote:
>
> Hi there :)
>
> On heroku, do static images expire after some point and automatically get 
> deleted?
>
Heroku dyno file system is not persistent between restarts and you have to 
store your media files outside of Heroku - 
https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem. Just use 
django-storages  with a cloud 
storage.

Filip
en.ig.ma

-- 
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/-/TU0fRnQ52scJ.
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: Announcment - django-databrowse

2013-01-10 Thread Russell Keith-Magee
On Fri, Jan 11, 2013 at 3:00 AM, Alireza Savand wrote:

> Yes, Correct.
> I agree with `django.contrib.auth` specially since 1.5 when it went
> pluggable.
> It's a mistake to say django should be clean as possible.
> Just imagine ORM, forms or some other core features get split, Django will
> no longer be Django.
> But look at some of the apps in `django.contrib.*`, Such as:
>
> * sitemaps
> * coments
> * syndication
> * webdesign
> * ...
>
> I'm not saying they are useless, No. They are just fine. But they can be
> handled outside
>  of Django mainstream.
>
>
… and that's exactly the intention behind use splitting out databrowse et
al from contrib. databrowse hasn't received attention for a long time (and
was probably added to core in haste in the first place). webdesign is an
app that contains 1 template tag. markup is a library that provides support
for 3 markup languages, ignoring lots of others, and adding a dependency on
downstream libraries (some of which haven't got a great track record on
fixing security problems).

So - given that we now live in a world where packaging "Just Works™",
splitting up parts of Django's core into side projects is now a viable
option.

Also - keep in mind that there is a middle ground -- we can split these
projects out of the "django" repository, but still continue to maintain
them as official Django projects. This is what we've done with localflavor.
This allows us to put localflavor code into the hands of developers with
domain expertise, while maintaining the official nature of localflavor
additions.

Don't fear -- we're not going to chop out and abandon big ticket features
of Django like auth or admin. The most we would do is move them into a
separate repository for management purposes.

Yours,
Russ Magee %-)

-- 
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: Near term disadvantages of Django+Python 3 stack?

2013-01-10 Thread Russell Keith-Magee
On Thu, Jan 10, 2013 at 9:47 PM, John  wrote:

> I understand that Django 1.5 RC supports Python 3, but for the sake of
> this question let's assume the 1.5 GA was already out.  As a developer, I
> want to use latest possible stable versions.  However, are there other
> implications for using a Py3 stack here?  For example, might I in the near
> future discover that 75% of the plugins which I might find useful will not
> yet be ported over for some time?  Are there any other gotchas that might
> make me want to stay with Python2.7 stack for a site I'll be building in a
> 6 month window?
>
> You've pretty much identified the two biggest problems.

1) We've done plenty of testing under Python 3, but there's no testing like
people actually using code in anger, so it's possible we will find small
problems with our Python 3 implementation after 1.5 is finalised. If we
find a particularly bad problem, we might be forced to break backwards
compatibility for Python 3 projects.

2) The wider community of Django apps/plugins/libraries hasn't been updated
for Python 3. You've said 75% - the number is probably closer to 95%. Of
course, this is a great opportunity for you to become a huge community
contributor by submitting pull requests for Python 3 updates.

Ultimately, the decision is yours.

If you're completely new to Django, you have really tight deadlines, or you
don't have a lot of confidence in the idea of diving into the internals of
Django and 3rd party apps, it's probably better to stick with Python 2.7
for the moment. Without knowing you or your circumstance or experience
level, I'd err on the side of caution and say this is the safer option.

However, if you're adventurous, you're not afraid of a few road bumps, and
you're willing to do a bit of extra work to help port 3rd party projects,
it would be a huge help to the Django community to see a live project
working on Python 3; and long term, your code will be ready for the future.

Yours,
Russ Magee %-)

-- 
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: show an image in django

2013-01-10 Thread Mario Gudelj
Have you tried removing {{ STATIC_URL }} and replacing it with a slash (/)?
Or try appending the slash to the end of
"E:/code/python/djangoBook/django-testapp-develop/static"
in STATICFILES_DIRS.

You can also add DJANGO_ROOT = dirname(dirname(abspath(__file__))) to the
top of your settings.py and then add this below it:


STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
normpath(join(DJANGO_ROOT, 'static')),
)


That works for me in every project, although I don't use Windows, so it may
be different in your case.

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



Django and Heroku Static Image Files Disappearing

2013-01-10 Thread That guy


Hi there :)

On heroku, do static images expire after some point and automatically get 
deleted?

My situation is that I retrieve images from my PostgreSQL database through 
a model's ImageField by setting its upload_to equal to static/images. Then, 
I access the images through mysitesurl.com/static/images/model.url This 
works perfectly initially. However, after several hours, what I notice is 
that the images are no longer accessible. When I try to access them through 
the same url, they no longer exist. I do not do any manual image deletions 
so the operations I perform should not interfere with this. 

Is this something that Heroku does that I do not understand?

Also, one odd occurrence that I notice is that the image is still 
accessible through the url, but it doesn't actually get saved to 
static/images. When I run the bash shell provided by heroku, its not in the 
static folder.

Note: I am aware of S3, but I am trying to get this to work purely on 
Heroku.

Thanks for any help :D

-- 
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/-/_khBIqL4L9wJ.
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: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread Bill Freeman
The apache configuration files must have, at a minimum, a WSGIScriptAlias
directive.

There is also a list of the apache modules which get loaded, and mod_wsgi
must be included.

mod_wsgi must be linked against the particular apache, but the
distribution, if you're using the OS's package manager, should have made
sure of that.

As previously mentioned by another, mod_wsgi is linked against a particular
python interpreter.  Again, hopefully the OS package manager pulls in stuff
built to work together, but this does mean that you can't, say, use
python2.7 if the distribution's python is a 2.6.

It is much to be preferred, though not absolutely required, that the python
in question was build after passing "--enable-shared" to the configure
script.  Unless you build everything yourself (which I usually do, but not
yet on Raspberry PI), you have no control of this.

That WSGIScriptAlias directive should probably specify a python-path
argument specifying the directory with manage.py in it, though I've seen it
work with the adding of this path deferred to the wsgi script  python
module.

You can use a virtualenv, but it must have been made with the python
interpreter against which mod_wsgi is linked (not the same file, but
ve/bin/python is generally a copy, and this works well enough), but you
will either need to use the WSGIPythonHome directive, or, if your mod_wsgi
is new enough, the python-home argument of the WSGIScriptAlias directive.
(The advantage of the latter is the ability to use separate virtualenvs in
separate VirtualHosts, whereas WSGIPytonHome is global across all mod_wsgi
daemon processes under a single apache..)

You will want to configure Alias directives to allow serving your STATIC
and MEDIA files at the expected URLs.

You will need a number of Directory directives (though fewer than some
people think).

The mod_wsgi documentation is excellent.  If you think otherwise it is
because you don't yet appreciate the complexity of the issues.

Bill

On Thu, Jan 10, 2013 at 3:27 PM, <7equivale...@gmail.com> wrote:

> When you say "From there it should just be configuration." Do you mean
> either (1) Configuring mod-wsgi to work with apache, or (2) Configuring
> mod_wsgi to work with Django.
>
> The errors where involved with my first attempt at installing mod-wsgi
> according to the Django instructions, However now I'm using *sudo apt-get
> install libapache2-mod-wsgi *which is not mentioned in the Django docs.
> And step (3) seems to do whatever it does just fine with no errors.
>
> I'm not sure if I should be focusing on configuring mod-wsgi to work with
> apach or configuring mod-wsgi to work with Django. I'm sure there are steps
> for both that need to be taken
>
>
> On Thursday, January 10, 2013 2:53:35 PM UTC-5, Nikolas Stevenson-Molnar
> wrote:
>
>> From there, it should just be configuration. What errors are you seeing?
>>
>> _Nik
>>
>> On 1/10/2013 10:59 AM, 7equiv...@gmail.com wrote:
>> > Hello, I need help configuring the Apache production server to work
>> > with Django on a Rapberry pi. I am still new to Linux. Here is what
>> > I've done so far.
>> >
>> > (1) I have successfully installed Apache on my Raspberry pi. I have
>> > used it to serve up php webpages.
>> > (2) I have successfully installed Django on the RaspPi and created a
>> > project that works with the Django development server.
>> > (3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi
>> >
>> > I am unsure where to proceed after step 3. Did step 3 install and
>> > configure mod-wsgi to work with Apache, or do I still have some
>> > initialization steps? Or, does the next step involve Django. I have
>> > read and followed the steps from the Django website, but they produced
>> > errors and where confusing to me.
>> >
>> > Any help would be greatly appreciated!
>> > --
>> > 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/-/**6SE8SJkDxf0J.
>>
>> > To post to this group, send email to django...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users...@**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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/F8Bo4d3IP5oJ.
>
> 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 

Re: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread Nikolas Stevenson-Molnar
I mean configuring Apache, as described here:
https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/

If you're not too attached to Apache, I personally find it easier to use
Gunicorn with Nginx: http://gunicorn.org/#deployment

_Nik

On 1/10/2013 12:27 PM, 7equivale...@gmail.com wrote:
> When you say "From there it should just be configuration." Do you mean
> either (1) Configuring mod-wsgi to work with apache, or (2)
> Configuring mod_wsgi to work with Django.
>
> The errors where involved with my first attempt at installing mod-wsgi
> according to the Django instructions, However now I'm using *sudo
> apt-get install libapache2-mod-wsgi *which is not mentioned in the
> Django docs. And step (3) seems to do whatever it does just fine with
> no errors.
>
> I'm not sure if I should be focusing on configuring mod-wsgi to work
> with apach or configuring mod-wsgi to work with Django. I'm sure there
> are steps for both that need to be taken
>
> On Thursday, January 10, 2013 2:53:35 PM UTC-5, Nikolas
> Stevenson-Molnar wrote:
>
> From there, it should just be configuration. What errors are you
> seeing?
>
> _Nik
>
> On 1/10/2013 10:59 AM, 7equiv...@gmail.com  wrote:
> > Hello, I need help configuring the Apache production server to work
> > with Django on a Rapberry pi. I am still new to Linux. Here is what
> > I've done so far.
> >
> > (1) I have successfully installed Apache on my Raspberry pi. I have
> > used it to serve up php webpages.
> > (2) I have successfully installed Django on the RaspPi and
> created a
> > project that works with the Django development server.
> > (3) I have run the command ~$ sudo apt-get install
> libapache2-mod-wsgi
> >
> > I am unsure where to proceed after step 3. Did step 3 install and
> > configure mod-wsgi to work with Apache, or do I still have some
> > initialization steps? Or, does the next step involve Django. I have
> > read and followed the steps from the Django website, but they
> produced
> > errors and where confusing to me.
> >
> > Any help would be greatly appreciated!
> > --
> > 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/-/6SE8SJkDxf0J
> .
> > To post to this group, send email to django...@googlegroups.com
> .
> > To unsubscribe from this group, send email to
> > django-users...@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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/F8Bo4d3IP5oJ.
> 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: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread 7equivalents
When you say "From there it should just be configuration." Do you mean 
either (1) Configuring mod-wsgi to work with apache, or (2) Configuring 
mod_wsgi to work with Django. 

The errors where involved with my first attempt at installing mod-wsgi 
according to the Django instructions, However now I'm using *sudo apt-get 
install libapache2-mod-wsgi *which is not mentioned in the Django docs. And 
step (3) seems to do whatever it does just fine with no errors.

I'm not sure if I should be focusing on configuring mod-wsgi to work with 
apach or configuring mod-wsgi to work with Django. I'm sure there are steps 
for both that need to be taken

On Thursday, January 10, 2013 2:53:35 PM UTC-5, Nikolas Stevenson-Molnar 
wrote:
>
> From there, it should just be configuration. What errors are you seeing? 
>
> _Nik 
>
> On 1/10/2013 10:59 AM, 7equiv...@gmail.com  wrote: 
> > Hello, I need help configuring the Apache production server to work 
> > with Django on a Rapberry pi. I am still new to Linux. Here is what 
> > I've done so far. 
> > 
> > (1) I have successfully installed Apache on my Raspberry pi. I have 
> > used it to serve up php webpages. 
> > (2) I have successfully installed Django on the RaspPi and created a 
> > project that works with the Django development server. 
> > (3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi 
> > 
> > I am unsure where to proceed after step 3. Did step 3 install and 
> > configure mod-wsgi to work with Apache, or do I still have some 
> > initialization steps? Or, does the next step involve Django. I have 
> > read and followed the steps from the Django website, but they produced 
> > errors and where confusing to me. 
> > 
> > Any help would be greatly appreciated! 
> > -- 
> > 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/-/6SE8SJkDxf0J. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/F8Bo4d3IP5oJ.
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: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread Nikolas Stevenson-Molnar
Also, IIRC mod-wsgi has to be compiled against a specific version of
Python, so you may have a version mismatch. I ran Apache + Django +
Python 2.7 once and I ended up building modwsgi myself against Python
2.7 (I think the pre-built was 2.6).

_Nik

On 1/10/2013 10:59 AM, 7equivale...@gmail.com wrote:
> Hello, I need help configuring the Apache production server to work
> with Django on a Rapberry pi. I am still new to Linux. Here is what
> I've done so far.
>
> (1) I have successfully installed Apache on my Raspberry pi. I have
> used it to serve up php webpages.
> (2) I have successfully installed Django on the RaspPi and created a
> project that works with the Django development server.
> (3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi
>
> I am unsure where to proceed after step 3. Did step 3 install and
> configure mod-wsgi to work with Apache, or do I still have some
> initialization steps? Or, does the next step involve Django. I have
> read and followed the steps from the Django website, but they produced
> errors and where confusing to me.
>
> Any help would be greatly appreciated!
> -- 
> 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/-/6SE8SJkDxf0J.
> 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: Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread Nikolas Stevenson-Molnar
>From there, it should just be configuration. What errors are you seeing?

_Nik

On 1/10/2013 10:59 AM, 7equivale...@gmail.com wrote:
> Hello, I need help configuring the Apache production server to work
> with Django on a Rapberry pi. I am still new to Linux. Here is what
> I've done so far.
>
> (1) I have successfully installed Apache on my Raspberry pi. I have
> used it to serve up php webpages.
> (2) I have successfully installed Django on the RaspPi and created a
> project that works with the Django development server.
> (3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi
>
> I am unsure where to proceed after step 3. Did step 3 install and
> configure mod-wsgi to work with Apache, or do I still have some
> initialization steps? Or, does the next step involve Django. I have
> read and followed the steps from the Django website, but they produced
> errors and where confusing to me.
>
> Any help would be greatly appreciated!
> -- 
> 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/-/6SE8SJkDxf0J.
> 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: Announcment - django-databrowse

2013-01-10 Thread Alireza Savand
Yes, Correct.
I agree with `django.contrib.auth` specially since 1.5 when it went
pluggable.
It's a mistake to say django should be clean as possible.
Just imagine ORM, forms or some other core features get split, Django will
no longer be Django.
But look at some of the apps in `django.contrib.*`, Such as:

* sitemaps
* coments
* syndication
* webdesign
* ...

I'm not saying they are useless, No. They are just fine. But they can be
handled outside
 of Django mainstream.



On Thu, Jan 10, 2013 at 6:20 PM, Derek  wrote:

> I for one hope that django.contrib.auth is never "wiped off" and handed
> off to some random third party.  I think that the framework would be much
> poorer for its loss and I'm happy to trade off for a "slower and dirtier"
> Django to be able to keep its presence.
>
>
>
> On Wednesday, 9 January 2013 01:17:17 UTC+2, Alir3z4 wrote:
>>
>> Hi,
>>
>> Since Django 1.4 released, `django.contrib.databrowse` get deprecated.
>> And it's removed from 1.5.
>> Actually I hope django.contrib.* completely **get wiped off django, I
>> guess django development
>> will be faster and cleaner without those app.
>>
>> I've extracted and adopted it.
>> Now it's available as stand-alone package pypi.
>>
>> pypi:
>> http://pypi.python.org/pypi/**django-databrowse
>>
>> source/git repo:
>> https://github.com/Alir3z4/**django-databrowse
>>
>>
>> Regards,
>> Alireza Savand
>>
>  --
> 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/-/FaIWDRTgCtgJ.
>
> 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.



Need help configuring Apache production server on Raspberry PI to work with Django.

2013-01-10 Thread 7equivalents
Hello, I need help configuring the Apache production server to work with 
Django on a Rapberry pi. I am still new to Linux. Here is what I've done so 
far.

(1) I have successfully installed Apache on my Raspberry pi. I have used it 
to serve up php webpages.
(2) I have successfully installed Django on the RaspPi and created a 
project that works with the Django development server.
(3) I have run the command ~$ sudo apt-get install libapache2-mod-wsgi

I am unsure where to proceed after step 3. Did step 3 install and configure 
mod-wsgi to work with Apache, or do I still have some initialization steps? 
Or, does the next step involve Django. I have read and followed the steps 
from the Django website, but they produced errors and where confusing to me.

Any help would be greatly appreciated!

-- 
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/-/6SE8SJkDxf0J.
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: Near term disadvantages of Django+Python 3 stack?

2013-01-10 Thread Nikolas Stevenson-Molnar
Python 3 support isn't considered ready for production use as of Django
1.5, as it hasn't received much real-world testing. For more info, see
this blog post by the dev team:
https://www.djangoproject.com/weblog/2012/aug/19/experimental-python-3-support/

_Nik

On 1/10/2013 5:47 AM, John wrote:
> I understand that Django 1.5 RC supports Python 3, but for the sake of
> this question let's assume the 1.5 GA was already out.  As a
> developer, I want to use latest possible stable versions.  However,
> are there other implications for using a Py3 stack here?  For example,
> might I in the near future discover that 75% of the plugins which I
> might find useful will not yet be ported over for some time?  Are
> there any other gotchas that might make me want to stay with Python2.7
> stack for a site I'll be building in a 6 month window?
>
> thanks!
> John
> -- 
> 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/-/KCDiLybbFF0J.
> 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: Correct way to specifiy database-level column defaults

2013-01-10 Thread donarb
On Thursday, January 10, 2013 6:04:47 AM UTC-8, 
john.w...@tpiengineering.com wrote:
>
> What is the best way to specify a database level default value with 
> Django?  If I want a timestamp column to default to the SQL function now(), 
> is there an accepted way to make it happen?  Or to default a boolean column 
> to True?  I notice that when I call *manage.py sqlall* I don't see any *
> DEFAULT* values specified in the generated queries for Postgres.
>


If you need default values defined at the database level, you'll have to 
define them yourself. You'll still have to define the default values in the 
model so that the ORM will enforce the default. You may be able to use the 
inspectdb command to generate the model.py file for you to tweak, not sure 
if it generates the default parameter for model fields based on the 
database columns.

-- 
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/-/-wDtqdnKd4oJ.
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: Correct way to specifiy database-level column defaults

2013-01-10 Thread Stefano Probst
An example:

> from django.db import models
> from django.utils.datetime_safe import datetime
> class URL(models.Model):
> full_URL = models.URLField(max_length=400)
> short = models.CharField(max_length=8)
> date = models.DateTimeField(default=datetime.now)


Django fill in the default value when it saves the entry.

Am Donnerstag, 10. Januar 2013 15:04:47 UTC+1 schrieb 
john.w...@tpiengineering.com:
>
> What is the best way to specify a database level default value with 
> Django?  If I want a timestamp column to default to the SQL function now(), 
> is there an accepted way to make it happen?  Or to default a boolean column 
> to True?  I notice that when I call *manage.py sqlall* I don't see any *
> DEFAULT* values specified in the generated queries for Postgres.
>

-- 
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/-/On1qqaVsegoJ.
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 use database router, only when using admin and user auth ?

2013-01-10 Thread Fellipe Henrique
Hello,

I have a "dbname" field in my user Profile... and I have one database to 
store all default django data, like users, sessions etc.. when I try to get 
some ovject in a view, I will get to other database setted in "dbname" 
profile... I make this code:

from django.contrib.auth.models import User
from models import UserProfile

import threading

# Object to hold request data
request_cfg = threading.local()

class RouterMiddleware(object):
"""
Set a flag if we are accessing Django admin to
prevent database rerouting for the auth model.
Remove the flag once the request has been processed.

"""

def process_view(self, request, view_func, args, kwargs):
if request.path.startswith('/admin'):
request_cfg.admin = True

def process_response(self, request, response):
if hasattr(request_cfg, 'admin'):
del(request_cfg.admin)
return response

class UserSessionRouter(object):
"""
Redirect database IO for the auth and sessions
models to OldWebsite.com.

"""

def db_for_read(self, model, **hints):
if not hasattr(request_cfg, 'admin'):
if model._meta.app_label == 'auth':
return 'default'
elif model._meta.app_label == 'accounts':
return 'default'
elif model._meta.app_label == 'sessions':
return 'default'
else:
return UserProfile.dbname
return None

def db_for_write(self, model, **hints):
if not hasattr(request_cfg, 'admin'):
if model._meta.app_label == 'auth':
return 'default'
elif model._meta.app_label == 'accounts':
return 'default'
elif model._meta.app_label == 'sessions':
return 'default'
else:
return UserProfile.dbname
return None

But when I try to execute, show me these error: 

ImproperlyConfigured at /
settings.DATABASES is improperly configured. Please supply the ENGINE 
value. Check settings documentation for more details.

I think the django doesn`t get the correct database to use... and I have 
set all database in DATABASE in settings.py

In other words... all django default data use a "default" database, for all 
other data using a database setted in "dbname" in UserProfile.

How can I use this?

Best Regards,
F.H.

-- 
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/-/S09tPoSdWAQJ.
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: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Brian Schott
+1
http://pypi.python.org/pypi/django-celery
is a good solution for this kind of background task.  It opens up a lot 
possibilities like django-celery-email for background email sending, etc.  Keep 
your web contexts as short as possible.

For the AJAX server-side integration, check out:
http://www.dajaxproject.com


Brian Schott
bfsch...@gmail.com



On Jan 10, 2013, at 9:12 AM, Tom Evans  wrote:

> On Thu, Jan 10, 2013 at 1:21 PM, Mauro Sánchez  wrote:
>> Hello, I have a process that takes about 2 or 3 minutes to execute. The
>> problem is that sometimes (not always) it results in an Internal Server
>> Error 500 because of the time it takes.
>> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
>> that even if the process takes 10 or 15 minutes it just keeps running until
>> it finish?
>> Thanks a lot for the help.
>> Cheers,
>> Mauro.
>> 
> 
> Providing a URL that consumes an entire web worker for >1 minute is a
> good way to open yourself up for a DOS attack - even 10 seconds is too
> long really. Put lengthy operations in to a queue - like django-celery
> -  so that you can manage how much of your resources that task
> consumes, and poll for completion with AJAX.
> 
> 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: pip search raises "time out"

2013-01-10 Thread j_syk
I just tried it and it returned about 3500 results. Did you really want 
that many results? 

running "pip search --help" shows that you can set a --timeout flag, and 
the default is 15 seconds

try:
pip search --timeout=30 Django



On Wednesday, January 9, 2013 8:34:41 AM UTC-6, Matias Montenegro wrote:
>
> I need a hand with this problem. I get a "time out" exception when i run 
> "pip search", but "pip install" works fine. I'm using a proxy and I can't 
> deactivate it. Does anybody know why it might be happening?
>  
> http://pastebin.com/2z7SPqf2
>

-- 
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/-/WqZPwBreU4UJ.
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: Announcment - django-databrowse

2013-01-10 Thread Derek
I for one hope that django.contrib.auth is never "wiped off" and handed off 
to some random third party.  I think that the framework would be much 
poorer for its loss and I'm happy to trade off for a "slower and dirtier" 
Django to be able to keep its presence.


On Wednesday, 9 January 2013 01:17:17 UTC+2, Alir3z4 wrote:
>
> Hi,
>
> Since Django 1.4 released, `django.contrib.databrowse` get deprecated.
> And it's removed from 1.5.
> Actually I hope django.contrib.* completely get wiped off django, I guess 
> django development
> will be faster and cleaner without those app.
>
> I've extracted and adopted it.
> Now it's available as stand-alone package pypi.
>
> pypi:
> http://pypi.python.org/pypi/django-databrowse
>
> source/git repo:
> https://github.com/Alir3z4/django-databrowse
>
>
> Regards,
> Alireza Savand
>

-- 
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/-/FaIWDRTgCtgJ.
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: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Tom Evans
On Thu, Jan 10, 2013 at 1:21 PM, Mauro Sánchez  wrote:
> Hello, I have a process that takes about 2 or 3 minutes to execute. The
> problem is that sometimes (not always) it results in an Internal Server
> Error 500 because of the time it takes.
> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
> that even if the process takes 10 or 15 minutes it just keeps running until
> it finish?
> Thanks a lot for the help.
> Cheers,
> Mauro.
>

Providing a URL that consumes an entire web worker for >1 minute is a
good way to open yourself up for a DOS attack - even 10 seconds is too
long really. Put lengthy operations in to a queue - like django-celery
-  so that you can manage how much of your resources that task
consumes, and poll for completion with AJAX.

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.



Correct way to specifiy database-level column defaults

2013-01-10 Thread john . woltman
What is the best way to specify a database level default value with 
Django?  If I want a timestamp column to default to the SQL function now(), 
is there an accepted way to make it happen?  Or to default a boolean column 
to True?  I notice that when I call *manage.py sqlall* I don't see any *
DEFAULT* values specified in the generated queries for Postgres.

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



Near term disadvantages of Django+Python 3 stack?

2013-01-10 Thread John
I understand that Django 1.5 RC supports Python 3, but for the sake of this 
question let's assume the 1.5 GA was already out.  As a developer, I want 
to use latest possible stable versions.  However, are there other 
implications for using a Py3 stack here?  For example, might I in the near 
future discover that 75% of the plugins which I might find useful will not 
yet be ported over for some time?  Are there any other gotchas that might 
make me want to stay with Python2.7 stack for a site I'll be building in a 
6 month window?

thanks!
John

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



AW: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Szabo, Patrick (LNG-VIE)
I’ve had the exact same problem a couple of weeks ago.
There is a timout that you can define for apache however it somehow didn’t take 
when i tried it.
You really should consider a background task, as Bill suggested.

For me it was a query that took forever. I was able to cut the time in half by 
going through this:
https://docs.djangoproject.com/en/1.1/topics/db/optimization/

Especially select_related() helped a lot !
https://docs.djangoproject.com/en/1.1/ref/models/querysets/#select-related


Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Bill Freeman
Gesendet: Donnerstag, 10. Jänner 2013 14:47
An: django-users@googlegroups.com
Betreff: Re: Execution time of a long process results in an Internal Server 
Error 500

Maybe.  But it's generally considered a bad idea to tie up a request thread for 
that long.

A more common solution is to arrange for a background task to do the heavy 
lifting.

If the user must know when the task is done, you can poll in JavaScript.

Bill
On Thu, Jan 10, 2013 at 8:21 AM, Mauro Sánchez 
> wrote:
Hello, I have a process that takes about 2 or 3 minutes to execute. The problem 
is that sometimes (not always) it results in an Internal Server Error 500 
because of the time it takes.
Is there a way to configure Apache or mod_wsgi to prevent this? Let's say, that 
even if the process takes 10 or 15 minutes it just keeps running until it 
finish?
Thanks a lot for the help.
Cheers,
Mauro.
--
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.



. . . . . . . . . . . . . . . . . . . . . . . . . .

Ing. Patrick Szabo

Developer

LexisNexis

A-1030 Wien, Marxergasse 25



patrick.sz...@lexisnexis.at

Tel.: +43 1 53452 1573

Fax.: +43 1 534 52 146

. . . . . . . . . . . . . . . . . . . . . . . . . .


-- 
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: Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Bill Freeman
Maybe.  But it's generally considered a bad idea to tie up a request thread
for that long.

A more common solution is to arrange for a background task to do the heavy
lifting.

If the user must know when the task is done, you can poll in JavaScript.

Bill

On Thu, Jan 10, 2013 at 8:21 AM, Mauro Sánchez  wrote:

> Hello, I have a process that takes about 2 or 3 minutes to execute. The
> problem is that sometimes (not always) it results in an Internal Server
> Error 500 because of the time it takes.
> Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
> that even if the process takes 10 or 15 minutes it just keeps running until
> it finish?
> Thanks a lot for the help.
> Cheers,
> Mauro.
>
> --
> 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.



Execution time of a long process results in an Internal Server Error 500

2013-01-10 Thread Mauro Sánchez
Hello, I have a process that takes about 2 or 3 minutes to execute. The
problem is that sometimes (not always) it results in an Internal Server
Error 500 because of the time it takes.
Is there a way to configure Apache or mod_wsgi to prevent this? Let's say,
that even if the process takes 10 or 15 minutes it just keeps running until
it finish?
Thanks a lot for the help.
Cheers,
Mauro.

-- 
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: Star Rating System In Django

2013-01-10 Thread Sergio Zambrano
I don't know what dJango or agon is, but I created a new rating system 
using just a font, and css to render e.g. "3.5 out of 5" into  three and a 
half stars, while the html says just that. No divs, no images, no Canvas, 
no SVG, no JavaScript, no Flash, no extra spans.

http://socialblogsitewebdesign.com/semantic-yet-seo-friendly-rating-stars/

I hope you can use/adapt this.

On Sunday, December 30, 2012 8:46:24 AM UTC-5, coded kid wrote:
>
> The developer for agon rating is no more working on it and I guess it 
> won't work nice .
>
> Simple ratings is not working out for me. Don't know if there's a 
> JavaScript plugin for rating?
>
> On Sunday, 30 December 2012 14:08:10 UTC+1, Alec Taylor wrote:
>>
>> Agon (probably easiest): 
>> http://agon-ratings.readthedocs.org/en/latest/usage.html 
>>
>> -or- 
>>
>> https://github.com/dcramer/django-ratings 
>>
>> -or- 
>>
>> https://github.com/coleifer/django-simple-ratings 
>>
>> On Mon, Dec 31, 2012 at 12:03 AM, coded kid  wrote: 
>> > Anyone know about any good package or tutorial or plugin for building 
>> > a star rating system in django? I tried using dcramer/django rating 
>> > but It's not working perfectly. 
>> > 
>> > If you know of any plugin, package on how to build a star rating 
>> > system, kindly post it below. 
>> > 
>> > 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...@googlegroups.com. 
>> > To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/XPKyHjz0BnkJ.
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 can i toggle django boolean field automatically

2013-01-10 Thread Babatunde Akinyanmi
Hi Emma,
Your question is kinda vague cos you didn't mention under what
situation you want the field to be updated automatically. That said, I
have a feeling you are interested in signals. Check the documentation
for django's inbuilt signals feature. You can make your app listen for
a signal and make it run a particular function (or update a model's
field) immediately the signal has been received.

Sent from my Windows Phone

-Original Message-
From: Okorie Emmanuel
Sent: 1/10/2013 9:43 AM
To: Django users
Subject: how can i toggle django boolean field automatically

hi am doing an app in which i intend to toggle the boolean field
 automatically based on certain requirements. Pls how i achieve this

--
 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: how can i toggle django boolean field automatically

2013-01-10 Thread Sergiy Khohlov
Model has ability  to set default value to the field.
https://docs.djangoproject.com/en/dev/ref/models/fields/#editable
If you would like to set values on runtime please set those value in
to form constructor.

Many thanks,

Serge


+380 636150445
skype: skhohlov


2013/1/10 Okorie Emmanuel :
> hi am doing an app in which i intend to toggle the boolean field
> automatically based on certain requirements. Pls how i achieve this
>
> --
> 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.



how can i toggle django boolean field automatically

2013-01-10 Thread Okorie Emmanuel
hi am doing an app in which i intend to toggle the boolean field
automatically based on certain requirements. Pls how i achieve this

-- 
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: ORM, Oracle and UTF-8 encoding problem.

2013-01-10 Thread Jani Tiainen

10.1.2013 8:59, Ian Kelly kirjoitti:

On Wed, Jan 9, 2013 at 11:40 PM, Jani Tiainen  wrote:

If we just force using force_unicode everything works except in older
versions of cx_Oracle (our server had 5.0.4 or something) connection strings
can't be unicode for some reason.


Sure, that's why the check exists in the first place.  Prior to 5.1
cx_Oracle could be built either with Unicode or without.  If the
former, it would accept only unicode strings and would raise an
exception on byte strings.  If the latter, it would be exactly the
opposite.

Does it work for you using force_bytes with 5.0.4?



That's on my production server that runs 1.3.x version. smart_str (which 
detection selects) does not work.


using force_unicode works (except for connection string).

Also depending on what OCI client 10.2.0.5 or instant client 11.2 is 
used when compiling cx_Oracle causes variation. 10.2.0.5 doesn't work 
with smart_str while 11.2 does work.


Both can take plain unicode (u'') when using 
just cx_Oracle commands without any problems.


Note:

If I add manually some unicode to database Django can read it without 
any problems.


--
Jani Tiainen

- Well planned is half done and a half done has been sufficient before...

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