Re: Problem getting django on mac (10.5/Leopard) working

2012-02-05 Thread Peter of the Norse

On Jan 8, 2012, at 8:22 PM, larry.mart...@gmail.com wrote:

> On Jan 7, 7:13 pm, "larry.mart...@gmail.com" 
> wrote:
>> On Jan 7, 7:03 pm, David Markey  wrote:
>> 
>>> Is there a reason you didnt do easy_install django?
>> 
>> Cause I didn't know about it. I just followed the directions I found
>> at:
>> 
>> https://docs.djangoproject.com/en/dev/topics/install/
>> 
>> Is there some reason that wouldn't work?
> 
> I solved this by creating a symlink from /Library/Python/2.5/site-
> packages/django to my django install dir. Still not sure why that
> worked and putting the path in django.pth did not.

Python paths work by appending the search name to the end of everything in 
sys.path. For example, when you do `import django`, it looks for './django.py', 
'./django/__init__.py', '/usr/local/django-trunk/django.py', 
'/usr/local/django-trunk/django/__init__.py', etc. None of those paths match.

>>> On 8 January 2012 01:50, larry.mart...@gmail.com 
>>> wrote:
>> 
 I am trying to get django working on my mac. I downloaded it from SVN
 to /usr/local/django-trunk and it's there:
>> 
 $ ls /usr/local/django-trunk/
 __init__.py corehttptemplatetags bin
  db  middleware  test
 confdispatchshortcuts   utils
   contrib forms
 templateviews
>> 
 I updated my site-packages with a django.pth file:
>> 
 $ cat /Library/Python/2.5/site-packages/django.pth
 /usr/local/django-trunk
>> 
 python does have this dir in its path:
>> 
 $ python -c "import sys; print sys.path"
 ['', '/Library/Python/2.5/site-packages/cx_Oracle-5.0.2-py2.5-
 macosx-10.5-i386.egg', '/System/Library/Frameworks/Python.framework/
 Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/
 Python.framework/Versions/2.5/lib/python2.5', '/System/Library/
 Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/
 System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
 plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/
 lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/
 Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/
 Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-
 tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/usr/
 local/django-trunk', '/System/Library/Frameworks/Python.framework/
 Versions/2.5/Extras/lib/python/PyObjC']
>> 
 But I still can't import it:
>> 
 $ python
 Python 2.5.1 (r251:54863, May  5 2011, 18:37:34)
 [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
>>> import django
 Traceback (most recent call last):
  File "", line 1, in 
 ImportError: No module named django
>> 
 What am I missing or doing wrong?
>> 
 TIA!
 -larry
>> 
 --
 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.
> 

Peter of the Norse
rahmc...@radio1190.org



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



Re: django.core.handlers.wsgi not found

2012-02-05 Thread larry.mart...@gmail.com
On Feb 5, 4:05 pm, Dennis Lee Bieber  wrote:
> On Sun, 5 Feb 2012 14:08:52 -0800 (PST), "larry.mart...@gmail.com"
>
>  wrote:
>
> >It's exactly the same sys.path I get from command line python, where
> >the import works.
>
>         NO IT ISN'T!
>
>
>
> >['/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg', '/
>         
> >['', '/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg',
>
>         Note the difference? The latter includes "current working directory"
> as the first entry.

Ok, I didn't notice that. However wouldn't the cwd be '.' and not an
empty sting? In any case, when I try the import from command line
python, I am not in the dir containing django.core.handlers.wsgi.

-larry

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



Re: django.core.handlers.wsgi not found

2012-02-05 Thread larry.mart...@gmail.com
On Feb 4, 9:52 pm, BlackKnight  wrote:
> http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives
>
> have you added this in apache conf,
>
> 
> SetHandler wsgi-script
> Options ExecCGI
> 

No, I do not have that, but I do have:

WSGIScriptAlias / /usr/local/myapp/scripts/myapp.wsgi

Which is what I have on all the other systems I've deployed this app
on.

But I did try removing that line, and adding what you suggested - that
made the error go away, but my app does not work - i.e. my app's URLs
are not recognized or resolved. With that line left in and the
additional Directory directive, I get the same error.


>
> On Feb 5, 5:53 am, "larry.mart...@gmail.com" 
> wrote:
>
> > I am trying to deploy my django app on a newly setup CentOS box. I
> > have successfully deployed it on ubuntu and on a Mac.
>
> > I get these errors in the apache error log:
>
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> > (pid=13616): Target WSGI script '/usr/local/myapp/scripts/myapp.wsgi'
> > cannot be loaded as Python module.
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> > (pid=13616): Exception occurred processing WSGI script '/usr/local/
> > myapp/scripts/myapp.wsgi'.
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] Traceback (most
> > recent call last):
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]   File "/usr/
> > local/myapp/scripts/myapp.wsgi", line 8, in 
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]     import
> > django.core.handlers.wsgi
> > [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] ImportError: No
> > module named django.core.handlers.wsgi
>
> > From command line python the import works:
>
> > $ python
> > Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
> > [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
>
> > >>> import django.core.handlers.wsgi
>
> > I also have this warning in the apache log:
>
> > [Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Compiled for Python/2.6.2.
> > [Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Runtime using Python/
> > 2.6.6.
>
> > I've checked permissions, and wsgi.py and every dir in the path to it
> > is 755.
>
> > Anyone know why my app isn't finding it?
>
> > TIA!
> > -larry

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



Re: django.core.handlers.wsgi not found

2012-02-05 Thread larry.mart...@gmail.com
On Feb 4, 7:47 pm, Brett Epps  wrote:
> Sometimes it can help to print sys.path in your WSGI file.  (The output
> should end up in the apache error log.)  That should tell you where Python
> is looking for modules.  If the Django install path is not listed, you may
> need to reinstall Django.

It's exactly the same sys.path I get from command line python, where
the import works.

>From the apache error log:

['/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg', '/
usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-
linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/
usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-packages', '/
usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/python2.6/site-
packages/gtk-2.0', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-
py2.6.egg-info', '/usr/lib/python2.6/site-packages/webkit-1.0']

$ python
Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg',
'/usr/lib/python26.zip', '/usr/lib/python2.6', '/usr/lib/python2.6/
plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-
old', '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/site-
packages', '/usr/lib/python2.6/site-packages/gst-0.10', '/usr/lib/
python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages/
setuptools-0.6c11-py2.6.egg-info', '/usr/lib/python2.6/site-packages/
webkit-1.0']


> How was Django installed originally?

django was install from svn like this:

#svn co http://code.djangoproject.com/svn/django/trunk/django /usrl/
lib/python2.6/dist-packages/django
#ln -s /usrl/lib/python2.6/dist-packages/django /usr/lib/python2.6/
site-packages/django

Which is the same way I've done it on the other systems I've deployed
this app on.

mod_wsgi was installed with yum.

Thanks!
-larry

> Brett
>
> On 2/4/12 6:53 PM, "larry.mart...@gmail.com" 
> wrote:
>
> >I am trying to deploy my django app on a newly setup CentOS box. I
> >have successfully deployed it on ubuntu and on a Mac.
>
> >I get these errors in the apache error log:
>
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> >(pid=13616): Target WSGI script '/usr/local/myapp/scripts/myapp.wsgi'
> >cannot be loaded as Python module.
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> >(pid=13616): Exception occurred processing WSGI script '/usr/local/
> >myapp/scripts/myapp.wsgi'.
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] Traceback (most
> >recent call last):
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]   File "/usr/
> >local/myapp/scripts/myapp.wsgi", line 8, in 
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]     import
> >django.core.handlers.wsgi
> >[Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] ImportError: No
> >module named django.core.handlers.wsgi
>
> >From command line python the import works:
>
> >$ python
> >Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
> >[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> >Type "help", "copyright", "credits" or "license" for more information.
>  import django.core.handlers.wsgi
>
> >I also have this warning in the apache log:
>
> >[Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Compiled for Python/2.6.2.
> >[Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Runtime using Python/
> >2.6.6.
>
> >I've checked permissions, and wsgi.py and every dir in the path to it
> >is 755.
>
> >Anyone know why my app isn't finding it?
>
> >TIA!
> >-larry
>
> >--
> >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: Filter admin inlines

2012-02-05 Thread NENAD CIKIC
Thanks. So to summarize the solution to filter inlines in admin interface 
based on userprofile was:
define the form on Y model as:

class YForm(forms.ModelForm):
request=None   #NOTE THIS
lang=forms.ModelChoiceField(queryset=lang.objects.all()) #first get all

def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, 
initial=None, error_class=ErrorList,
 label_suffix=':', empty_permitted=False, instance=None):
super(YForm, self).__init__(data, files, auto_id, prefix, initial, 
error_class, label_suffix,
empty_permitted, instance)

self.fields["lang"].queryset = 
lang.objects.filter(company__exact=self.request.user.get_profile().company)

class Meta:
model = Jelo_strani_lang

Where Lang model and userprofile has the same field "company" ; i.e. the 
user is part of that company, and the languages are defined at company 
level   

Then I have defined the inline as:
class YInline(admin.StackedInline):
model = Y
form=YForm
ordering = ('lang',)

def get_formset(self, request, obj=None, **kwargs):
self.form.request=request  #NOTE THIS
return super(YInline, self).get_formset(request, obj, **kwargs)

 Hope that helps to someone

-- 
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/-/jXQbP5KZOCEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to make a small change for apps installed under /site-packages dir

2012-02-05 Thread Daniel Hilton
On 5 February 2012 17:16, Tom Lesters  wrote:
> hi all,
>
> I installed an app called idios into python2.6/site-packages/idios dir,
>
> now I need to make a small change, adding the following line(just for
> purpose of explaining this question)
> @login_required
> to one of the functions defined in idios/views.py
>
> The way I can think of is I can copy all the app's source .py files into my
> project/apps dir, then I can make whatever changes I want,
> but seems that's against the principle of using those apps as library.
> is there a better way of doing that?
>
> or it's just the nature of any django apps:
> if you need to modify anything in the urls.py ,views.py or models.py,
> you just grab the source and make is as a local project app?
>
> I know for template files I can just copy individual file into my project
> dir and leave the rest under /site-packages,
> but how about the .py files?
>

One way you could do this is to copy the urls.py from idios into your
urls.py and wrap just that url pattern with
login_required:


url(r'^blah/$', login_required(views.blah), name = 'idios_blah')


HTH
Dan




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



-- 
Dan Hilton

www.twitter.com/danhilton
www.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.



buildout + djangorecipe how to install tools into bin directory

2012-02-05 Thread WIlliam Deegan
Greetings,

I'm fairly new to django + buildout.

I want to build some data loading tools and install them in the
project bin directory.
I see the bin/django and bin/test have some automated addition of the
path to the buildout installed eggs.

Is there a way to have buildout do this for my script as well?

Thanks,
Bill

-- 
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: dynamic permissions

2012-02-05 Thread Vittorino Parenti
i looked about django-guardian but i think is not better solution.
has nothing had same need?
Thanks,
Vittorino

On 5 Feb, 16:20, Denis Darii  wrote:
> It seems that you are looking for a "per object permissions" system, so
> take a look at django-guardian:https://github.com/lukaszb/django-guardian
>
> On Sun, Feb 5, 2012 at 3:59 PM, Vittorino Parenti <
>
>
>
>
>
> vpare...@thundersystems.it> wrote:
> > i've a model with document'categories and a model with documents. i
> > want set permissions per categories: add invoices, download invoices
> > and so on (invoice is an example of category).
> > Thanks,
> > Vittorino
>
> > On 5 Feb, 12:21, kenneth gonsalves  wrote:
> > > On Sun, 2012-02-05 at 03:02 -0800, Vittorino Parenti wrote:
> > > > I would like to create dynamic downloading permissions:
> > > > - can download invoices
> > > > - can upload invoices
> > > > - can download contracts
>
> > > what is dynamic about this?
> > > --
> > > regards
> > > Kenneth Gonsalves
>
> > --
> > 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.
>
> --
> This e-mail and any file transmitted with it is intended only for the
> person or entity to which is addressed and may contain information that is
> privileged, confidential or otherwise protected from disclosure. Copying,
> dissemination or use of this e-mail or the information herein by anyone
> other than the intended recipient is prohibited. If you are not the
> intended recipient, please notify the sender immediately by return e-mail,
> delete this communication and destroy all copies.

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



how to make a small change for apps installed under /site-packages dir

2012-02-05 Thread Tom Lesters
hi all,

I installed an app called idios into python2.6/site-packages/idios dir,

now I need to make a small change, adding the following line(just for
purpose of explaining this question)
@login_required
to one of the functions defined in idios/views.py

The way I can think of is I can copy all the app's source .py files into my
project/apps dir, then I can make whatever changes I want,
but seems that's against the principle of using those apps as library.
is there a better way of doing that?

or it's just the nature of any django apps:
if you need to modify anything in the urls.py ,views.py or models.py,
you just grab the source and make is as a local project app?

I know for template files I can just copy individual file into my project
dir and leave the rest under /site-packages,
but how about the .py files?


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



Django-Simple-Friends

2012-02-05 Thread coded kid
Hey guys, please how can I go about creating templates for django
simple friends? I've been trying my best, yet no success. Really need
your 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.



Re: Help Me With omab/django-socialauth

2012-02-05 Thread coded kid
Okay, will try it. Thanks man!

Matías Aguirre wrote:
> I was just talking about the hyphen in the app name.
>
> Now you need a view on that URL, try a view that renders a template similar to
> this one 
> https://github.com/omab/django-social-auth/blob/master/example/templates/error.html
> that should show the error you have, possible an app misconfiguration.
>
> Regards,
> Matías
>
> Excerpts from coded kid's message of 2012-02-04 20:12:01 -0200:
> > What hypen are you talking about? I've set all the three logins again.
> > And after trying it, I was redirected to '/login-error/' Any
> > suggestion? Thanks.
> >
> > On Feb 4, 2:55 pm, Matías Aguirre  wrote:
> > > Don't use /login/twitter/ as your LOGIN_URL, the reason behind LOGIN_URL 
> > > is to
> > > provide a user with a page where it can trigger the login process using a 
> > > login
> > > form on links in the case of django-social-auth.
> > >
> > > But if you define its value to /login/twitter/ that will trigger the login
> > > process automatically, and if there's an error in the process
> > > django-social-auth will redirect to LOGIN_URL too (unless LOGIN_ERROR_URL 
> > > is
> > > defined), and that will trigger the login process again and that might be 
> > > the
> > > reason for your loop.
> > >
> > > Regards,
> > > Matías
> > >
> > > Excerpts from coded kid's message of 2012-02-04 12:35:23 -0200:
> > >
> > >
> > >
> > > > I've added it, yet no success! I changed my LOGIN_URL to '/login/
> > > > twitter/' I'm getting "redirect loop" it means it can't redirect to
> > > > the url properly! any help with that?
> > >
> > > > On Feb 3, 4:14 pm, Matías Aguirre  wrote:
> > > > > Django-social-auth (note the hyphen ;)) uses LOGIN_URL as the URL to 
> > > > > redirect
> > > > > in case of errors if LOGIN_ERROR_URL is not defined, you might be 
> > > > > getting an
> > > > > error and being redirected to your LOGIN_URL and as your value is
> > > > > /login/twitter/ you are restarting the process again.
> > >
> > > > > Another possible flaw is your SOCIAL_AUTH_ENABLED_BACKENDS = 
> > > > > ('twitter')
> > > > > you should add a comma after the value or it won't be a valid tuple, 
> > > > > like this:
> > >
> > > > >     SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter',)
> > >
> > > > > Regards,
> > > > > Matías
> > >
> > > > > Excerpts from coded kid's message of 2012-02-03 12:57:57 -0200:
> > >
> > > > > > Yes, I've tried it. What's the main url you guys put in your
> > > > > > LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
> > > > > > is.
> > >
> > > > > > On Feb 3, 10:46 am, Kevin  wrote:
> > > > > > > Did you take a look at the example project?
> > >
> > > > > > >https://github.com/omab/django-social-auth/tree/master/example
> > >
> > > > > > > Compare it with your own project, or even use this example 
> > > > > > > project as
> > > > > > > a base for your own project.
> > >
> > > > > > > If all your urls.py contains is "url(r'',
> > > > > > > include('social_auth.urls')), " and no other definitions, this 
> > > > > > > could
> > > > > > > be why it redirecting, as it cannot find the URL it's suppose to 
> > > > > > > land
> > > > > > > on.  Check the output in the Windows command window and see what 
> > > > > > > URLs
> > > > > > > are being requested and see if there's anything odd.
> > >
> > > > > > > On Feb 3, 2:12 am, coded kid  wrote:
> > >
> > > > > > > > Just keep getting redirect error. My Api keys are correct. Do 
> > > > > > > > you use
> > > > > > > > the same LOGIN URL with the one above? Whats the main login url 
> > > > > > > > to
> > > > > > > > twitter auth form?
> > >
> > > > > > > > On Feb 2, 5:23 pm, Thorsten Sanders  
> > > > > > > > wrote:
> > >
> > > > > > > > > I took your config and its working fine, maybe your twitter 
> > > > > > > > > api key is
> > > > > > > > > wrong?
> > >
> > > > > > > > > On 02.02.2012 11:22, coded kid wrote:
> > >
> > > > > > > > > > I'm getting a redirect loop error. Whats the probs?
> > >
> > > > > > > > > > On Feb 1, 1:22 pm, Thorsten 
> > > > > > > > > > Sanders  wrote:
> > > > > > > > > >> Some sort of error traceback/description would be helpful, 
> > > > > > > > > >> from a quick
> > > > > > > > > >> look it seems all right.
> > >
> > > > > > > > > >> On 01.02.2012 13:23, coded kid wrote:
> > >
> > > > > > > > > >>> Hey guys, I'm facing a huge  problem with 
> > > > > > > > > >>> omab/django/socialauth.
> > > > > > > > > >>> After setting all the necessary settings, I clicked on 
> > > > > > > > > >>> the Enter
> > > > > > > > > >>> using Twitter link on my homepage, it couldn t redirect 
> > > > > > > > > >>> me to where I
> > > > > > > > > >>> will enter my twitter username and password. Below are my 
> > > > > > > > > >>> settings.
> > > > > > > > > >>> In settings.py
> > > > > > > > > >>> INSTALLED_APPS = (
> > > > > > > > > >>> 'social_auth',
> > > > > > > > > >>> }
> > > > > > > > > >>> TEMPLATE_CONTEXT_PROCESSORS = (
> > > > > > > > > >>>      "django.core.context_process

How to get MacAddress from HttpRequest?

2012-02-05 Thread Hamid Bazzaz
Hello folks,

I would like to get the source MAC address of the incoming HTTP request.
Yet, I don't see such information being available in HttpRequest.META.
dictionary. Does anyone know where I can get the MAC address from?

Thanks very much,
Hamid

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



Re: django.core.handlers.wsgi not found

2012-02-05 Thread BlackKnight
http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives

have you added this in apache conf,


SetHandler wsgi-script
Options ExecCGI




On Feb 5, 5:53 am, "larry.mart...@gmail.com" 
wrote:
> I am trying to deploy my django app on a newly setup CentOS box. I
> have successfully deployed it on ubuntu and on a Mac.
>
> I get these errors in the apache error log:
>
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> (pid=13616): Target WSGI script '/usr/local/myapp/scripts/myapp.wsgi'
> cannot be loaded as Python module.
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] mod_wsgi
> (pid=13616): Exception occurred processing WSGI script '/usr/local/
> myapp/scripts/myapp.wsgi'.
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] Traceback (most
> recent call last):
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]   File "/usr/
> local/myapp/scripts/myapp.wsgi", line 8, in 
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1]     import
> django.core.handlers.wsgi
> [Sat Feb 04 17:43:28 2012] [error] [client 127.0.0.1] ImportError: No
> module named django.core.handlers.wsgi
>
> From command line python the import works:
>
> $ python
> Python 2.6.6 (r266:84292, Dec  7 2011, 20:38:36)
> [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import django.core.handlers.wsgi
>
> I also have this warning in the apache log:
>
> [Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Compiled for Python/2.6.2.
> [Sat Feb 04 17:41:12 2012] [warn] mod_wsgi: Runtime using Python/
> 2.6.6.
>
> I've checked permissions, and wsgi.py and every dir in the path to it
> is 755.
>
> Anyone know why my app isn't finding it?
>
> TIA!
> -larry

-- 
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: Help Me With omab/django-socialauth

2012-02-05 Thread Matías Aguirre
I was just talking about the hyphen in the app name.

Now you need a view on that URL, try a view that renders a template similar to
this one 
https://github.com/omab/django-social-auth/blob/master/example/templates/error.html
that should show the error you have, possible an app misconfiguration.
 
Regards,
Matías

Excerpts from coded kid's message of 2012-02-04 20:12:01 -0200:
> What hypen are you talking about? I've set all the three logins again.
> And after trying it, I was redirected to '/login-error/' Any
> suggestion? Thanks.
>
> On Feb 4, 2:55 pm, Matías Aguirre  wrote:
> > Don't use /login/twitter/ as your LOGIN_URL, the reason behind LOGIN_URL is 
> > to
> > provide a user with a page where it can trigger the login process using a 
> > login
> > form on links in the case of django-social-auth.
> >
> > But if you define its value to /login/twitter/ that will trigger the login
> > process automatically, and if there's an error in the process
> > django-social-auth will redirect to LOGIN_URL too (unless LOGIN_ERROR_URL is
> > defined), and that will trigger the login process again and that might be 
> > the
> > reason for your loop.
> >
> > Regards,
> > Matías
> >
> > Excerpts from coded kid's message of 2012-02-04 12:35:23 -0200:
> >
> >
> >
> > > I've added it, yet no success! I changed my LOGIN_URL to '/login/
> > > twitter/' I'm getting "redirect loop" it means it can't redirect to
> > > the url properly! any help with that?
> >
> > > On Feb 3, 4:14 pm, Matías Aguirre  wrote:
> > > > Django-social-auth (note the hyphen ;)) uses LOGIN_URL as the URL to 
> > > > redirect
> > > > in case of errors if LOGIN_ERROR_URL is not defined, you might be 
> > > > getting an
> > > > error and being redirected to your LOGIN_URL and as your value is
> > > > /login/twitter/ you are restarting the process again.
> >
> > > > Another possible flaw is your SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > > you should add a comma after the value or it won't be a valid tuple, 
> > > > like this:
> >
> > > >     SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter',)
> >
> > > > Regards,
> > > > Matías
> >
> > > > Excerpts from coded kid's message of 2012-02-03 12:57:57 -0200:
> >
> > > > > Yes, I've tried it. What's the main url you guys put in your
> > > > > LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
> > > > > is.
> >
> > > > > On Feb 3, 10:46 am, Kevin  wrote:
> > > > > > Did you take a look at the example project?
> >
> > > > > >https://github.com/omab/django-social-auth/tree/master/example
> >
> > > > > > Compare it with your own project, or even use this example project 
> > > > > > as
> > > > > > a base for your own project.
> >
> > > > > > If all your urls.py contains is "url(r'',
> > > > > > include('social_auth.urls')), " and no other definitions, this could
> > > > > > be why it redirecting, as it cannot find the URL it's suppose to 
> > > > > > land
> > > > > > on.  Check the output in the Windows command window and see what 
> > > > > > URLs
> > > > > > are being requested and see if there's anything odd.
> >
> > > > > > On Feb 3, 2:12 am, coded kid  wrote:
> >
> > > > > > > Just keep getting redirect error. My Api keys are correct. Do you 
> > > > > > > use
> > > > > > > the same LOGIN URL with the one above? Whats the main login url to
> > > > > > > twitter auth form?
> >
> > > > > > > On Feb 2, 5:23 pm, Thorsten Sanders  
> > > > > > > wrote:
> >
> > > > > > > > I took your config and its working fine, maybe your twitter api 
> > > > > > > > key is
> > > > > > > > wrong?
> >
> > > > > > > > On 02.02.2012 11:22, coded kid wrote:
> >
> > > > > > > > > I'm getting a redirect loop error. Whats the probs?
> >
> > > > > > > > > On Feb 1, 1:22 pm, Thorsten Sanders 
> > > > > > > > >  wrote:
> > > > > > > > >> Some sort of error traceback/description would be helpful, 
> > > > > > > > >> from a quick
> > > > > > > > >> look it seems all right.
> >
> > > > > > > > >> On 01.02.2012 13:23, coded kid wrote:
> >
> > > > > > > > >>> Hey guys, I'm facing a huge  problem with 
> > > > > > > > >>> omab/django/socialauth.
> > > > > > > > >>> After setting all the necessary settings, I clicked on the 
> > > > > > > > >>> Enter
> > > > > > > > >>> using Twitter link on my homepage, it couldn t redirect me 
> > > > > > > > >>> to where I
> > > > > > > > >>> will enter my twitter username and password. Below are my 
> > > > > > > > >>> settings.
> > > > > > > > >>> In settings.py
> > > > > > > > >>> INSTALLED_APPS = (
> > > > > > > > >>> 'social_auth',
> > > > > > > > >>> }
> > > > > > > > >>> TEMPLATE_CONTEXT_PROCESSORS = (
> > > > > > > > >>>      "django.core.context_processors.auth",
> > > > > > > > >>>      "django.core.context_processors.debug",
> > > > > > > > >>>      "django.core.context_processors.i18n",
> > > > > > > > >>>      "django.core.context_processors.media",
> > > > > > > > >>>      "django.core.context_processors.static",
> > > > > > > > >>>     "django.contrib.messages.context_processors.m

Re: dynamic permissions

2012-02-05 Thread Denis Darii
It seems that you are looking for a "per object permissions" system, so
take a look at django-guardian: https://github.com/lukaszb/django-guardian

On Sun, Feb 5, 2012 at 3:59 PM, Vittorino Parenti <
vpare...@thundersystems.it> wrote:

> i've a model with document'categories and a model with documents. i
> want set permissions per categories: add invoices, download invoices
> and so on (invoice is an example of category).
> Thanks,
> Vittorino
>
>
> On 5 Feb, 12:21, kenneth gonsalves  wrote:
> > On Sun, 2012-02-05 at 03:02 -0800, Vittorino Parenti wrote:
> > > I would like to create dynamic downloading permissions:
> > > - can download invoices
> > > - can upload invoices
> > > - can download contracts
> >
> > what is dynamic about this?
> > --
> > regards
> > Kenneth Gonsalves
>
> --
> 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.
>
>


-- 
This e-mail and any file transmitted with it is intended only for the
person or entity to which is addressed and may contain information that is
privileged, confidential or otherwise protected from disclosure. Copying,
dissemination or use of this e-mail or the information herein by anyone
other than the intended recipient is prohibited. If you are not the
intended recipient, please notify the sender immediately by return e-mail,
delete this communication and destroy all copies.

-- 
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: dynamic permissions

2012-02-05 Thread Marc Aymerich
On Sun, Feb 5, 2012 at 3:59 PM, Vittorino Parenti
 wrote:
> i've a model with document'categories and a model with documents. i
> want set permissions per categories: add invoices, download invoices
> and so on (invoice is an example of category).
> Thanks,
> Vittorino
>

Did you mean on Django admin? if it, you can search about django admin
granular permissions
-- 
Marc

-- 
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: Filter admin inlines

2012-02-05 Thread Marc Aymerich
On Sun, Feb 5, 2012 at 1:43 PM, NENAD CIKIC  wrote:
> Hello,
> I have three models
> X
> Lang
> Y
> where the purpose of Y is to provide X fields in other languages.
> So I have Y as
> Y
> x foreignkey on X
> lang ForeignKey on Lang
> additionalfields...
>
> I have created the ModelAdmin for Lang. For X I have the ModelAdmin and
> added the
>     inlines = [
>     YInline,
>     ]
>
> So far so good: I have the form of X with inlines for Y with a dropdown on
> languages.
> Now I have extended the user profile as documented in django docs. I have
> succesfully overriden the queryset method ot he LangModelAdmin so to filter
> on some user profile additinal information.
> The problem is that I can not filter the inlines; i.e. I want that every
> user has its owns languages and thus I want to see in X form the language
> dropdown filled with only certain languages. Instead all languages are
> listed there.
> I have searched a bit and it seems a common problem,but without solution.
> Am I missing something simple?
> Thanks
>

As far as I can remember there is no method to overide on admin inline
class in order to queryset filtering. But admin inline classes
provides a form attribut that let you to specify what form to use, so
I think the way to go is providing a custom inline form that performs
the queryset filtering, just like this:
http://stackoverflow.com/questions/2581049/filter-queryset-in-django-inlineformset-factory

-- 
Marc

-- 
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: dynamic permissions

2012-02-05 Thread Vittorino Parenti
i've a model with document'categories and a model with documents. i
want set permissions per categories: add invoices, download invoices
and so on (invoice is an example of category).
Thanks,
Vittorino


On 5 Feb, 12:21, kenneth gonsalves  wrote:
> On Sun, 2012-02-05 at 03:02 -0800, Vittorino Parenti wrote:
> > I would like to create dynamic downloading permissions:
> > - can download invoices
> > - can upload invoices
> > - can download contracts
>
> what is dynamic about this?
> --
> regards
> Kenneth Gonsalves

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



Filter admin inlines

2012-02-05 Thread NENAD CIKIC
Hello,
I have three models
X
Lang
Y
where the purpose of Y is to provide X fields in other languages.
So I have Y as
Y
x foreignkey on X
lang ForeignKey on Lang
additionalfields...

I have created the ModelAdmin for Lang. For X I have the ModelAdmin and 
added the 
inlines = [
YInline,
]

So far so good: I have the form of X with inlines for Y with a dropdown on 
languages.
Now I have extended the user profile as documented in django docs. I have 
succesfully overriden the queryset method ot he LangModelAdmin so to filter 
on some user profile additinal information.
The problem is that I can not filter the inlines; i.e. I want that every 
user has its owns languages and thus I want to see in X form the language 
dropdown filled with only certain languages. Instead all languages are 
listed there.
I have searched a bit and it seems a common problem,but without solution. 
Am I missing something simple?
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/-/0yuP4riqekcJ.
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 Friends

2012-02-05 Thread coded kid
The app is not well maintained. And no docs in it. Do you know how I
can go about it?

On Feb 5, 9:56 am, Anoop Thomas Mathew  wrote:
> Hi,
> Pinax is a collection of reusable django apps, and you an use individual
> projects as django apps.https://github.com/pinax/django-friends
> Another issue I found is, it is not maintained well and make sure that it
> suits your purpose and works well with latest version of django. Then you
> can directly use it as an app adding it to your settings.py
>
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.
>
> On 5 February 2012 15:18, coded kid  wrote:
>
>
>
> > Thanks bro. I'm not using pinax, so how can I go about it?

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



Re: dynamic permissions

2012-02-05 Thread kenneth gonsalves
On Sun, 2012-02-05 at 03:02 -0800, Vittorino Parenti wrote:
> I would like to create dynamic downloading permissions:
> - can download invoices
> - can upload invoices
> - can download contracts 

what is dynamic about this?
-- 
regards
Kenneth Gonsalves

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



dynamic permissions

2012-02-05 Thread Vittorino Parenti
Hi,
I have an application 'documents' where documents are stored according
to categories:
'invoices', 'contracts', 'orders', 'etc'.
I would like to create dynamic downloading permissions:
- can download invoices
- can upload invoices
- can download contracts
and so on
Thanks,
Vittorino

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



Re: Using redis in django views

2012-02-05 Thread Ashe
Hello,

The main reason for my issue, was because I was using two tabs on my
browser. If I use two browsers or two different IP, my code works
asynchronously (with gevent and apache, not with runserver but this
isn't a surprise).

I think there is something like: if a unique session asks for the same
view multiple times, they are served synchronously. I don't know if
it's due to the server or django. I can't find anything like that on
the documentation. If anyone knows, I would be really interested to
understand that last part.

--
Ashe

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



Re: Django Friends

2012-02-05 Thread Anoop Thomas Mathew
Hi,
Pinax is a collection of reusable django apps, and you an use individual
projects as django apps.
https://github.com/pinax/django-friends
Another issue I found is, it is not maintained well and make sure that it
suits your purpose and works well with latest version of django. Then you
can directly use it as an app adding it to your settings.py

Thanks,
Anoop Thomas Mathew


atm
___
Life is short, Live it hard.




On 5 February 2012 15:18, coded kid  wrote:

> Thanks bro. I'm not using pinax, so how can I go about it?

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



Re: Django Friends

2012-02-05 Thread coded kid
Thanks bro. I'm not using pinax, so how can I go about it?

On Feb 5, 8:47 am, Anoop Thomas Mathew  wrote:
> Hi,
>
> Check pinax project. There are some apps in 
> it,http://pinaxproject.com/ecosystem/
> ,  especially, django-friends app, which should be helpful for you.
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.
>
> On 5 February 2012 14:12, coded kid  wrote:
>
>
>
> > Hey guys, please do you know of any django package that can be used by
> > users to add friends in django site? 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.

-- 
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: Views in django

2012-02-05 Thread Sandeep kaur
On Sun, Feb 5, 2012 at 1:33 AM, Peter of the Norse
 wrote:
> You should look into making a foreign key relationship if there actually is 
> one. That way you can just annotate the the sums.

Opted for the same now.

> Otherwise you should calculate the sum in the view (NOT the template) and add 
> it to the client. Python allows you to add any value you >want to any object.
>
Thank you for your suggestions. :-)



-- 
Sandeep Kaur
E-Mail: mkaurkha...@gmail.com
Blog: sandymadaan.wordpress.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: Django Friends

2012-02-05 Thread Anoop Thomas Mathew
Hi,

Check pinax project. There are some apps in it,
http://pinaxproject.com/ecosystem/
,  especially, django-friends app, which should be helpful for you.
Thanks,
Anoop Thomas Mathew


atm
___
Life is short, Live it hard.




On 5 February 2012 14:12, coded kid  wrote:

> Hey guys, please do you know of any django package that can be used by
> users to add friends in django site? 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.
>
>

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

2012-02-05 Thread coded kid
Hey guys, please do you know of any django package that can be used by
users to add friends in django site? 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.