Django Internal Server Error

2012-10-07 Thread Wnt2bsleepin
I looked in the log files for apache and it came up with the following. 

 File "/home/Yourdogsdead/uglstats/uglstats/wsgi.py", line 26, in ?
 from django.core.wsgi import get_wsgi_application
 ImportError: No module named django.core.wsgi

I am not sure why it's not importing properly. 

-- 
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/-/9ao5LPpT3NkJ.
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: ANN: django-socketio 0.1.0 released

2012-10-07 Thread rahul jain
Hi Stephen,

I am having issues with the installation. Is this project still
active? is there any goggle group?

I just downloaded the latest file. Then i tried running the example
chat application. I can see the messages from the client.
However, events inside event.py are never getting fired. I think my
setup is not able to load "events.py". I inserted some print
statements in both these functions but they never getting printed out

@events.on_message(channel="^room-")
def message(request, socket, context, message):

@events.on_finish(channel="^room-")
def finish(request, socket, context):

Please can you let me know how to fix this?

My django version:

(1, 3, 1, 'final', 0)

Messages from the client after running on python manage.py runserver_socketio

127.0.0.1 - - [2012-10-07 17:02:13] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:02:54] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:03:05] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:03:16] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:04:23] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:06:45] "Socket.IO subscribe: room-2"
127.0.0.1 - - [2012-10-07 17:06:50] "Socket.IO message: {u'action':
u'start', u'room': 2, u'name': u'test'}"
127.0.0.1 - - [2012-10-07 17:07:52] "Socket.IO subscribe: room-2"

Appreciate your time!

Thanks.

RJ





On Fri, Aug 12, 2011 at 9:06 PM, Stephen McDonald  wrote:
> Hi all,
>
> Our Django Dash entry http://drawnby.jupo.org made extensive use of
> Socket.IO (cross-browser websockets) and born out of that I've created a new
> django-socketio package which is now available:
>
> Github: https://github.com/stephenmcd/django-socketio
> Bitbucket: https://bitbucket.org/stephenmcd/django-socketio
> PyPI: http://pypi.python.org/pypi/django-socketio/
>
> Here's an overview from the docs:
>
> django-socketio is a BSD licensed Django application that brings together a
> variety of features that allow you to use WebSockets seamlessly with any
> Django project. django-socketio was inspired by Cody Soyland's introductory
> blog post on using Socket.IO and gevent with Django, and made possible by
> the work of Jeffrey Gelens' gevent-websocket and gevent-socketio packages.
> The features provided by django-socketio are:
>
> - Installation of required packages from PyPI
> - A management command for running gevent's pywsgi server with
> auto-reloading capabilities
> - A channel subscription and broadcast system that extends Socket.IO
> allowing WebSockets and events to be partitioned into separate concerns
> - A signals-like event system that abstracts away the various stages of a
> Socket.IO request
> - The required views, urlpatterns, templatetags and tests for all the above
>
> Cheers,
> Steve
>
> --
> Stephen McDonald
> http://jupo.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.

-- 
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: when is a Context Processor called?

2012-10-07 Thread Daniel Roseman
On Sunday, 7 October 2012 17:43:19 UTC+1, Stefano T wrote:

> Hi all.
> i just discovered the context processor, and i use it for put an object in 
> the request automatically, this is the code:
>
> def addProfile(request):
> try:
> userProfile = UserProfile.objects.get(user=request.user)
> return {'user_profile':userProfile}
> except:
> return {}
>
> this is the setting.py
>
> TEMPLATE_CONTEXT_PROCESSORS = (
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> 'social_auth.context_processors.social_auth_by_type_backends',
> 'earth.context_processors.addProfile',
> )
>
> now, it works, except one case. 
> i've in a html page ajax call that sends some data to an url, here the JS:
>
> $.post("/geoloc/updateloc/", { latitude: lat, longitude: lon });
>
> mapped as 
>
> url(r'^geoloc/updateloc/$', 'earth.views.updateLoc'),
>
>
> and here is the view:
>
> @login_required
> @csrf_protect
> def updateLoc(request):
> message={}
> message['status']='ko'
> if request.is_ajax():
> if request.method == 'POST':
> message['status']='ok'
> userProfile = request.user_profile
> userProfile.latitude=request.POST['latitude']
> userProfile.longitude=request.POST['longitude']
> userProfile.save()
> # Here we can access the POST data
> return HttpResponse(json.dumps(message), mimetype="application/json")
>
> the fact is that in the view, the request.user_profile (which should be 
> loaded by the context template) is empty or none. basically if i print it i 
> don't have anything printed.
>  
> basically: when is my context processor called? 
> is it called  only for render_to_response or also for redirect or 
> HTTPResponse or HTTPResponseRedirect?
> what should i do?
>
>
> thanks
>
> ciao
>
>
>
> -- 
> Stefano
>


The name of the setting should give you a clue: TEMPLATE_CONTEXT_PROCESSOR. 
Context processors are for doing stuff to template contexts. They have 
nothing whatsoever to do with views. If you're not using a template, then 
context processor won't help you.
--
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/-/2lklE1ekuCYJ.
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: Strange Template Error in Production Mode

2012-10-07 Thread Kamhamea

Problem solved. My fault.
For some reasons I cannot recall, I had included the url.py file in debug 
mode only.

-- 
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/-/auIZZuRwj48J.
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: Strange Template Error in Production Mode

2012-10-07 Thread Kamhamea
Not an answer just an update:

> {% comment %}
>  Imagelist
> {% uncomment %}
> is not correct.
>

Correctly commented out the lines look like 
{% comment %}
 Imagelist
{% endcomment %}

The wrong comment out brace caused the inlude file to be ignored at all, so 
no error was generated. If the comment brace is set correctly the line 
 Imagelist
will always cause an error, even if I change names.

 

-- 
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/-/0LddmWpw3qwJ.
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: Intensive View Tracking

2012-10-07 Thread Cal Leeming [Simplicity Media Ltd]
Hey JD,

You might want to check this out;

https://github.com/foxx/django-cutemodel

It's not completely ready yet though and is missing a lot of features (see
issues list) - but sounds pretty close to what you need.

Although what it doesn't have is the ability to link audit items together
(i.e. log an audit event against object X that was
invoked/triggered/involved with object Y) - this is still on the todos.

Cal

On Sun, Oct 7, 2012 at 4:00 PM, jondykeman  wrote:

> Hello,
>
> I'm looking for some conceptual input. I am starting to plan the
> development of an app utilizing highly confidential data that will need to
> meet certain governmental requirements.
>
> I had dealt with auditing of the data etc, but it ends up they will
> require a timestamped history of ever action taken by ever user. ie. User1
> logged in at x. User1 went to view page. User1 used the search and searched
> for "Y" etc ...
>
> I searched for any pre-existing work but all I found was counting page
> views etc.
>
> Obviously the easiest to think of and most hideously hack job approach
> would just to custom save the info into a tracking table as part of every
> view, but this isn't the path I would like to go down.
>
> I was thinking of tying into all of the signals, but will have to look
> more into if this will give full coverage.
>
> Do you think signals will be the way to go? Or maybe a MiddleWare of some
> sort?
>
> I am hoping someone has had experience with something related.
>
> Thanks for your help,
>
> JD
>
> --
> 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/-/guYY52zdFlMJ.
> 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.



Strange Template Error in Production Mode

2012-10-07 Thread Kamhamea
When 
DEBUG = False
my django 1.4 (recently updated) behaves weirdly.

I have a template to include that displays some menu items


 Topic 1
 Topic 
2
 Search

   {% if local %}
 
Topic local 1
 Imagelist
 Topic local 2
   {% endif %}


I get an error with that template only in debug mode turned off and when 
local is true.
The problem melts down to the line.
 Imagelist
If this line is removed. The template works fine even in degug mode turned 
off.

However it comes stranger still. When I comment out the line.
{% comment %}
 Imagelist
{% uncomment %}
it works again as expected. But it also works when I add the line
 Imagelist
again, and it doesn't matter whether before or after the comment.

I already thought I have entered a strange invisible character in that 
line, but I retyped the whole file and observed exactly the same behavior.
I thought it might have something to do with the name, so I changed 
"img_list_images" to other names. The same behavior

The url file holds:
(r'^list/$', 'list_images',{}, 'img_list_images'),



-- 
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/-/VIDJ-_92t4QJ.
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: Should we have a database independent SQL like language in Django?

2012-10-07 Thread bb6xt
Hi,
To add another 50 kobo to Babatunde's, I think another way of go may be to have 
per-backend translations for all raw queries stored as text files or in the 
database and a seamless way of instropecting and fetching the correct 
translation at runtime just like language translations. This could be 
implemented in django.contrib.

--
Sent from my mobile device

-- 
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/utils/html.py fix to work with jython/java

2012-10-07 Thread Stefan Hummert
http://code.google.com/p/django-jython/issues/detail?id=78

I am not sure where this fix suits best (django or django-jython project), 
so I'll just ask...
at the Link above all fix details are posted (if someone care's to 
integrate them feel free...)

-- 
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/-/KG46FkiJGMcJ.
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-guardian + field permissions ?

2012-10-07 Thread Nicolas Emiliani
Hi,

I'm using django-guardian to implement in the admin panel
per object permissions. So far so good. Now I've stumbled
upon the following issue. If I create an instance of a Foo
model (a_foo from now on) and then assign to the user that created the
instance (a_user from now on) change_foo and delete_foo permisions,
then, the a_user will also be able to change it's own permissions
on a_foo through the 'object permissions' button (the one next
to the 'history' button).

Even though this is absolutely logical, I do not want that a_user
that belongs to a specific group being able to change his own
objects permissions. It would be somewhat of field permission
over object permissions.

Any way to accomplish this ?

Thanks in advance.

-- 
Nicolas Emiliani

Lo unico instantaneo en la vida es el cafe, y es bien feo.

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



about installing django

2012-10-07 Thread Lewis Satini
Hello,
I am new here.
I am thinking to start my django study again. I start before, but stuck
with some issues.
1. Is there a way to install django and the plug-ins through ftp without
going thru any command shell? after python was installed
2. I want to start an image portal. Is there any suggestion for plug-ins?
something like flickr and also you able to market them.
3. Is there anyone there volounteer to help while building my project and
application? so that I can just direct my question to you.

I am working for improvement of this site at http://crossmap.com. We want
to change to focus on background only and recoding using django. It was on
PHP  and We want to keep the database and adding some additional feature.
We need your input and direction of how we should go

Thanks,
Lewis

-- 
facebook.com/artistbean
SMS at (646) 450-6756

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



Intensive View Tracking

2012-10-07 Thread jondykeman
Hello, 

I'm looking for some conceptual input. I am starting to plan the development of 
an app utilizing highly confidential data that will need to meet certain 
governmental requirements. 

I had dealt with auditing of the data etc, but it ends up they will require a 
timestamped history of ever action taken by ever user. ie. User1 logged in at 
x. User1 went to view page. User1 used the search and searched for "Y" etc ... 

I searched for any pre-existing work but all I found was counting page views 
etc.

Obviously the easiest to think of and most hideously hack job approach would 
just to custom save the info into a tracking table as part of every view, but 
this isn't the path I would like to go down. 

I was thinking of tying into all of the signals, but will have to look more 
into if this will give full coverage. 

Do you think signals will be the way to go? Or maybe a MiddleWare of some sort?

I am hoping someone has had experience with something related. 

Thanks for your help,

JD

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



Value Error during 1.2 to 1.4 conversion

2012-10-07 Thread Peter
I'm trying to convert a Django 1.2 site to a 1.4 site.  So there's lots of 
changing old generic views to class-based generic views, and the apps all 
go up one level so lots of changes to imports, but in each case so far it's 
it's been quite easy to narrow down the problem to a line in my code, and 
fix it.  Until I got to this:

ValueError at / 

dictionary update sequence element #0 has length 1; 2 is required

 Request Method: GET  Request URL: http://www.crompton-saage.com/  Django 
Version: 1.4.1  Exception Type: ValueError  Exception Value: 

dictionary update sequence element #0 has length 1; 2 is required

 Exception Location: 
/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py 
in resolve, line 207  Python Executable: /usr/local/bin/python  Python 
Version: 2.7.3  Python Path: 

['/home/cassidy/webapps/crompton',
 '/home/cassidy/webapps/crompton/crompton',
 '/home/cassidy/webapps/crompton/lib/python2.7',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages/PIL']

 Server time: Sun, 7 Oct 2012 19:03:37 +0800
Request URL: http://www.crompton-saage.com/

Django Version: 1.4.1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.comments',
 'django.contrib.flatpages',
 'accounts',
 'machines',
 'sales')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Traceback:
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/handlers/base.py" 
in get_response
  101. request.path_info)
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py" 
in resolve
  300. sub_match = pattern.resolve(new_path)
File 
"/home/cassidy/webapps/crompton/lib/python2.7/django/core/urlresolvers.py" 
in resolve
  207. kwargs.update(self.default_args)

Exception Type: ValueError at /
Exception Value: dictionary update sequence element #0 has length 1; 2 is 
required

So basically I have have no clue what part of *my* code could be causing 
this as there's no reference to my code.  How would I find out how to trace 
this back to something I can change.  I imagine I can pore through the 
Django sources but I'm not really a Python programmer, I just know enough 
syntax to write Django code.

Any ideas?

-- 
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/-/tr_lPLJq3OsJ.
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 Admin asks password every operation

2012-10-07 Thread Stefano T
Actually i had the url matching that was matchin all the request and
send it to home.
the problem was that in the home view i accidentally copied a
logout(request) into the view and obviusly every time it was logging
out me.

now it works.

On Oct 6, 4:05 pm, Victor Rocha  wrote:
> Depending on what exactly you want to accomplish to match the root to a
> url, I do as follow:
> url(r'^$', 'earth.views.Home'),
>
> However, it is sometimes good to have a default page if a request didnt
> match the url requested (I would use this as the very last rule, otherwise
> it will catch every request):
> url(r'^', 'earth.views.Home'),
>
> As for your origina question, are you sure you have your session middleware
> activated?
>
>
>
>
>
>
>
> On Saturday, October 6, 2012 9:53:36 AM UTC-4, Stefano T wrote:
>
> > What i want is to match the root of my website with a url.
>
> > On Saturday, October 6, 2012 12:53:08 AM UTC+2, ke1g wrote:
>
> >> All urls match this.  The regular expression says "any URL that starts
> >> from the beginning, no matter what follows.  I suspect that you want
> >> 'r^$'
>
> >> Bill
>
> >> On Fri, Oct 5, 2012 at 2:15 PM, Stefano T
> >>  wrote:
> >> > wait i may have spotted out the problem:
> >> > if i've an app, is this the correct url pattern for the homepage?
>
> >> >     url(r'^', 'earth.views.Home'),
>
> >> > or does it take ll the urls?
>
> >> > On Friday, October 5, 2012 8:10:09 PM UTC+2, Stefano T wrote:
>
> >> >> i didn't est SESSION_COOKIE_AGE anywhere, so i suppose it's set to its
> >> >> default value.
> >> >> Cookies are enabled.
> >> >> i'm facing the problem in chrome (i deleted all the browser data,
> >> nothing
> >> >> changed)
> >> >> with FF it works.
> >> >> Before it was working with chrome, suddently it stopped.
>
> >> >> On Friday, October 5, 2012 7:32:16 PM UTC+2, Larry@gmail.comwrote:
>
> >> >>> On Fri, Oct 5, 2012 at 10:57 AM, Stefano T
> >> >>>  wrote:
> >> >>> > Hi all.
> >> >>> > i'm new to django and i'm facing a problem i can't solve so far.
> >> >>> > Basically, when i log in in the admin part, every operation i do it
> >> >>> > ask me for the login. doesn't matter which browser i user, it's
> >> always
> >> >>> > the same.
> >> >>> > at the beginning it was acting normally: once logged in i stay
> >> logged
> >> >>> > in until the logout.
> >> >>> > idea?
>
> >> >>> What is SESSION_COOKIE_AGE set to in your settings file? Or are
> >> >>> cookies disabled for your browser?
>
> >> > --
> >> > 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/-/jJ7LrE2_TC0J.
>
> >> > To post to this group, send email to django...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > django-users...@googlegroups.com.
> >> > For more options, visit this group at
> >> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To 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: Translation outside the broswer

2012-10-07 Thread Laxmikant Gurnalkar
Yeah, i18n works anywhere just put _(message) to send a mail.
*
*
*cheers *


On Fri, Oct 5, 2012 at 10:16 PM, Bastian  wrote:

> Thanks Tom, the logic seems pretty clear. I just didn't know about
> translation.activate. What does it do exactly? Change the current language?
> Anyway I will do my homework and google it and read the code...
>
> Cheers.
>
>
> On Friday, October 5, 2012 12:19:38 PM UTC+2, Tom Evans wrote:
>
>> On Fri, Oct 5, 2012 at 10:12 AM, Bastian  wrote:
>> > Hi,
>> >
>> > I understand quite well how translations and i18n work inside a browser
>> for
>> > Django but I'm not sure about the correct way to do it outside a
>> browser. I
>> > mean when sending a mail or a tweet. What should I use to get the
>> language
>> > of the user that is going to receive the mail or in case of a tweet the
>> > language of the user that I will send it on behalf of. And then how do
>> I ask
>> > Django to translate that?
>> > I could not find it in the docs, if it exists please point me to it.
>> >
>> > Cheers
>> >
>>
>> You will need to have a mechanism for storing what the user's chosen
>> language is. Once you have that, simply do this:
>>
>> from django.utils import translation
>>
>> cur_language = translation.get_language()
>> translation.activate(get_lang_**for_user(user))
>> # send email, tweet, etc
>> translation.activate(cur_**language)
>>
>> You would need to define the 'get_lang_for_user' function.
>>
>> Cheers
>>
>> Tom
>>
>  --
> 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/-/UWQFiq5SddQJ.
>
> 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.
>



-- 
*

 GlxGuru

*

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



Re: Disabling CSRF is not working.

2012-10-07 Thread Laxmikant Gurnalkar
Thanks, for the response.
I had a problem like this
   I was trying to create a  storesite which can be worked without django
framework but using django. i.e just static template index.html &
a java-script file. With all the stuff dynamically generated & only urls by
the django, so that anybody can use my index.html, just calls my server for
the url to display dynamic content using users information.
so for this purpose I had a cookies resided in my browser and I was trying
to create database objecst using javascript with api urls.

When I studied CSRF in detail, I understood that, *private dynamic
 javascript cookies *cannot be directly used to  retrieve or access the
database related to your site. Hence, my javascript was considered by
django as a *malicious/attack *content and thrown a 403 forbidden error. So
I was trying to remove the CSRF from my project. But* Failed. Due to the
same reason as you guys have told me.*
*So on understanding CSRF  just removed code of cookies & just added
parameters to url just before when user refreshes the page. And whole thing
worked.  That was the Great  experience.*
*
*
*anyways,*
*Plz tell me if I can hv any other method to do this. adding parameters to
url is definitely not secure always.*
*
*
*One more thing I am using csrf_exempt to handle api views.*
*
*
*Thanks a lot again.*
*
*
On Sat, Oct 6, 2012 at 4:38 AM, Bill Freeman  wrote:

> Right you are.
>
> On Fri, Oct 5, 2012 at 6:20 PM, Ian Clelland  wrote:
> >
> >
> > On Friday, October 5, 2012, Bill Freeman wrote:
> >>
> >> I believe that I read somewhere that newer Djangos force the CSRF
> >> middleware even if it's not listed in MIDDLEWARE_CLASSES.
> >
> >
> > You might be thinking of the CSRF context processor, which is always
> > enabled, no matter what is in settings. Even the most recent docs don't
> say
> > anything about forcing the middleware.
> >>
> >>
> >> You could dive into the middleware code to see how this happens, and
> >> come up with a stable strategy to circumvent it.  Or you could just
> >> fix the necessary views and templates.  There is, after all, a chance
> >> that you will want to be able to upgrade this site without jumping
> >> through hoops.
> >>
> >> On Thu, Oct 4, 2012 at 4:56 AM, Laxmikant Gurnalkar
> >>  wrote:
> >> > Hi, Guys
> >> >
> >> > Disabling CSRF is not working.
> >> > These are my midlewares., Removed {% csrf_token %} all templates.
> >> >
> >> > MIDDLEWARE_CLASSES = (
> >> > 'django.middleware.common.CommonMiddleware',
> >> > 'django.contrib.sessions.middleware.SessionMiddleware',
> >> ># 'django.middleware.csrf.CsrfViewMiddleware',
> >> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
> >> > #'django.contrib.messages.middleware.MessageMiddleware',
> >> > #'django.middleware.csrf.CsrfResponseMiddleware',
> >> > # 'igp_acfs.acfs.disablecsrf.DisableCSRF',
> >> > )
> >> >
> >> >
> >> > Also tried by writing disablecsrf.py like this :
> >> >
> >> > class DisableCSRF(object):
> >> > def process_request(self, request):
> >> > """
> >> > """
> >> > setattr(request, '_dont_enforce_csrf_checks', True)
> >> >
> >> >
> >> > Thanks in Advance!!!
> >> >
> >> > Laxmikant
> >> >
> >> > --
> >> > 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.
> >>
> >
> >
> > --
> > Regards,
> > Ian Clelland
> > 
> >
> > --
> > 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.
>
>


-- 
*

 GlxGuru

*

-- 
You received this message because you are 

Re: ./manage.py collectstatic does not collect my folder

2012-10-07 Thread easypie
Wonderful! I had to add in the files I wanted override inside 
STATICFILES_DIRS. It works now.

On Saturday, October 6, 2012 11:01:39 PM UTC-7, Xavier Ordoquy wrote:
>
> Hi,
>
> Django static collects files that are:
> - in the application's static directory
> - in the directories listed by STATICFILES_DIRS
>
> If using the default storage, files and directories are copied into the 
> STATIC_ROOT directory and should be served at the location specified by 
> STATIC_URL
>
> The order in which the applications are declared is important.
> If I'm not mistaken, the files in STATICFILES_DIRS will override the 
> application's static directories.
>
> Regards,
> Xavier Ordoquy,
> Linovia.
>
> Le 7 oct. 2012 à 06:52, easypie  a 
> écrit :
>
> I have my project setup so ./manage.py collectstatic will upload all the 
> files in /static/ onto the Amazon S3 server. The only problem is that I 
> have a folder located in .../static/theme/{site layout gfx} that doesn't 
> get collected to the S3 server. I understand that collectstatic ?copies all 
> files located in app/static to the location provided by STATIC_URL. But 
> what about those .css and image files I want to override? For example, I 
> want to override the admin's .css files so I  copy that over to the 
> /static/ folder in my project's root but when I run ./manage.py 
> collectstatic it only moves the admin's .css files located in 
> ../site-packages/django/.../css/{..css} and not the css file that I copied 
> over and then edited?  
>
> -- 
> 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/-/1A2_Kn1PH1wJ.
> To post to this group, send email to django...@googlegroups.com
> .
> To unsubscribe from this group, send email to 
> django-users...@googlegroups.com .
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Us2xCBw2qFMJ.
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: ./manage.py collectstatic does not collect my folder

2012-10-07 Thread Xavier Ordoquy
Hi,

Django static collects files that are:
- in the application's static directory
- in the directories listed by STATICFILES_DIRS

If using the default storage, files and directories are copied into the 
STATIC_ROOT directory and should be served at the location specified by 
STATIC_URL

The order in which the applications are declared is important.
If I'm not mistaken, the files in STATICFILES_DIRS will override the 
application's static directories.

Regards,
Xavier Ordoquy,
Linovia.

Le 7 oct. 2012 à 06:52, easypie  a écrit :

> I have my project setup so ./manage.py collectstatic will upload all the 
> files in /static/ onto the Amazon S3 server. The only problem is that I have 
> a folder located in .../static/theme/{site layout gfx} that doesn't get 
> collected to the S3 server. I understand that collectstatic ?copies all files 
> located in app/static to the location provided by STATIC_URL. But what about 
> those .css and image files I want to override? For example, I want to 
> override the admin's .css files so I  copy that over to the /static/ folder 
> in my project's root but when I run ./manage.py collectstatic it only moves 
> the admin's .css files located in ../site-packages/django/.../css/{..css} and 
> not the css file that I copied over and then edited? 
> 
> -- 
> 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/-/1A2_Kn1PH1wJ.
> 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.