Re: User being logged out without explicitly calling auth.logout

2009-06-12 Thread Karen Tracey
On Fri, Jun 12, 2009 at 3:53 PM, Robocop  wrote:

>
> I'm having an issue when traversing a link on my site.  When clicking
> this link, I'm properly routed to the page, however the user i am
> logged in as is logged out for no reason.


How are you determining that the user is logged out?


> The link is part of a menu
> that looks as such:
> [snip]

The view that renders the page looks like:
>
> @login_required
> @staff_member_required
> def audit_choose(request):
>  master_engagements=[]
>  master_clients=[]
>  dept_list =Department.objects.filter(active=True).order_by('name')
>  if request.method=='POST':
>  .
>  .
>  .
>  else:
>dept_list =Department.objects.filter(active=True).order_by('name')
>return render_to_response("audit_choose_departments.html", locals
> ())
>
> Because i'm just clicking a link there is no post data, so the only
> relavent lines are those outside of the if request.method=='POST'
> section
>
> Is there anything i'm just doing completely wrong?  I don't recall
> having this problem before, and just noticed it while debugging some
> other issues.  Any help/ridicule/ideas would be great!
> thanks


Well you aren't passing a RequestContext to render_to_response, to there
will be no user object in the template context when it is rendered.  Perhaps
this is what is making you think the user has been logged out?

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



os.system is not working properly

2009-06-12 Thread limas

i have a django application with flex as front end, i am using
amfgateway for it.

i have a fortran executable file which will create a new file called
predict.dat(say) it will take two input files(input.dat, test) under
my project directory.
my code is like this
os.system("/home/me/mypro/s_test")where s-test is the
executable file.
Inside the python interpretor and inside the interpretor provided by
django it is working properly.

but inside amfgateway.py it is failing by giving the following.
(and also it is creating the output file
without data)

list in: end of file
apparent state: unit 1 named input.dat
last format: list io
lately reading direct formatted external IO
Aborted


Can anybody help me?

--~--~-~--~~~---~--~~
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: Amazon S3 for File Uploads

2009-06-12 Thread Ian Lewis
Max,

Just from glancing over the options you have below none of them looked
particularly good to me. The first is only a file field so depending on what
you are doing it may not work for you. The second seemed reasonable but has
no options for setting things like http headers for files or more advanced
options like ACLs. The third looks like it has some support for setting
headers but it does some stuff like putting the file content into memory
then putting it in a StringIO object which wouldn't be good for files much
over say a few tens of megabytes.

I think which one you choose would depend on what you want to do but
personally I rolled my own based on Django 1.1's storage api which does a
lot better job of streaming and chucking data for large files because
existing options like the ones below weren't very robust .

Ian

On Sat, Jun 13, 2009 at 6:55 AM, Max Clark  wrote:

>
> Hello,
>
> I want to use Amazon S3 for file uploads from users
> (models.FileField). I have been searching and have come across these
> three plugins/examples to use S3 with django...
>
> http://code.djangoproject.com/wiki/AmazonSimpleStorageService
> http://www.sourceguru.net/archives/177
> http://code.welldev.org/django-storages/wiki/S3Storage
>
> For list members currently running this code I would be very
> interested in feedback / why you went with one vs another / what your
> experience has been like.
>
> Thanks,
> Max
>
> >
>


-- 
===
株式会社ビープラウド  イアン・ルイス
〒150-0012
東京都渋谷区広尾1-11-2アイオス広尾ビル604
email: ianmle...@beproud.jp
TEL:03-5795-2707
FAX:03-5795-2708
http://www.beproud.jp/
===

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



Amazon S3 for File Uploads

2009-06-12 Thread Max Clark

Hello,

I want to use Amazon S3 for file uploads from users
(models.FileField). I have been searching and have come across these
three plugins/examples to use S3 with django...

http://code.djangoproject.com/wiki/AmazonSimpleStorageService
http://www.sourceguru.net/archives/177
http://code.welldev.org/django-storages/wiki/S3Storage

For list members currently running this code I would be very
interested in feedback / why you went with one vs another / what your
experience has been like.

Thanks,
Max

--~--~-~--~~~---~--~~
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: Weird URL problem

2009-06-12 Thread James Bennett

On Fri, Jun 12, 2009 at 7:07 PM, Kenneth
Gonsalves wrote:
> I always set it for VirtualHost - AFAIK the docs say to do so.

No.

The docs say to set it to the prefix under which the site is being
served. If the site is located at the root of the server -- e.g., "/"
-- then it is not being served under a prefix.

In other words, if you're running multiple things in the same server
on the same domain (maybe multiple Django projects, maybe non-Django
stuff as well), and you have Django running under some particular
location (e.g., "example.com/mydjangosite/" is Django, but
"example.com/" is not), you use django.root to indicate where it's
running.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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: Weird URL problem

2009-06-12 Thread Kenneth Gonsalves

On Saturday 13 June 2009 05:37:56 Kenneth Gonsalves wrote:
> > Commenting out that line solved the problem. We're using
> > a VirtualHost definition, so it seems django.root should
> > not be set for a VirtualHost.
>
> I always set it for VirtualHost - AFAIK the docs say to do so.

to clarify, I have a project called 'conference' at /home/lawgon/conference, 
and an application called 'web' under it. Here is an excerpt from my 
VirtualHost config:


  SetHandler python-program
  PythonPath "['/home/lawgon/'] + 
['/home/lawgon/projects/quadmulc/env/lib/python2.5/site-packages/'] + 
sys.path"
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE conference.settings
  PythonOption django.root /web
  PythonInterpreter conference_main
  PythonDebug On

-- 
regards
kg
http://lawgon.livejournal.com

--~--~-~--~~~---~--~~
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: Weird URL problem

2009-06-12 Thread Kenneth Gonsalves

On Friday 12 June 2009 18:35:33 Lars Stavholm wrote:
> > Notice the Request URL, there's a slash missing,
> > something along the way removed the slash.
> >
> > If I try http://mbf//jobs, I end up at the right place.
> >
> > Can anyone tell me what it is that is removing that slash?
>
> Found the culprit in httpd.conf: PythonOption django.root /
>
> Commenting out that line solved the problem. We're using
> a VirtualHost definition, so it seems django.root should
> not be set for a VirtualHost.

I always set it for VirtualHost - AFAIK the docs say to do so.
-- 
regards
kg
http://lawgon.livejournal.com

--~--~-~--~~~---~--~~
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: FileField will not validate

2009-06-12 Thread Daniel Hilton
Can you post the model as well?

2009/6/12 Brandon Taylor 

>
> Hi Everyone,
>
> I'm using Django trunk, Python 2.6.
>
> I have a model form with a FileField. The relevant portions of the
> HTML are:
>
>  enctype="multipart/form-data">
>{{ job_seeker_form.resume }}
>{{ job_seeker_form.resume.label_tag }}
>{{ job_seeker_form.resume.help_text }}
>{{ job_seeker_form.resume.errors }}
> 
>
> In my view, the relevant portions of code are:
>
> def create_career_profile(request):
>if request.method == 'POST':
>job_seeker_form = JobSeekerProfileForm(request.POST,
> request.FILES, prefix='job_seeker')
>#do more stuff here
>else:
>job_seeker_form = JobSeekerProfileForm(prefix='job_seeker')
>
>return render_to_response, etc
>
> Every time I post this form, I get a required validation error on the
> resume field. Can anyone see what I'm doing wrong?
>
> TIA,
> Brandon
> >
>


-- 
Dan Hilton

DanHilton.co.uk


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



FileField will not validate

2009-06-12 Thread Brandon Taylor

Hi Everyone,

I'm using Django trunk, Python 2.6.

I have a model form with a FileField. The relevant portions of the
HTML are:


{{ job_seeker_form.resume }}
{{ job_seeker_form.resume.label_tag }}
{{ job_seeker_form.resume.help_text }}
{{ job_seeker_form.resume.errors }}


In my view, the relevant portions of code are:

def create_career_profile(request):
if request.method == 'POST':
job_seeker_form = JobSeekerProfileForm(request.POST,
request.FILES, prefix='job_seeker')
#do more stuff here
else:
job_seeker_form = JobSeekerProfileForm(prefix='job_seeker')

return render_to_response, etc

Every time I post this form, I get a required validation error on the
resume field. Can anyone see what I'm doing wrong?

TIA,
Brandon
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



fastcgi giving resource not available

2009-06-12 Thread Matt Davies
Has anyone seen an issue where the nginx fastcgi is giving me a resource
unavailable error, but it only happens if I have debug set to False?
With debug set to True it never happens, with it set to False it always
happens, but only in one part of our application.

What are the differences with running an app with debug on and with debug
off?

any help is greatly appreciated

--~--~-~--~~~---~--~~
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: Basic cms in Practical Django Projects

2009-06-12 Thread John Allen

Have a look at this site:
http://blog.haydon.id.au/2008/08/notes-on-practical-django-projects.html

On Jun 11, 1:06 am, jayvandal  wrote:
> Hi,
> I bought the book and started the first project. displayed the Flat
> Page. I then downloaded the Tiny0MCE and can't get it to work. are
> there any places wher I an get a source code listing?
> Thanks for any 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
-~--~~~~--~~--~--~---



Newbie question on ContentTypes and Generic Relations

2009-06-12 Thread Rana

Hi,

I am trying to modify a blog and article model that will both display
data from a related products model. I read that the way I should do
this is through the ContentTypes framework and generic foreign
relations. I would be grateful for some guidance on how to do this.
I've read the documentation on the 
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/
website, but I am struggling with how to relate it to what I need to
do.

I have something like this presently:

articles/models.py
---
class Article(models.Model):
author = models.ForeignKey(User, related_name='article_author')
headline = models.CharField(max_length=256)
publish_content = models.TextField(blank=True)
...
related_product = models.ManyToManyField('RelatedProduct', null=True,
blank=True)

class RelatedProduct(models.Model):
product_name = models.CharField(max_length=256)
product_link = models.TextField(max_length=512)


blogs/models.py

class Blog(models.Model):
name = models.CharField(max_length=128)
long_description = models.TextField()
short_description = models.TextField()

I would like to modify this so that I can have the related products
from articles also available in my Blog class and the related products
table should be the same between Article class and Blog class, i.e. I
do not want to have two instances of the RelatedProduct class.

Thank you for any help you can offer.

Rana

--~--~-~--~~~---~--~~
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 being logged out without explicitly calling auth.logout

2009-06-12 Thread Robocop

I'm having an issue when traversing a link on my site.  When clicking
this link, I'm properly routed to the page, however the user i am
logged in as is logged out for no reason.  The link is part of a menu
that looks as such:



  Home
  Add Projects
  View Projects
 
{% if user.is_staff %}
  Add Timesheets
  View Timesheets
  Audit/Export
  Timesheet Dump
  Report- Inventory

{% endif %}
  Logout


and the corresponding url.py line is:
urlpatterns += patterns('helpdesk.projects.views',
.
.
.
  (r'^audit_init/$','audit_choose'),
.
.
.
)

The view that renders the page looks like:

@login_required
@staff_member_required
def audit_choose(request):
  master_engagements=[]
  master_clients=[]
  dept_list =Department.objects.filter(active=True).order_by('name')
  if request.method=='POST':
  .
  .
  .
  else:
dept_list =Department.objects.filter(active=True).order_by('name')
return render_to_response("audit_choose_departments.html", locals
())

Because i'm just clicking a link there is no post data, so the only
relavent lines are those outside of the if request.method=='POST'
section

Is there anything i'm just doing completely wrong?  I don't recall
having this problem before, and just noticed it while debugging some
other issues.  Any help/ridicule/ideas would be great!
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: Disabling I18N causes circular import?

2009-06-12 Thread Rajesh D



On Jun 11, 6:29 pm, ringemup  wrote:
> With I18n disabled, I'm getting what looks like a circular import
> error from one of my apps, but with it enabled, the error goes away.
> None of my modules is (to my knowledge) using any I18N features.  Any
> clues what might be going on?

Include a trace of the error and may be people can help you.

-RD

--~--~-~--~~~---~--~~
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: Wired integers displayed instead of Friends List in facebook connect

2009-06-12 Thread Rajesh D



On Jun 12, 12:51 am, gganesh  wrote:
> hi,
> My app connects to Facebook and as user logins in with facebook
> connect ,i intent to display users friends list .I the process of
> doing so i have written a code as pasted below
>
>  script>
>
>