Re: Django Server impacts path-rules ???

2012-02-04 Thread doniyor
now i created a folder named static and put all my media resource
there.

the change is here:
-- transfer
 -- contact (das ist app)
 -- __init__
 -- models.py
 -- tests.py
 -- views.py
 -- static
 -- js
 -- images
 -- css
 -- template
 -- index.html
 -- transfer
 -- __init__
 -- settings.py
 -- urls.py
 -- wsgi.py



On 5 Feb., 06:02, doniyor  wrote:
> can you please take a look, here is my 
> settings.py.http://pastebin.com/GSUb2k2e
> thanks
>
> On 5 Feb., 05:58, doniyor  wrote:
>
>
>
>
>
>
>
> > yes, but here you see:
> > For local development, if you are using runserver or adding
> > staticfiles_urlpatterns to your URLconf, you’re done with the setup –
> > your static files will automatically be served at the default (for
> > newly created projects) STATIC_URL of /static/.
>
> > On 4 Feb., 19:58, Daniel Roseman  wrote:
>
> > > On Saturday, 4 February 2012 18:48:08 UTC, doniyor wrote:
>
> > > > Hi everyone,
>
> > > > i have a small problem which makes me worry. i have a normal html file
> > > > with fotos to see in. and i have created a project and started the
> > > > server with "manage.py runserver". this is the point! :
>
> > > > if i open the html file just normal from the folder by doubleclick,
> > > > the browser shows the page very perfectly with fotos and so. just as
> > > > normal..
>
> > > > but my problem is that if i start the server and open the index.html
> > > > in my 127.0.0.1:8000, i see only text and no fotos are there. fotos
> > > > are even not downloadable, so the media resource is not reachable, but
> > > > why ? from the folder it finds the resources but not in
> > > > 127.0.0.1:8000.
>
> > > > i will give my actual case here:
>
> > > > this is the project hierarchie i have:
>
> > > > -- transfer
> > > >  -- contact (das ist app)
> > > >      -- __init__
> > > >      -- models.py
> > > >      -- tests.py
> > > >      -- views.py
> > > >  -- media
> > > >      -- js
> > > >      -- images
> > > >      -- css
> > > >  -- template
> > > >      -- index.html
> > > >  -- transfer
> > > >      -- __init__
> > > >      -- settings.py
> > > >      -- urls.py
> > > >      -- wsgi.py
>
> > > >   and how i give the src path in my index.html is here:
> > > >  > > > media="all">
>
> > > > can you please help me with that, is it possible that django 1.4 looks
> > > > for path differently from last ones.. ?
>
> > > > thanks
> > > > doni
>
> > > Have you set anything up to serve media and images? Have you looked at the
> > > documentation on how to do that?
> > >  https://docs.djangoproject.com/en/1.3/howto/static-files/
> > > --
> > > DR.

-- 
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-04 Thread Ashe
Hello,

I just tried with django-redis by using redis as a cache.

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': '/tmp/vgbet_redis.sock',
        'OPTIONS': {
            'DB': 1,
            'PASSWORD': None,
            'PARSER_CLASS': 'redis.connection.HiredisParser'
        },
    },
}

And I still have the same result if I open two tabs in my browser. The
second view is blocked for 5 seconds, as if everything is synchronous.

from django.core.cache import cache
def test_view(request):
if cache.get('test') != None:
print 'Locked'
else:
cache.set('test', '', 60)
for i in range(5):
print '%i locked' % i
time.sleep(1)
cache.delete('test')
return render_to_response("test.html", {
}, context_instance=RequestContext(request))

If I open two terminals, I have no issue reading and writing in redis.
So I really don't understand why I'm not able to use the cache in
views.

Regards,

--
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 Server impacts path-rules ???

2012-02-04 Thread doniyor
can you please take a look, here is my settings.py.
http://pastebin.com/GSUb2k2e
thanks

On 5 Feb., 05:58, doniyor  wrote:
> yes, but here you see:
> For local development, if you are using runserver or adding
> staticfiles_urlpatterns to your URLconf, you’re done with the setup –
> your static files will automatically be served at the default (for
> newly created projects) STATIC_URL of /static/.
>
> On 4 Feb., 19:58, Daniel Roseman  wrote:
>
>
>
>
>
>
>
> > On Saturday, 4 February 2012 18:48:08 UTC, doniyor wrote:
>
> > > Hi everyone,
>
> > > i have a small problem which makes me worry. i have a normal html file
> > > with fotos to see in. and i have created a project and started the
> > > server with "manage.py runserver". this is the point! :
>
> > > if i open the html file just normal from the folder by doubleclick,
> > > the browser shows the page very perfectly with fotos and so. just as
> > > normal..
>
> > > but my problem is that if i start the server and open the index.html
> > > in my 127.0.0.1:8000, i see only text and no fotos are there. fotos
> > > are even not downloadable, so the media resource is not reachable, but
> > > why ? from the folder it finds the resources but not in
> > > 127.0.0.1:8000.
>
> > > i will give my actual case here:
>
> > > this is the project hierarchie i have:
>
> > > -- transfer
> > >  -- contact (das ist app)
> > >      -- __init__
> > >      -- models.py
> > >      -- tests.py
> > >      -- views.py
> > >  -- media
> > >      -- js
> > >      -- images
> > >      -- css
> > >  -- template
> > >      -- index.html
> > >  -- transfer
> > >      -- __init__
> > >      -- settings.py
> > >      -- urls.py
> > >      -- wsgi.py
>
> > >   and how i give the src path in my index.html is here:
> > >  > > media="all">
>
> > > can you please help me with that, is it possible that django 1.4 looks
> > > for path differently from last ones.. ?
>
> > > thanks
> > > doni
>
> > Have you set anything up to serve media and images? Have you looked at the
> > documentation on how to do that?
> >  https://docs.djangoproject.com/en/1.3/howto/static-files/
> > --
> > DR.

-- 
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 Server impacts path-rules ???

2012-02-04 Thread doniyor
yes, but here you see:
For local development, if you are using runserver or adding
staticfiles_urlpatterns to your URLconf, you’re done with the setup –
your static files will automatically be served at the default (for
newly created projects) STATIC_URL of /static/.



On 4 Feb., 19:58, Daniel Roseman  wrote:
> On Saturday, 4 February 2012 18:48:08 UTC, doniyor wrote:
>
> > Hi everyone,
>
> > i have a small problem which makes me worry. i have a normal html file
> > with fotos to see in. and i have created a project and started the
> > server with "manage.py runserver". this is the point! :
>
> > if i open the html file just normal from the folder by doubleclick,
> > the browser shows the page very perfectly with fotos and so. just as
> > normal..
>
> > but my problem is that if i start the server and open the index.html
> > in my 127.0.0.1:8000, i see only text and no fotos are there. fotos
> > are even not downloadable, so the media resource is not reachable, but
> > why ? from the folder it finds the resources but not in
> > 127.0.0.1:8000.
>
> > i will give my actual case here:
>
> > this is the project hierarchie i have:
>
> > -- transfer
> >  -- contact (das ist app)
> >      -- __init__
> >      -- models.py
> >      -- tests.py
> >      -- views.py
> >  -- media
> >      -- js
> >      -- images
> >      -- css
> >  -- template
> >      -- index.html
> >  -- transfer
> >      -- __init__
> >      -- settings.py
> >      -- urls.py
> >      -- wsgi.py
>
> >   and how i give the src path in my index.html is here:
> >  > media="all">
>
> > can you please help me with that, is it possible that django 1.4 looks
> > for path differently from last ones.. ?
>
> > thanks
> > doni
>
> Have you set anything up to serve media and images? Have you looked at the
> documentation on how to do that?
>  https://docs.djangoproject.com/en/1.3/howto/static-files/
> --
> DR.

-- 
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-04 Thread Brett Epps
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.

How was Django installed originally?

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.



Using redis in django views

2012-02-04 Thread Ashe
Hello,

I'm trying to use redis (with redis-py) directly on some of my
critical views to lock them.
A simple version of the code could look like that :

def test_view(request):
--connec = redis.Redis(unix_socket_path='/tmp/vgbet_redis.sock')
--if connec.exists('test'):
print 'Already locked'
--else:
connec.set('test', '')
for i in range(20):
--print '%i locked' % i
--time.sleep(1)
connec.delete('test')
--return render_to_response("test.html", {},
context_instance=RequestContext(request))

The result of this code is very strange for me.
If I open two tabs of that view, the first view counts until 20 before
its template is displayed, then the second view starts counting. I was
expecting the second view to print just 'Already locked'.

I don't understand what I'm doing wrongly. Any help would be great.

Regards,

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



Error setting up Admin

2012-02-04 Thread Abhiram
For some reason i am not able to get the 'admin' page to work. My media
root is '/var/www/media' . The error it gave was " '/var/www/media/admin'
not found". Then i copied the admin folder from django.contrib to
/var/www/media, and then the new error is "Directory Indexes are not
allowed here". What could be the problem?

-- 
Abhiram R
II yr Undergraduate Student
Dept. of Computer Science and Engineering
IIT Madras

-- 
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.core.handlers.wsgi not found

2012-02-04 Thread larry.mart...@gmail.com
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 Development environment

2012-02-04 Thread CLIFFORD ILKAY

On 02/04/2012 09:48 AM, Vikas Ruhil wrote:

If you used Pydev and Textmate , eclipse for Django ! so now You forget
them

[snip]

I used to have a strong bias against PyDev because it was based on 
Eclipse, something which I used to view as another bloated piece of Java 
software. I read a blog post about Mylyn and watched a screencast by the 
creator of Mylyn, Mik Kersten here: 
, I was 
compelled to give Mylyn a chance. Using the Eclipse/PyDev/Mylyn 
combination has made a believer out of me. I have my IDE integrated with 
Trac, which we use for ticketing, and I can preserve and restore the 
context on a given ticket. On small and simple projects, none of this 
matters very much. On more complex projects, particularly if there are 
multiple collaborators on the project, it makes a difference. I like 
being able to restore my working context on issues I've been working on 
in a matter of seconds. It's even better if I can restore the working 
context of what my colleagues have been working on. There is much more 
to it than what I've described. If there was another tool that could do 
what I can with this combination, I'd certainly consider it but I 
haven't seen one, yet. Note: I like and use vim, too. It's just not even 
close to what I would call an "IDE".

--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6


+1 416-410-3326

--
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: auth groups puzzle

2012-02-04 Thread Mike Dewhirst

Dennis and Dan

It does look like more work than can be justified at the moment. And, I 
have difficulty seeing a business case for reinventing 
django-auth-groups. I really hate the idea of individual permissions but 
that would be a possible interim workaround until a case can be made. I 
have moved on from this to other conundrums for now.


Thank you both for your responses. They confirm my original thought that 
the simpler approach will suffice for the time being.


Cheers

Mike


On 5/02/2012 12:13am, Dan Gentry wrote:

I've solved this problem in an app, but not with the built-in
permissions system.  Instead, I created a DB structure that links
users to companies and stores the r/w status for each.

On Feb 3, 12:58 am, Mike Dewhirst  wrote:

I want to use the built-in auth_groups permissions system in a
many-to-many sense but can't quite figure it out for my use case. Any
help will be appreciated.

The use case is: users have different types of access (r/o, r/w or
admin) to different companies. Any single user can have r/o access to
company-1, r/w access to company-2 and admin access to company-3 and so
on. Any company can have relationships with many users each of whom will
have one of the r/o, r/w or admin group permissions.

So there has to be a many-to-many relationship between user and company
and the group needs to be specified in that relationship table rather
than in the auth_user_groups table - where it currently sits.

How do I invoke a different set of permissions depending on the name of
the group established in the user-company relationship table when a user
is accessing that company's data?

A side question is how do I remove the displayed Groups in the Django
Admin auth/user display?

Thanks

Mike

On 4/02/2012 3:20am, Dennis Lee Bieber wrote:

On Fri, 03 Feb 2012 17:21:47 +1100, Mike Dewhirst
  wrote:


I'm going to simplify the use case and live with users being in the same
group for all companies. This is only a prototype. If a demand arises in
production I'll worry about it then.

Sorry to bother you


If the users were logging into the database itself, I'd probably
have tried to set up the database authorization to provide the
restrictions -- but that would require massive DBA interaction to set up
each user vs company (especially since I suspect "company" incorporates
multiple relations [tables]).

In lieu of that, the brute force approach would be to wrap all
database operations with authorization tests. You don't mention if there
is a possibility for a user to have /no/ access to any given company
(that would complicate matters -- if everyone has read access, you'd
only need to wrap insert/update/delete and admin functions.

Don't know if Django's native database interface can support it (nor
if some RDBM engines could...) but I'm seeing, in raw SQL, something
where a WHERE clause invokes a subselect (I'd have to experiment to get
the proper syntax -- all my books are still in storage)



--
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: I need a package.

2012-02-04 Thread coded kid
Thanks so much! Any idea on how I can make user_messages/
thread_detail.html work? Just give me an idea on how to go about the
template.

On Feb 3, 8:17 am, Donald Stufft  wrote:
> https://github.com/eldarion/user_messages
>
>
>
> On Friday, February 3, 2012 at 3:16 AM, coded kid wrote:
> > Anyone knows about a django package that can be use by users to send
> > private messages to each other?

-- 
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-04 Thread coded kid
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.messages",
> > > > > > > >>>     "django.core.context_processors.request",
> > > > > > > >>>      
> > > > > > > >>> social_auth.context_processors.social_auth_by_type_backends ,
> > > > > > > >>> )
> > > > > > > >>> AUTHENTICATION_BACKENDS = (
> > > > > > > >>>      'social_auth.backends.twitter.TwitterBackend',
> > > > > > > >>>     'django.contrib.auth.backends.ModelBackend',
> > > > > > > >>> )
> > > > > > > >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > > > > > >>> 

Re: Views in django

2012-02-04 Thread Peter of the Norse
You should look into making a foreign key relationship if there actually is 
one. That way you can just annotate the the sums. 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.

On Feb 3, 2012, at 7:38 AM, Sandeep kaur wrote:

> On Fri, Feb 3, 2012 at 7:52 PM, Weldan  wrote:
>> Entries.objects.count()
>> 
> That will be applicable if I want to his for only 1 table's entry.
> But here I have views as :
> 
>   cd = form.cleaned_data
>name_and_address = cd['name_and_address']
>title = get_object_or_404(Variable, pk='1')
>   sign = get_object_or_404(Variable, pk='3')
>from TCC11_12.automation.choices import *
>client =
> ClientJob.objects.filter(name_and_address=name_and_address)
>amount = Amount.objects.all()
>suspence = Suspence.objects.all()
> 
> and for this I have template as :
> 
>   {% if client %}
>{% for clients in client %}
>{% for amounts in amount %}
> 
> {% if clients.job_no == amounts.job_no %}
> 
> {% if clients.name_and_address == clients.name_and_address %}
> 
>   {{ clients.receipt_no }}
>{{ clients.date }}
>{{amounts.total}}
>   {{amounts.net_total}}
>   {% endif  %}
> 
>{% endif  %}
>   
>{% endfor %}
> 
>{% endfor %}
> {% endif %}
> 
> 
> When all this is applied, it creates a view out of 2 tables i.e Amount
> and ClientJob without using foreign key. Now I want to have sum of the
> total and net_total fields for the views generated.

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: VIM as Modern Python/Dajngo IDE

2012-02-04 Thread David Markey
It looks like most of this could be scripted to be made automatic..

On 4 February 2012 19:31, yati sagade  wrote:

> Seriously dude, I think you should go about making a video of this.
>
>
> On Sun, Feb 5, 2012 at 12:56 AM, Vikas Ruhil wrote:
>
>>
>> Now working on graphics and how use all this content efficiently ,try to
>> make graphics those can give basic to advance understanding to the
>> Python/Django users.Really Good response this post is breaking records for
>> m .Keep Switch there More are coming
>>
>> On Sun, Feb 5, 2012 at 12:29 AM, yati sagade wrote:
>>
>>> Hi Vikash
>>> Appreciate the heads up! Why don't you share this link on G+ and other
>>> social media - Even I'll share with my friends - I haven't tried all of it
>>> yet, but it looks good. kudos man, Good Job! Keep it up :)
>>>
>>> Yati Sagade
>>>
>>> On Sat, Feb 4, 2012 at 5:33 PM, Vikas Ruhil wrote:
>>>
 I write a Blog about VIM as a Python/Dajngo Modern IDE .There are about
 15 Plugin and config of there is on post . I am looking for plugin
 suggestion for more .

 Also for newbie and Non-vim user's there is request  to checkout the
 post.Those Guys who ask what IDE should they need use or Which is Best IDE
 for Python/Django.


 http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html

 Regards
 Vikash Ruhil

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

>>>
>>>
>>>
>>> --
>>> Yati Sagade 
>>>
>>> (@yati_itay )
>>>
>>>
>>>  --
>>> 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.
>>>
>>
>>
>>
>> Regards
>> Vikash Ruhil
>>
>> --
>> 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.
>>
>
>
>
> --
> Yati Sagade 
>
> (@yati_itay )
>
>
>  --
> 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: VIM as Modern Python/Dajngo IDE

2012-02-04 Thread yati sagade
Seriously dude, I think you should go about making a video of this.

On Sun, Feb 5, 2012 at 12:56 AM, Vikas Ruhil  wrote:

>
> Now working on graphics and how use all this content efficiently ,try to
> make graphics those can give basic to advance understanding to the
> Python/Django users.Really Good response this post is breaking records for
> m .Keep Switch there More are coming
>
> On Sun, Feb 5, 2012 at 12:29 AM, yati sagade wrote:
>
>> Hi Vikash
>> Appreciate the heads up! Why don't you share this link on G+ and other
>> social media - Even I'll share with my friends - I haven't tried all of it
>> yet, but it looks good. kudos man, Good Job! Keep it up :)
>>
>> Yati Sagade
>>
>> On Sat, Feb 4, 2012 at 5:33 PM, Vikas Ruhil wrote:
>>
>>> I write a Blog about VIM as a Python/Dajngo Modern IDE .There are about
>>> 15 Plugin and config of there is on post . I am looking for plugin
>>> suggestion for more .
>>>
>>> Also for newbie and Non-vim user's there is request  to checkout the
>>> post.Those Guys who ask what IDE should they need use or Which is Best IDE
>>> for Python/Django.
>>>
>>> http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html
>>>
>>> Regards
>>> Vikash Ruhil
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Yati Sagade 
>>
>> (@yati_itay )
>>
>>
>>  --
>> 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.
>>
>
>
>
> Regards
> Vikash Ruhil
>
> --
> 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.
>



-- 
Yati Sagade 

(@yati_itay )

-- 
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: VIM as Modern Python/Dajngo IDE

2012-02-04 Thread Vikas Ruhil
Now working on graphics and how use all this content efficiently ,try to
make graphics those can give basic to advance understanding to the
Python/Django users.Really Good response this post is breaking records for
m .Keep Switch there More are coming

On Sun, Feb 5, 2012 at 12:29 AM, yati sagade  wrote:

> Hi Vikash
> Appreciate the heads up! Why don't you share this link on G+ and other
> social media - Even I'll share with my friends - I haven't tried all of it
> yet, but it looks good. kudos man, Good Job! Keep it up :)
>
> Yati Sagade
>
> On Sat, Feb 4, 2012 at 5:33 PM, Vikas Ruhil wrote:
>
>> I write a Blog about VIM as a Python/Dajngo Modern IDE .There are about
>> 15 Plugin and config of there is on post . I am looking for plugin
>> suggestion for more .
>>
>> Also for newbie and Non-vim user's there is request  to checkout the
>> post.Those Guys who ask what IDE should they need use or Which is Best IDE
>> for Python/Django.
>>
>> http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html
>>
>> Regards
>> Vikash Ruhil
>>
>> --
>> 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.
>>
>
>
>
> --
> Yati Sagade 
>
> (@yati_itay )
>
>
>  --
> 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.
>



Regards
Vikash Ruhil

-- 
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: VIM as Modern Python/Dajngo IDE

2012-02-04 Thread yati sagade
Hi Vikash
Appreciate the heads up! Why don't you share this link on G+ and other
social media - Even I'll share with my friends - I haven't tried all of it
yet, but it looks good. kudos man, Good Job! Keep it up :)

Yati Sagade

On Sat, Feb 4, 2012 at 5:33 PM, Vikas Ruhil  wrote:

> I write a Blog about VIM as a Python/Dajngo Modern IDE .There are about 15
> Plugin and config of there is on post . I am looking for plugin suggestion
> for more .
>
> Also for newbie and Non-vim user's there is request  to checkout the
> post.Those Guys who ask what IDE should they need use or Which is Best IDE
> for Python/Django.
>
> http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html
>
> Regards
> Vikash Ruhil
>
> --
> 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.
>



-- 
Yati Sagade 

(@yati_itay )

-- 
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 Server impacts path-rules ???

2012-02-04 Thread Daniel Roseman
On Saturday, 4 February 2012 18:48:08 UTC, doniyor wrote:
>
> Hi everyone, 
>
> i have a small problem which makes me worry. i have a normal html file 
> with fotos to see in. and i have created a project and started the 
> server with "manage.py runserver". this is the point! : 
>
> if i open the html file just normal from the folder by doubleclick, 
> the browser shows the page very perfectly with fotos and so. just as 
> normal.. 
>
> but my problem is that if i start the server and open the index.html 
> in my 127.0.0.1:8000, i see only text and no fotos are there. fotos 
> are even not downloadable, so the media resource is not reachable, but 
> why ? from the folder it finds the resources but not in 
> 127.0.0.1:8000. 
>
> i will give my actual case here: 
>
> this is the project hierarchie i have: 
>
> -- transfer 
>  -- contact (das ist app) 
>  -- __init__ 
>  -- models.py 
>  -- tests.py 
>  -- views.py 
>  -- media 
>  -- js 
>  -- images 
>  -- css 
>  -- template 
>  -- index.html 
>  -- transfer 
>  -- __init__ 
>  -- settings.py 
>  -- urls.py 
>  -- wsgi.py 
>
>   and how i give the src path in my index.html is here: 
>  media="all"> 
>
> can you please help me with that, is it possible that django 1.4 looks 
> for path differently from last ones.. ? 
>
> thanks 
> doni


Have you set anything up to serve media and images? Have you looked at the 
documentation on how to do that?
 https://docs.djangoproject.com/en/1.3/howto/static-files/
--
DR.

-- 
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/-/7LvN1CvrkYIJ.
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 Server impacts path-rules ???

2012-02-04 Thread doniyor
Hi everyone,

i have a small problem which makes me worry. i have a normal html file
with fotos to see in. and i have created a project and started the
server with "manage.py runserver". this is the point! :

if i open the html file just normal from the folder by doubleclick,
the browser shows the page very perfectly with fotos and so. just as
normal..

but my problem is that if i start the server and open the index.html
in my 127.0.0.1:8000, i see only text and no fotos are there. fotos
are even not downloadable, so the media resource is not reachable, but
why ? from the folder it finds the resources but not in
127.0.0.1:8000.

i will give my actual case here:

this is the project hierarchie i have:

-- transfer
 -- contact (das ist app)
 -- __init__
 -- models.py
 -- tests.py
 -- views.py
 -- media
 -- js
 -- images
 -- css
 -- template
 -- index.html
 -- transfer
 -- __init__
 -- settings.py
 -- urls.py
 -- wsgi.py

  and how i give the src path in my index.html is here:


can you please help me with that, is it possible that django 1.4 looks
for path differently from last ones.. ?

thanks
doni

-- 
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: problem with localization

2012-02-04 Thread Vittorino Parenti
Dear Denis,
in the model I would simply calculate the value and not how it is
displayed in admin interface.
I thought there was an easy way to format the function result as
already done for the fields in the model.
Thank you.
Vittorino.

On 4 Feb, 15:26, Denis Darii  wrote:
> Vittorino, this is not related to your initial question and you must
> consider that the format() returns always a string. And why do you use
> format() in total_no_vat()?
>
> I would separate the "total":
>
> ...
>      def total_no_vat(self):
>         return self.total_income + self.total_fee
>
>      def total(self):
>          return self.total_no_vat() * 1.21
>
>      def formatted_total(self):
>          return format(self.total(), settings.DECIMAL_SEPARATOR, 2)
>
> now you can use formatted_total in your list_display
> Denis.
>
> On Sat, Feb 4, 2012 at 2:40 PM, Vittorino Parenti <
>
>
>
>
>
>
>
> vpare...@thundersystems.it> wrote:
> > Hi,
> > I think this is not the solution.
> > I do another example:
>
> > MODEL
> > 
> > class Procedure(models.Model):
> >      
> >      total_income = models.DecimalField (
> >        default = 0,
> >        max_digits = 11,
> >        decimal_places = 4,
> >        verbose_name = _("Total Income"),
> >      )
> >      total_fee = models.DecimalField (
> >        default = 0,
> >        max_digits = 11,
> >        decimal_places = 4,
> >        verbose_name = _("Total Fee"),
> >      )
> >      
> >       def total_no_vat(self):
> >         total_no_vat -no= self.total_income + self.total_fee
> >         return format(total_no_vat, settings.DECIMAL_SEPARATOR, 2)
>
> >      def total(self):
> >          total = self.total_no_vat() * 1.21
> >          return format(total, settings.DECIMAL_SEPARATOR, 2)
>
> > type of self.total_no_vat is unicode and I cannot do other operations
> > on this field.
> > Thanks,
> > Vittorino
>
> > On 4 Feb, 10:15, Denis Darii  wrote:
> > > Hi Vittorino, this is happen because the model fields are automatically
> > > formatted by django considering your settings.DECIMAL_SEPARATOR, but in
> > > your total() you're simply return the sum of two Decimal()
>
> > > To solve this you can import format and pass the result of total() to it
> > > like:
>
> > > from django.conf import settings
> > > from django.utils.numberformat import format
> > > ...
> > >      def total(self):
> > >         total = self.total_income + self.total_fee
> > >         return format(total, settings.DECIMAL_SEPARATOR, 2)
>
> > > hope it helps! Have a nice weekend!
> > > Denis.
>
> > > On Sat, Feb 4, 2012 at 9:52 AM, Vittorino Parenti <
>
> > > vpare...@thundersystems.it> wrote:
> > > > Hello,
> > > > i've a problem with number format localization. This is an example of
> > > > my model and admin:
>
> > > > MODEL
> > > > 
> > > > class Procedure(models.Model):
> > > >      
> > > >      total_income = models.DecimalField (
> > > >        default = 0,
> > > >        max_digits = 11,
> > > >        decimal_places = 4,
> > > >        verbose_name = _("Total Income"),
> > > >      )
> > > >      total_fee = models.DecimalField (
> > > >        default = 0,
> > > >        max_digits = 11,
> > > >        decimal_places = 4,
> > > >        verbose_name = _("Total Fee"),
> > > >      )
> > > >      
> > > >      def total(self):
> > > >         return self.total_income + self.total_fee
>
> > > > ADMIN
> > > > ---
> > > > class ProcedureAdmin(dmin.ModelAdmin):
> > > >      list_display = (..., 'total_income', 'total_fee', 'total', ...)
>
> > > > output is:
>
> > > > ... | 35,22 | 9,28 | 45.50 | ...
>
> > > > with comma in first two cases and dot then.
> > > > How can I do?
> > > > Thanks in advance,
> > > > 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.
>
> > --
> > 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: Is there a simple way to write the site root as a variable clientside

2012-02-04 Thread Denis Darii
I'm not sure I fully understand your questions, but I think you need to
know more about the stupend "sites" framework:
https://docs.djangoproject.com/en/dev/ref/contrib/sites/

On Sat, Feb 4, 2012 at 5:13 PM, Jason <1jason.whatf...@gmail.com> wrote:

> Hi there,
>
> Is there a simple way to write the site root as a variable clientside?
> i.e. if I'm running locally the site root var with appear clientside as
> http://localhost:1010 however if I deploy the root will be
> http://www.mysite.com?
>
> Cheers,
> J
>
> --
> 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/-/lDnCch_r3lAJ.
> 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.



Is there a simple way to write the site root as a variable clientside

2012-02-04 Thread Jason
Hi there,

Is there a simple way to write the site root as a variable clientside? i.e. 
if I'm running locally the site root var with appear clientside as 
http://localhost:1010 however if I deploy the root will be 
http://www.mysite.com?

Cheers,
J

-- 
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/-/lDnCch_r3lAJ.
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-04 Thread Matías Aguirre
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.messages",
> > > > > > >>>     "django.core.context_processors.request",
> > > > > > >>>      
> > > > > > >>> social_auth.context_processors.social_auth_by_type_backends ,
> > > > > > >>> )
> > > > > > >>> AUTHENTICATION_BACKENDS = (
> > > > > > >>>      'social_auth.backends.twitter.TwitterBackend',
> > > > > > >>>     'django.contrib.auth.backends.ModelBackend',
> > > > > > >>> )
> > > > > > >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > > > > >>> TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> > > > > > >>> TWITTER_CONSUMER_SECRET      = 'YyNngsgw[1jw 
> > > > > > >>> lcllcleleedfejewjuw'
> > > > > > >>> LOGIN_URL = '/accounts/login/' #login form for users to log in 
> > > > > > >>> with
> > > > > > >>> their username and password!
> > > > > > >>> SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
> > > > > > >>> authenticated
> > > 

Re: Django Development environment

2012-02-04 Thread Vikas Ruhil
If you used Pydev and Textmate , eclipse for Django ! so now You forget
them
My environment is  Ubuntu+vim+Virutalenv+firefox(with vim) +Firebug.
I bully on vim , also proof that is better then the Textmate and Pydev
 that is here
http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html

On Wed, Aug 31, 2011 at 6:18 PM, Jani Tiainen  wrote:

> On 08/31/2011 01:46 PM, graeme wrote:
>
>>
>>
>> On Aug 31, 1:16 pm, Jani Tiainen  wrote:
>>
>>> On 08/28/2011 12:31 PM, Simon Connah wrote:
>>>
>>>
>>>
>>>  On 28 Aug 2011, at 04:41, Sam Walters wrote:

>>>
>>>  Debug client-side:
> firebug, yslow, a windows computer with ie7
>

>>>  Rather than using a separate computer with IE 7 I tend to just spin up
 an Amazon EC2 instance running Windows Server 2003 or Windows Server 2008
 for a couple of hours. It makes everything so much easier when it comes to
 testing.

>>>
>>> Or you can always download "Internet Explorer Application Compatibility
>>> VPC Image" [1] images from Microsoft directly.
>>>
>>> (there are IE6 - IE9 images available) for testing websites. Very useful
>>> with VirtualBox.
>>>
>>> [1]http://www.microsoft.com/**download/en/details.aspx?id=**11575
>>>
>>
>> I thought it took a bit of work to get those VPC images to work with
>> VirtualBox. The last time I looked they were tied to Virtual PC
>> (virtual) hardware, and had activation issues with VirtualBox. Has
>> that changed?
>>
>>
> VirtualBox 4.1 in Ubuntu
>
> Just downloaded image parts, extracted multipart rar package. Then comes
> the tricky part:
>
> When creating new VM you trick is to attach VHD image as an IDE drive, not
> SATA (Defautl creation attaches image as SATA). And of course you don't try
> to activate it but that's enough for testing.
>
>
> --
>
> Jani Tiainen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>


Regards
Vikash Ruhil

-- 
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: Checklist for appreciating a project from 1.2.7 to 1.4a1

2012-02-04 Thread akaariai
On Feb 4, 9:09 am, Alec Taylor  wrote:
> Good afternoon,
>
> I'm bringing the "social-commerce" project up to the latest trunk of
> Pinax and Django.
>
> Is there a checklist of things I'll need to update?
>
> I've begun updating it, i.e. adding the new database dictionary:
> DATABASES = {
>     'default': {
>         'ENGINE': 'django.db.backends.mysql',
>         'OPTIONS': {
>             'read_default_file': '/path/to/my.cnf',
>         },
>     }
>
> }
>
> But it keeps giving me error after error once I've done that, so
> instead of tackling issues one at a time, I thought their might be a
> guide of some sort?
>
> Thanks for all suggestions,

The best guide is checking the release notes of 1.3 and 1.4. They
should contain all the deprecated and backwards incompatible changes.
Missing or hard to understand parts of the release notes are valuable
knowledge to Django's developers, so please inform about those if you
see something.

You should also run your code with full warnings under 1.2. If you
don't get any warnings about deprecation under 1.2, in principle you
should be able to just update to 1.4.

 - Anssi

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



Re: rich text editing

2012-02-04 Thread Denis Darii
Take a look at this app: https://github.com/pydanny/django-wysiwyg

On Sat, Feb 4, 2012 at 2:44 PM, yonatan braude wrote:

> I want to enable rich text editing to editor on the site. what is the best
> way?
> thanx
> yonatan
>
> --
> 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: Help Me With omab/django-socialauth

2012-02-04 Thread coded kid
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.messages",
> > > > > >>>     "django.core.context_processors.request",
> > > > > >>>      social_auth.context_processors.social_auth_by_type_backends ,
> > > > > >>> )
> > > > > >>> AUTHENTICATION_BACKENDS = (
> > > > > >>>      'social_auth.backends.twitter.TwitterBackend',
> > > > > >>>     'django.contrib.auth.backends.ModelBackend',
> > > > > >>> )
> > > > > >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > > > >>> TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> > > > > >>> TWITTER_CONSUMER_SECRET      = 'YyNngsgw[1jw lcllcleleedfejewjuw'
> > > > > >>> LOGIN_URL = '/accounts/login/' #login form for users to log in 
> > > > > >>> with
> > > > > >>> their username and password!
> > > > > >>> SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
> > > > > >>> authenticated
> > > > > >>> SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/homi/'   '  #page 
> > > > > >>> after
> > > > > >>> user get authenticated
> > > > > >>> SOCIAL_AUTH_ERROR_KEY='social_errors'
> > > > > >>> SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
> > > > > >>> SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
> > > > > >>> from django.template.defaultfilters import slugify
> > > > > >>> SOCIAL_AUTH_USERNAME_FIXER = lambda u: slugify(u)
> > > > > >>> SOCIAL_AUTH_UUID_LENGTH = 16
> > > > > >>> SOCIAL_AUTH_EXTRA_DATA = False
> > > > > >>> In urls.py
> > > > > >>> url(r'', include('social_auth.urls')),
> > > > > >>> In my template:
> > > > > >>> 
> > > > > >>>    Enter using 
> > > > > >>> Twitter > > > > >>> a>
> > > > > >>>    
> > > > > >>> 
> > > > > >>> What do you think I m doing wrong? Hope to hear from you soon. 
> > > > > >>> Thanks
> > > 

Re: problem with localization

2012-02-04 Thread Denis Darii
Vittorino, this is not related to your initial question and you must
consider that the format() returns always a string. And why do you use
format() in total_no_vat()?

I would separate the "total":

...
 def total_no_vat(self):
return self.total_income + self.total_fee

 def total(self):
 return self.total_no_vat() * 1.21

 def formatted_total(self):
 return format(self.total(), settings.DECIMAL_SEPARATOR, 2)

now you can use formatted_total in your list_display
Denis.


On Sat, Feb 4, 2012 at 2:40 PM, Vittorino Parenti <
vpare...@thundersystems.it> wrote:

> Hi,
> I think this is not the solution.
> I do another example:
>
> MODEL
> 
> class Procedure(models.Model):
>  
>  total_income = models.DecimalField (
>default = 0,
>max_digits = 11,
>decimal_places = 4,
>verbose_name = _("Total Income"),
>  )
>  total_fee = models.DecimalField (
>default = 0,
>max_digits = 11,
>decimal_places = 4,
>verbose_name = _("Total Fee"),
>  )
>  
>   def total_no_vat(self):
> total_no_vat -no= self.total_income + self.total_fee
> return format(total_no_vat, settings.DECIMAL_SEPARATOR, 2)
>
>  def total(self):
>  total = self.total_no_vat() * 1.21
>  return format(total, settings.DECIMAL_SEPARATOR, 2)
>
> type of self.total_no_vat is unicode and I cannot do other operations
> on this field.
> Thanks,
> Vittorino
>
>
> On 4 Feb, 10:15, Denis Darii  wrote:
> > Hi Vittorino, this is happen because the model fields are automatically
> > formatted by django considering your settings.DECIMAL_SEPARATOR, but in
> > your total() you're simply return the sum of two Decimal()
> >
> > To solve this you can import format and pass the result of total() to it
> > like:
> >
> > from django.conf import settings
> > from django.utils.numberformat import format
> > ...
> >  def total(self):
> > total = self.total_income + self.total_fee
> > return format(total, settings.DECIMAL_SEPARATOR, 2)
> >
> > hope it helps! Have a nice weekend!
> > Denis.
> >
> > On Sat, Feb 4, 2012 at 9:52 AM, Vittorino Parenti <
> >
> >
> >
> >
> >
> >
> >
> > vpare...@thundersystems.it> wrote:
> > > Hello,
> > > i've a problem with number format localization. This is an example of
> > > my model and admin:
> >
> > > MODEL
> > > 
> > > class Procedure(models.Model):
> > >  
> > >  total_income = models.DecimalField (
> > >default = 0,
> > >max_digits = 11,
> > >decimal_places = 4,
> > >verbose_name = _("Total Income"),
> > >  )
> > >  total_fee = models.DecimalField (
> > >default = 0,
> > >max_digits = 11,
> > >decimal_places = 4,
> > >verbose_name = _("Total Fee"),
> > >  )
> > >  
> > >  def total(self):
> > > return self.total_income + self.total_fee
> >
> > > ADMIN
> > > ---
> > > class ProcedureAdmin(dmin.ModelAdmin):
> > >  list_display = (..., 'total_income', 'total_fee', 'total', ...)
> >
> > > output is:
> >
> > > ... | 35,22 | 9,28 | 45.50 | ...
> >
> > > with comma in first two cases and dot then.
> > > How can I do?
> > > Thanks in advance,
> > > 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.
>
> --
> 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.



rich text editing

2012-02-04 Thread yonatan braude
I want to enable rich text editing to editor on the site. what is the best
way?
thanx
yonatan

-- 
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: problem with localization

2012-02-04 Thread Vittorino Parenti
Hi,
I think this is not the solution.
I do another example:

MODEL

class Procedure(models.Model):
  
  total_income = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Income"),
  )
  total_fee = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Fee"),
  )
  
  def total_no_vat(self):
 total_no_vat -no= self.total_income + self.total_fee
 return format(total_no_vat, settings.DECIMAL_SEPARATOR, 2)

  def total(self):
  total = self.total_no_vat() * 1.21
  return format(total, settings.DECIMAL_SEPARATOR, 2)

type of self.total_no_vat is unicode and I cannot do other operations
on this field.
Thanks,
Vittorino


On 4 Feb, 10:15, Denis Darii  wrote:
> Hi Vittorino, this is happen because the model fields are automatically
> formatted by django considering your settings.DECIMAL_SEPARATOR, but in
> your total() you're simply return the sum of two Decimal()
>
> To solve this you can import format and pass the result of total() to it
> like:
>
> from django.conf import settings
> from django.utils.numberformat import format
> ...
>      def total(self):
>         total = self.total_income + self.total_fee
>         return format(total, settings.DECIMAL_SEPARATOR, 2)
>
> hope it helps! Have a nice weekend!
> Denis.
>
> On Sat, Feb 4, 2012 at 9:52 AM, Vittorino Parenti <
>
>
>
>
>
>
>
> vpare...@thundersystems.it> wrote:
> > Hello,
> > i've a problem with number format localization. This is an example of
> > my model and admin:
>
> > MODEL
> > 
> > class Procedure(models.Model):
> >      
> >      total_income = models.DecimalField (
> >        default = 0,
> >        max_digits = 11,
> >        decimal_places = 4,
> >        verbose_name = _("Total Income"),
> >      )
> >      total_fee = models.DecimalField (
> >        default = 0,
> >        max_digits = 11,
> >        decimal_places = 4,
> >        verbose_name = _("Total Fee"),
> >      )
> >      
> >      def total(self):
> >         return self.total_income + self.total_fee
>
> > ADMIN
> > ---
> > class ProcedureAdmin(dmin.ModelAdmin):
> >      list_display = (..., 'total_income', 'total_fee', 'total', ...)
>
> > output is:
>
> > ... | 35,22 | 9,28 | 45.50 | ...
>
> > with comma in first two cases and dot then.
> > How can I do?
> > Thanks in advance,
> > 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.

-- 
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: auth groups puzzle

2012-02-04 Thread Dan Gentry
I've solved this problem in an app, but not with the built-in
permissions system.  Instead, I created a DB structure that links
users to companies and stores the r/w status for each.

On Feb 3, 12:58 am, Mike Dewhirst  wrote:
> I want to use the built-in auth_groups permissions system in a
> many-to-many sense but can't quite figure it out for my use case. Any
> help will be appreciated.
>
> The use case is: users have different types of access (r/o, r/w or
> admin) to different companies. Any single user can have r/o access to
> company-1, r/w access to company-2 and admin access to company-3 and so
> on. Any company can have relationships with many users each of whom will
> have one of the r/o, r/w or admin group permissions.
>
> So there has to be a many-to-many relationship between user and company
> and the group needs to be specified in that relationship table rather
> than in the auth_user_groups table - where it currently sits.
>
> How do I invoke a different set of permissions depending on the name of
> the group established in the user-company relationship table when a user
> is accessing that company's data?
>
> A side question is how do I remove the displayed Groups in the Django
> Admin auth/user display?
>
> Thanks
>
> Mike

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



VIM as Modern Python/Dajngo IDE

2012-02-04 Thread Vikas Ruhil
I write a Blog about VIM as a Python/Dajngo Modern IDE .There are about 15
Plugin and config of there is on post . I am looking for plugin suggestion
for more .

Also for newbie and Non-vim user's there is request  to checkout the
post.Those Guys who ask what IDE should they need use or Which is Best IDE
for Python/Django.

http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html

Regards
Vikash Ruhil

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



Images in html nicht erreichbar durch Django server warum ???

2012-02-04 Thread doniyor
Hallo zusammen,

ich habe kleines problem mit pfadangabe. ich habe eine ganz normale
einfache index.html mit bilder drin. ich projekt angelegt in django
mit Aptana. Also mein problem taucht da auf wenn ich die Seite
aufmache.

1) wenn ich die index.html vom Ordner aus direkt mit doppelklick
aufmache, ist alles in ordnung, bilder sind da und alles perfekt.

2) aber wenn ich mit manage.py runserver mache und in localhost
aufmache die seite, dann ich sehe keine bilder, anstatt bilder sind
komische platzhalter vom bild, wenn ich das zeig durch rechte
maustaste "bild speichern" mache, dann speichert er zwar irgendwas,
aber das bild ist nicht da.

woran kann es liegen ?

ich geb mal ganze hierarchie hier an:

-transfer
  - contact (das ist app)
 - __init__
 - models.py
 - tests.py
 - views.py
  - media
 - js
 - images
 - css
  - template
 - index.html
  - transfer
 - __init__
 - settings.py
 - urls.py
 - wsgi.py


z,b, in index.html habe ich so getaggt das bild
  


bitte um Hilfe !!

Doni

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



problem with localization

2012-02-04 Thread Vittorino Parenti
Hello,
i've a problem with number format localization. This is an example of
my model and admin:

MODEL

class Procedure(models.Model):
  
  total_income = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Income"),
  )
  total_fee = models.DecimalField (
default = 0,
max_digits = 11,
decimal_places = 4,
verbose_name = _("Total Fee"),
  )
  
  def total(self):
 return self.total_income + self.total_fee

ADMIN
---
class ProcedureAdmin(dmin.ModelAdmin):
  list_display = (..., 'total_income', 'total_fee', 'total', ...)

output is:

... | 35,22 | 9,28 | 45.50 | ...

with comma in first two cases and dot then.
How can I do?
Thanks in advance,
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: Modify only one field

2012-02-04 Thread Ashe


On Feb 3, 11:55 pm, akaariai  wrote:
> On Feb 4, 9:10 am, Ashe  wrote:
>
> > Is there a better solution to modify only the specified field on a
> > table than :
> > self.__class__.objects.filter(id=self.id).update(myfield='new awesome
> > value')
> > ?
> > I have been looking for a cleaner solution for a long time without
> > success, while waiting for that (https://code.djangoproject.com/ticket/4102
> > ).
>
> > If it is the best solution, is there any drawback with that solution ?
> > I suppose there is a read on the database because of the
> > objects.filter(). And we lose the possibility to use save() and
> > clean() before update, which I usually enjoy to override.
>
> That is the only available solution currently, apart of raw SQL which
> is an often overlooked alternative.
>
> You could do that update in an overridden .save method. Make it take a
> kwarg 'update_fields=[],' or 'only_myfield=False'. Then, you can just
> use model.save(only_myfield=True). The save method could then handle
> all the necessary dirty details.
>
> BTW even if there is a filter operation, there will be just only one
> query. Actually, your method will be more effective than normal save,
> as without force_update the current implementation of .save() needs to
> first do a select, then update. You can see the queries made by using
> django-debug-toolbar, or just by running this in the shell:
> from django.db import connection
> from django.conf import settings
> settings.DEBUG = True
> self.__class__.objects.filter(id=self.id).update(myfield='new awesome
> value')
> print connection.queries

Thanks for the answer and advice, I will give them a try.

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