Re: Apache WSGI DJANGO

2009-10-13 Thread Florian Strzelecki
I think the problem is not in your wsgi file, but in your apache's vhost
configuration.
You should have this in your vhost configuration, to use your django
application with mod_wsgi :

WSGIScriptAlias / /var/www/conf/myconf.wsgi

So, you should add this line (if your admin/media is url /admin/media, you
can override this in your project's settings file, with ADMIN_MEDIA_PREFIX)
:

Alias /admin/media
/usr/lib/python2.5/site-packages/django/contrib/admin/media

As you could have this for other local media :

Alias /media /var/www/media

All path depend on your installation, of course. :)

F.


2009/10/13 Nilesh Patel 

> here is my apache config file for wsgi,
>
> import os, sys
> apache_configuration= os.path.dirname(__file__)
> project = os.path.dirname(apache_configuration)
> sys.path.append('/var/www')
> sys.path.append('/var/www/myproj/cms')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'myproj.settings'
> import django.core.handlers.wsgi
> from django.conf import settings
> settings.DEBUG=False
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
>
> 2009/10/11 Kenneth Gonsalves 
>
>>
>> On Sunday 11 Oct 2009 12:14:13 pm lafada wrote:
>> > Apache says,
>> >
>> > File does not exist: /var/lib/python-support/python2.5/django/contrib/
>> > admin/media/js/actions.js
>> >
>> > When I tried to locate server says,
>> > /usr/lib/python2.5/site-packages/django/contrib/admin/media/js/
>> > actions.js
>> >
>> > what may be the cause ???
>>
>> you have not given the correct path to django/contrib/admin in your apache
>> config.
>> --
>> regards
>> kg
>> http://lawgon.livejournal.com
>>
>>
>>
>
>
> --
> #Japan Shah
> Sent from Gujarat, India
> >
>

--~--~-~--~~~---~--~~
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: updating dependent page from an iframe

2009-04-23 Thread Florian Strzelecki
I think this is a basic html's problem, and, I'll suppose that you absolutly
need an iframe on your site.

So, when you make something in an iframe, the another have to be reloaded.
With Javascript, or another way...

And if you don't want to reload the entire iframe, use Ajax technologie...

Hm... but... are you sure you need an iframe ? :x

2009/4/23 snorkel 

>
> Hi,
>  I have a page with an iframe which contains operations on model data
> such as adding /deleting etc
> and the rest of the page which has a clickable list of all the items.
>  However when you add or delete an item via the ifame the list does
> not update.
> Should I be using reload or is there another method?
>
> 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: Writing csv files to server

2009-04-23 Thread Florian Strzelecki
Hm... in my opinion this isn't a Django problem, but a conception problem.

I think you need a "state" on the invoices : when does it have been paid ?
If you know when, so you can filter on the date of paiement.

Exemple :

Paid (id-1, sales-1, date_paid-2009-03-02, value-$150)
Paid (id-1, sales-1, date_paid-2009-03-24, value-$100)
Paid (id-2, sales-1, date_paid-2009-04-02, value-$400)

And, in another table, you could have this :

Invoice (id-1, client-1, value-$650, is_paid-1)

At 2009-03-25 you can say : the client have paid $350, remain $400.
At 2009-04-12 you can say : the client have paid $650, remain $0

And, if you want, at 2009-05-06 say "at 2009-03-25 what was the state of
this sales ?" : you are able to give this information !

2009/4/23 Alfonso 

> Does anyone have a better suggestion and how would I start writing to
> csv on server.
>

--~--~-~--~~~---~--~~
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: Pass subdomain to a view function.

2009-04-09 Thread Florian Strzelecki
And what about use the "request" parameter ?
Link :
http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_host

You can use the request.get_host() to know what is the host using, and so
make what you want (some split and catch the first part "user1").

2009/4/9 Rodrigo C. 

>
> Is there a way to catch a subdomain and pass it to a view function?
>
> For example, if I have a site "sitename.com", and a user called
> "user1", I would like to be able to have "user1.sitename.com" be
> hooked into the user's profile, for example, so I'd need to be able to
> pass the subdomain to my view function.
> The site will be hosted on Webfaction, if that makes a difference.
>
> Thanks,
>
> Rodrigo
> >
>

--~--~-~--~~~---~--~~
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: Igoogle integration

2009-04-09 Thread Florian Strzelecki
Hello, I think you could use this :
http://docs.djangoproject.com/en/dev/topics/http/urls/#passing-extra-options-to-view-functions

You can give some parameters to your view function, defined into the url
pattern.
So, when it's /mycooldfeed you will write {'template':
'normal_template.tpl'} and when it's /embed/mycooldfeed/ you will write
{'template': 'embed_template.tpl'}

Or something like that...
But may be someone have a better idea.

2009/4/9 Nick Boucart 

>
> Ideally, I would like to have a urls like:
> /mycoolfeed and /embed/mycoolfeed that both fetch exactly the same
> data from the database, but render a different template based upon the
> url.
>
> How would you do 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: mod_python error

2009-04-07 Thread Florian Strzelecki
And... what about that :

DocumentRoot:   '/usr/local/apache2/htdocs'

URI:'/contact.php'
Location:   '/'
Directory:  None
Filename:   '/usr/local/apache2/htdocs/
contact.php'
PathInfo:   ''

Phase:  'PythonHandler'
Handler:'django.core.handlers.modpython'

Are you trying to serve a php file with mod_python ?
If you see what I meen. :]

--~--~-~--~~~---~--~~
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: select_related and 1-to-many relations

2009-04-07 Thread Florian Strzelecki
Hm... something like that :
http://docs.djangoproject.com/en/dev/topics/db/queries/#backwards-related-objects
You can reverse a relationship, using "u.*att*_set".

--~--~-~--~~~---~--~~
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: Beginner's Help needed

2009-04-05 Thread Florian Strzelecki
Yes you can !

*WSGI :*

Alias /another /path/to/your/phpApplication
WSGIScriptAlias / /path/to/file.wsgi

*MOD_PYTHON :*

Use Location apache directive.
I don't remember what to do for php... sorry, but I know that on this way.


2009/4/5 Dougal Matthews 

> It depends how you mean combine really. You can have them both running on
> the same server, you can have them share the same database (then you can
> still manage it with django)
> Dougal
>
>
> ---
> Dougal Matthews - @d0ugal
> http://www.dougalmatthews.com/
>
>
>
> 2009/4/5 atik 
>
>
>> Ok. Again Thanks. I will do it.
>> Can i combine django application with PHP?
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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: Best JS Library compatibility for Django

2009-04-05 Thread Florian Strzelecki
Hm... look at this :
http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.is_ajax

HttpRequest.is_ajax()ΒΆ
New
in Django 1.0: *Please, see the release
notes*

Returns True if the request was made via an XMLHttpRequest, by checking the
HTTP_X_REQUESTED_WITH header for the string 'XMLHttpRequest'. The following
major JavaScript libraries all send this header:

   - jQuery
   - Dojo
   - MochiKit
   - MooTools
   - Prototype
   - YUI

If you write your own XMLHttpRequest call (on the browser side), you'll have
to set this header manually if you want is_ajax() to work.


2009/4/5 Alex Gaynor 

>
>
> On Sun, Apr 5, 2009 at 4:02 PM, lodmod@gmail.com  > wrote:
>
>>
>> What are some JS libraries that people have had good experience with
>> using in conjunction with Django webapps?
>>
>>
>>
> Django will work perfectly fine with any javascript library you choose to
> use.  That being said I personally like jQuery because of its simple API.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
>
>
> >
>

--~--~-~--~~~---~--~~
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 filter query sets in a django template?

2009-04-05 Thread Florian Strzelecki
Did you try to look at Inclusion Tag ?
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags

In template you are not allowed to use some python code... but with an
inclusion tag, you will be able to write this :

{% load related_conferences %}
{% related_conferences scientist %}

And your inclusion tag may be this :

@register.inclusion_tag('path/to/tag/related_conferences.html')
def related_conferences(scientist):
# define here list_of_conferences
return {'list': list_of_conferences}

The inclusion tag have been created for this : move python code into python
file ! Not into template files.

I hope this will help you.
And sorry for my English, I'm french. :)


2009/4/5 codecowboy 

>
> I posted a question earlier today about circular imports (http://
> groups.google.com/group/django-users/t/6119e979131c8c25).  I now have
> a follow question to that.  I've got the following view logic.
>
> def portal(request):
>scientist_id = 1
>s = get_object_or_404(Scientist, pk=scientist_id)
>return render_to_response('scientists/portal.html',
> {'scientist':s})
>
> Now, Scientists are related (many-to-many) to Conferences through
> ConferenceAttendee.  Both of these models are created in a different
> app.  I won't paste them in unless someone needs to see them in order
> to answer my question.
>
> I only want to loop through conferences that this scientist is
> presenting.  (ConferenceAttendee.presenter=True).  I have tried
> following the docs (http://docs.djangoproject.com/en/dev/topics/db/
> queries/#field-lookups-intro),
> but it seems that you can only call the
> filter method in python files like views.py or models.py.  I've tried
> replacing the loop code below with "for ...conference._set.filter(...)
> but python gives me errors when I do that.  Here is my template logic.
>
> Your Presentations
>
> 
>{% for conference in scientist.conference_set.all %}
>
> {{ conference.title }}
>{% endfor %}
>
> 
>
> I've been stuck on this one for days now so any help would be greatly
> appreciated.  Please do point me to any articles that I may have
> missed that already answer this post.
>
> Thank you,
>
> Guy
> >
>

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