Re: Only Two Users Get : Forbidden (403) CSRF verification failed. Request aborted. Options

2012-05-10 Thread Johan
Hi thanks for the quick reply. After some more investigation I am quite 
sure that this is exactly the issue. Thanks again for the quick reply. Now 
to just find an elegant way to let the user know that they need to have 
Cookies enabled to access my site :)

On Thursday, 10 May 2012 18:24:13 UTC+2, Nikolas Stevenson-Molnar wrote:
>
> Django uses cookies for CSRF. Is it possible these two users have 
> cookies disabled? 
> https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-works 
>
> _Nik 
>
> On 5/10/2012 7:56 AM, Johan wrote: 
> > Hi 
> > 
> > Does anybody maybee have some pointers for me? I have a site up and 
> > running and it has worked perfectly for hundreds of users. Except that 
> > today I got two users (from the same company, although others from the 
> > same company has used it perfectly well) who are getting the [CSRF 
> > verification failed] issue. I have looked in my access.log and it 
> > seems like all the requests around the time of the failure is coming 
> > from the same IP so I don't suspect a genuine CSRF. Also I know that 
> > the coding is according to the documentation because so many others 
> > has used this same form without any issues. Any help or hints would be 
> > appreciated  
> > 
> > Thanks 
> > 
>

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



Re: How to serve staticfiles with full URL for local development?

2012-05-10 Thread e.generalov
On 11 май, 01:54, doniyor  wrote:
> if your problem is how to serve your static files, just create a folder
> with name static in your main app, then put all of your static files and
> and your STATIC_URL is /static/.

Thanks. I found some more ways to get around the restrictions of the
`staticfiles` due development.

I can to execute the `collectstatic` command, to fill STATIC_ROOT, and
serve it with external server (nginx, for example),
or apply monkey patches at StaticFilesHandler to override some
protected methods.

ps: but why these restrictions are needed in the tool, which should
assist in the development?


> Am Samstag, 5. Mai 2012 15:34:47 UTC+2 schrieb e.generalov:
>
>
>
>
>
>
>
>
>
> > There was a snippet to display a content of response in browser during
> > debugging  http://miniblog.glezos.com/post/3388080372/tests-browser.
>
> > "One of the first issues you might face is seeing a style-less page.
> > This happens becuase the test server isn’t really a web server, and
> > you’re probably serving static files from something relative such as
> > '/
> > site_media'. The solution is simple: Run a separate Django server and
> > tweak your development-only static URL to something like:
>
> > STATIC_URL = 'http://localhost:8000/site_media/
> > "
>
> > but this doesn't works anymore, because django.contrib.staticfiles
> > doesn't serve static when STATIC_URL contains full URL.
>
> > I found the node at
> >https://docs.djangoproject.com/en/dev/howto/static-files/#serving-sta...
> > :
>
> > "That's because this view is grossly inefficient and probably
> > insecure. This is only intended for local development, and should
> > never be used in production.
>
> > Additionally, when using staticfiles_urlpatterns your STATIC_URL
> > setting can't be empty or a full URL, such ashttp://static.example.com/.";
>
> > Is there a way to omit this limitation for local development?
>
> > (reposted from
>
> >http://groups.google.com/group/django-developers/browse_thread/thread...
> > )

-- 
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: Does Django Template Support Nested Tags?

2012-05-10 Thread azizmb.in
Off the top of my head, you could keep nesting the dictionary.

eg:

module_tests = {
"module1": {
"test1": {
"action1": ["step1", "step2", "step3"],
"action2": ["step1", "step2", "step3"]
},
"test2": {
"action1": ["step1", "step2", "step3"],
"action2": ["step1", "step2", "step3"]
}
},
"module2": {
"test1": {
"action1": ["step1", "step2", "step3"],
"action2": ["step1", "step2", "step3"]
},
"test2": {
"action1": ["step1", "step2", "step3"],
"action2": ["step1", "step2", "step3"]
}
}
}

On Fri, May 11, 2012 at 11:31 AM, Wally Yu  wrote:

> Thanks Aziz. You really helps a lot.
> But what if I have deeper level of looping? Say I have a template like
> this:
>
> {% for module, tests in module_tests.items %}
>   
>   Automation Test Result for Test Suite: {{ module}} h3>
>   
>   
>   {% for tc in tests %}
>   .
>..
>  {% for action in actions %}
>  ..
>  ..
>  {% for step in steps %}
>  ..
>  {% endfor %}
>   ..
>   {% endfor %}
>
>  {% endfor %}
>   ...
>
> {% endfor %}
>
> A case like above, I think it's hard to work with dictionary. Do you
> have better data structure for that?
>
> Thanks,
> Wally
>
> On May 11, 1:26 pm, "azizmb.in"  wrote:
> > AFAIK, django templates dont support what you are trying to do. You could
> > check some answers
> > here<
> http://stackoverflow.com/questions/4063515/django-template-question-a...>
> > .
> >
> > I would restructure the data being passed to the template to something
> like
> > this:
> >
> > module_tests = {
> > 'module1': ['TC1','TC2','TC3'],
> > 'module2': ['Case1', 'Case2']
> >
> > }
> >
> > and then in your template:
> >
> > {% for module, tests in module_tests.items %}
> >
> >Automation Test Result for Test Suite: {{
> module}}
> >
> >
> >{% for tc in tests %}
> >.
> >
> > >  {% endfor %}
> > >   ...
> >
> > {% endfor %}
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Fri, May 11, 2012 at 9:37 AM, Wally Yu  wrote:
> > > Hi all,
> >
> > > I'm wondering if Django template supports nested tags? Here is my
> > > situation:
> >
> > > My Template:
> >
> > > 
> > > 
> > >{% for module in modules %}
> > >
> > >Automation Test Result for Test Suite: {{
> module}}
> > >
> > >
> > >{% for TC in
> > > TCs.{{forloop.parentloop.counter0}} %}
> > > ... ...
> >
> > > {% endfor %}
> > >   ... ...
> > >   {% endfor %}
> >
> > > Here are the Lists I'm trying to pass into template:
> > >  - modules = ['module1', 'module2']
> > >  - TCs = [['TC1','TC2','TC3'],['Case1','Case2']]
> >
> > > But seems "{% for TC in TCs.{{forloop.parentloop.counter0}} %}" is not
> > > working... That probably because a "forloop" is inside a "for" tag.
> > > The error message is:
> > > "Could not parse the remainder: '{{forloop.parentloop.counter}}' from
> > > 'TCs.{{forloop.parentloop.counter}}'"
> >
> > > Does anybody encounter the same problem with me? Could you help share
> > > your idea to solve it? Thanks in advance.
> >
> > > Thanks,
> > > Wally
> >
> > > --
> > > 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.
> >
> > --
> > - Aziz M. Bookwala
> >
> > Website  | Twitter 
> |
> > Github 
>
> --
> 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.
>
>


-- 
- Aziz M. Bookwala

Website  | Twitter  |
Github 

Re: Does Django Template Support Nested Tags?

2012-05-10 Thread Wally Yu
Thanks Aziz. You really helps a lot.
But what if I have deeper level of looping? Say I have a template like
this:

{% for module, tests in module_tests.items %}
   
   Automation Test Result for Test Suite: {{ module}}
   
   
   {% for tc in tests %}
   .
   ..
  {% for action in actions %}
  ..
  ..
  {% for step in steps %}
  ..
  {% endfor %}
   ..
   {% endfor %}

  {% endfor %}
   ...

{% endfor %}

A case like above, I think it's hard to work with dictionary. Do you
have better data structure for that?

Thanks,
Wally

On May 11, 1:26 pm, "azizmb.in"  wrote:
> AFAIK, django templates dont support what you are trying to do. You could
> check some answers
> here
> .
>
> I would restructure the data being passed to the template to something like
> this:
>
> module_tests = {
>     'module1': ['TC1','TC2','TC3'],
>     'module2': ['Case1', 'Case2']
>
> }
>
> and then in your template:
>
> {% for module, tests in module_tests.items %}
>        
>                Automation Test Result for Test Suite: {{ module}}
>                
>                        
>                                {% for tc in tests %}
>                                .
>
> >                      {% endfor %}
> >       ...
>
> {% endfor %}
>
>
>
>
>
>
>
>
>
> On Fri, May 11, 2012 at 9:37 AM, Wally Yu  wrote:
> > Hi all,
>
> > I'm wondering if Django template supports nested tags? Here is my
> > situation:
>
> > My Template:
>
> > 
> > 
> >        {% for module in modules %}
> >        
> >                Automation Test Result for Test Suite: {{ module}}
> >                
> >                        
> >                                {% for TC in
> > TCs.{{forloop.parentloop.counter0}} %}
> >                                 ... ...
>
> >                                 {% endfor %}
> >       ... ...
> >       {% endfor %}
>
> > Here are the Lists I'm trying to pass into template:
> >  - modules = ['module1', 'module2']
> >  - TCs = [['TC1','TC2','TC3'],['Case1','Case2']]
>
> > But seems "{% for TC in TCs.{{forloop.parentloop.counter0}} %}" is not
> > working... That probably because a "forloop" is inside a "for" tag.
> > The error message is:
> > "Could not parse the remainder: '{{forloop.parentloop.counter}}' from
> > 'TCs.{{forloop.parentloop.counter}}'"
>
> > Does anybody encounter the same problem with me? Could you help share
> > your idea to solve it? Thanks in advance.
>
> > Thanks,
> > Wally
>
> > --
> > 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.
>
> --
> - Aziz M. Bookwala
>
> Website  | Twitter  |
> Github 

-- 
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: Custom field names in ModelForm

2012-05-10 Thread Bhashkar Sharma
Thanks for the reply Rajneesh, but I'm looking for a more scalable option.
(Ideally I would like to write a wrapper of some kind which does the task 
regardless of which Model is it)
My use case is that I'm using django-piston for building a REST API, which 
I tweaked to give me what I wanted 
(http://rockerhome.wordpress.com/2012/05/06/hacking-django-piston/)
Since I'm exposing different field names to the external world as mentioned 
in my post, I want to validate those while still continuing to use the 
django Forms/ModelForms for validation of submitted data for data 
updation. It has to work for partial updates too.

I don't know if I was able to explain myself.
Let me know.

On Friday, May 11, 2012 12:17:54 AM UTC+5:30, Rajeesh Nair wrote:
>
>
> Is there a way to customize the field name (not just label) while creating 
>> a ModelForm?
>>
>>
> Override the change_form template for the concerned model and put the 
> label for the field 
> in whatever way you like. Check out the django-templates documentation to 
> know how to 
> do this.
>

-- 
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/-/WHRyTcVzD_EJ.
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: Does Django Template Support Nested Tags?

2012-05-10 Thread azizmb.in
AFAIK, django templates dont support what you are trying to do. You could
check some answers
here
.

I would restructure the data being passed to the template to something like
this:

module_tests = {
'module1': ['TC1','TC2','TC3'],
'module2': ['Case1', 'Case2']
}

and then in your template:

{% for module, tests in module_tests.items %}
   
   Automation Test Result for Test Suite: {{ module}}
   
   
   {% for tc in tests %}
   .

>  {% endfor %}
>   ...

{% endfor %}


On Fri, May 11, 2012 at 9:37 AM, Wally Yu  wrote:

> Hi all,
>
> I'm wondering if Django template supports nested tags? Here is my
> situation:
>
> My Template:
>
> 
> 
>{% for module in modules %}
>
>Automation Test Result for Test Suite: {{ module}}
>
>
>{% for TC in
> TCs.{{forloop.parentloop.counter0}} %}
> ... ...
>
> {% endfor %}
>   ... ...
>   {% endfor %}
>
> Here are the Lists I'm trying to pass into template:
>  - modules = ['module1', 'module2']
>  - TCs = [['TC1','TC2','TC3'],['Case1','Case2']]
>
> But seems "{% for TC in TCs.{{forloop.parentloop.counter0}} %}" is not
> working... That probably because a "forloop" is inside a "for" tag.
> The error message is:
> "Could not parse the remainder: '{{forloop.parentloop.counter}}' from
> 'TCs.{{forloop.parentloop.counter}}'"
>
> Does anybody encounter the same problem with me? Could you help share
> your idea to solve it? Thanks in advance.
>
> Thanks,
> Wally
>
> --
> 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.
>
>


-- 
- Aziz M. Bookwala

Website  | Twitter  |
Github 

-- 
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 to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread Babatunde Akinyanmi
Or alwaysdata.com
They have a free plan

On 5/10/12, doniyor  wrote:
> many thanks eihli, i will follow the steps you gave.. cool, i let you know
> about how it worked..
>
> later
>
>
> Am Donnerstag, 10. Mai 2012 16:13:05 UTC+2 schrieb eihli:
>>
>> This won't be a complete list but it's what I can remember off the top of
>> my head.
>> Things to do:
>> Install Python
>> Install Django
>> Install database software (I chose Postgres. I guess you don't need this
>> if you are using SQLite3).
>> Create database and users and assign permissions.
>> Install mod_wsgi.
>> Edit your apache httpd.conf file to use mod_wsgi:
>> http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>> If you are using apache to serve static html files (like your .css or
>> image files) then you'll need to add an Alias to your apache config.
>> Something like: Alias /myproject/static/
>> /var/www/djangoapps/myproject/media/static
>>
>> Here are some links I bookmarked while trying to set up a VPS with Django:
>>
>> http://www.epicserve.com/blog/2011/nov/3/ubuntu-server-setup-guide-django-websites/
>>
>>
>> http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/
>>
>>
>> http://blog.kevin-whitaker.net/post/725558757/running-django-with-postgres-nginx-and-fastcgi-on
>>
>>
>> http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/
>>
>>
>>
>>
>> On Thursday, 10 May 2012 07:23:11 UTC-5, doniyor wrote:
>>>
>>> Hi there,
>>>
>>> i need a small help: i have a django site, which is ready to test. now i
>>> talked to a hosting service, they had only php and mysql supporting
>>> server,
>>> but not django. they gave me a virtual server, where i can install django
>>>
>>> and put my site there. now i am stuck. i dont know how to install django
>>> on
>>> server and which python modules to install that run my site and where to
>>> install. is there any list of steps to do this kind of job? it would be
>>> very helpful. i just dont find a clue where to start. what i understand
>>> is:
>>> apache is webserver and it is there on server. so i need some module that
>>>
>>> supports python, right? i decided for mod_wsgi. i dont know why i decided
>>>
>>> for this. before that i installed easy_install then i installed all
>>> python
>>> packages including django. now when i log in to server thru Putty
>>> including
>>> switching to root, i land to: domainname: /www/vhtdocs/domainname # and
>>> this folder has some html files of my old site. they just copied from old
>>>
>>> server to this virtual one. now the question is: is it the place where i
>>> can just upload my whole django-site?
>>>
>>> i would be very thanksful for some instructions..
>>>
>>> thanks thanks.
>>>
>>> Doni
>>>
>>
>
> --
> 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/-/n7QkL8SrRTYJ.
> 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.
>
>

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



FileZille Djangosite upload => 550 error: failed to change directory?? why?

2012-05-10 Thread doniyor
Hi There, finally i tried to upload my djangosite, using filezilla. but 
during upload every file upload is throwing error saying: 550 failed to 
change directory. 

what can be the reason? can it be access right which i can change thru 
chmod or so? where is the problem, in my server or in my filezilla? 

thanks 


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/5ytvvCe9WvoJ.
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 psycopg error

2012-05-10 Thread Bhargav Kowshik

On Thursday 10 May 2012 11:05 PM, Mike Di Domenico wrote:

I get no response/error:
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import psycopg2


Thanks for your help,
Mike

On Thursday, May 10, 2012 1:25:29 PM UTC-4, Karl Sutt wrote:

Hello,

Open up a Python shell and try
import psycopg2

And let us know what happens.

Karl Sutt


On Thu, May 10, 2012 at 5:17 PM, Mike Di Domenico<
didomenico.mi...@gmail.com>  wrote:


Good afternoon,
I am working on installing Django to work with a postgresql on ubuntu
10.04 server (32bit). I have postgresql-8.4 installed, Django version 1.5,
python version 2.6.5, and I have the psycopg2 module installed (I think).

I am getting the error "Error: No module named psycopg"

I am doing the command "./manage.py syncdb" and in the settings.py file I
have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I
have tried it with just 'postgresql_psycopg2', both I get the same error.

I have checked to see if psycopg2 is installed by doing the following:
# python

import psycopg2
print(help('modules'))

Please wait a moment while I gather a list of all available modules...

ANSIaptsources  httplib select
BaseHTTPServer  array   httplib2serial
Bastion ast ihooks  sets
CDROM   asynchatimageop setuptools
CGIHTTPServer   asyncoreimaplib sgmllib
Canvas  atexit  imghdr  sha
CommandNotFound audiodevimp shelve
ConfigParseraudioop imputil shlex
Cookie  base64  inspect shutil
DLFCN   bdb io  signal
Dialog  binasciiitertools   simplejson
DistUpgrade binhex  jsonsite
DocXMLRPCServer bisect  keyword sitecustomize
FSM bsddb   landscape   smart
FileDialog  bz2 launchpadlibsmtpd
FixTk   cPickle lazrsmtplib
GnuPGInterface  cProfilelib2to3 snack
HTMLParser  cStringIO   linecache   sndhdr
IN  calendarlinuxaudiodev   socket
LanguageSelectorcgi locale  spwd
MimeWriter  cgitb   logging sqlite3
OpenSSL chunk   lsb_release sre
PAM cmath   macpath sre_compile
Queue   cmd macurl2path sre_constants
ScrolledTextcodemailbox sre_parse
SimpleDialogcodecs  mailcap ssl
SimpleHTTPServercodeop  markupbase  stat
SimpleXMLRPCServer  collections marshal statvfs
SocketServercolorsysmathstring
StringIOcommandsmd5 stringold
TYPES   compileall  mhlib   stringprep
Tix compilermimetools   strop
Tkconstants computerjanitor mimetypes   struct
Tkdnd   contextlib  mimify  subprocess
Tkinter cookielib   mmapsunau
UpdateManager   copymodulefindersunaudio
UserDictcopy_regmultifile   symbol
UserListcrypt   multiprocessing symtable
UserString  csv mutex   sys
_LWPCookieJar   ctypes  netrc   syslog
_MozillaCookieJar   curlnew tabnanny
__builtin__ curses  nis tarfile
__future__  datetimenntplib telnetlib
_abcoll dbhash  ntpath  tempfile
_astdbm nturl2path  termios
_bisect dbusnumbers test
_bsddb  dbus_bindings   oauth   textwrap
_bytesiodebconf opcode  this
_codecs decimal operatorthread
_codecs_cn  difflib optparsethreading
_codecs_hk  dircacheos  time
_codecs_iso2022 dis os2emxpath  timeit
_codecs_jp  distutils   ossaudiodev tkColorChooser
_codecs_kr  django  parser  tkCommonDialog
_codecs_tw  dl  pdb tkFileDialog
_collectionsdoctest

Re: Django psycopg error

2012-05-10 Thread Wally Yu
Not sure if downgrade your psycopg2 version to lower version would be
working, let's say version 2.4.1

Thanks,
Wally


On May 11, 12:17 am, Mike Di Domenico 
wrote:
> Good afternoon,
> I am working on installing Django to work with a postgresql on ubuntu 10.04
> server (32bit). I have postgresql-8.4 installed, Django version 1.5, python
> version 2.6.5, and I have the psycopg2 module installed (I think).
>
> I am getting the error "Error: No module named psycopg"
>
> I am doing the command "./manage.py syncdb" and in the settings.py file I
> have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I
> have tried it with just 'postgresql_psycopg2', both I get the same error.
>
> I have checked to see if psycopg2 is installed by doing the following:
> # python
>
> >>> import psycopg2
> >>> print(help('modules'))
>
> Please wait a moment while I gather a list of all available modules...
>
> ANSI                aptsources          httplib             select
> BaseHTTPServer      array               httplib2            serial
> Bastion             ast                 ihooks              sets
> CDROM               asynchat            imageop             setuptools
> CGIHTTPServer       asyncore            imaplib             sgmllib
> Canvas              atexit              imghdr              sha
> CommandNotFound     audiodev            imp                 shelve
> ConfigParser        audioop             imputil             shlex
> Cookie              base64              inspect             shutil
> DLFCN               bdb                 io                  signal
> Dialog              binascii            itertools           simplejson
> DistUpgrade         binhex              json                site
> DocXMLRPCServer     bisect              keyword             sitecustomize
> FSM                 bsddb               landscape           smart
> FileDialog          bz2                 launchpadlib        smtpd
> FixTk               cPickle             lazr                smtplib
> GnuPGInterface      cProfile            lib2to3             snack
> HTMLParser          cStringIO           linecache           sndhdr
> IN                  calendar            linuxaudiodev       socket
> LanguageSelector    cgi                 locale              spwd
> MimeWriter          cgitb               logging             sqlite3
> OpenSSL             chunk               lsb_release         sre
> PAM                 cmath               macpath             sre_compile
> Queue               cmd                 macurl2path         sre_constants
> ScrolledText        code                mailbox             sre_parse
> SimpleDialog        codecs              mailcap             ssl
> SimpleHTTPServer    codeop              markupbase          stat
> SimpleXMLRPCServer  collections         marshal             statvfs
> SocketServer        colorsys            math                string
> StringIO            commands            md5                 stringold
> TYPES               compileall          mhlib               stringprep
> Tix                 compiler            mimetools           strop
> Tkconstants         computerjanitor     mimetypes           struct
> Tkdnd               contextlib          mimify              subprocess
> Tkinter             cookielib           mmap                sunau
> UpdateManager       copy                modulefinder        sunaudio
> UserDict            copy_reg            multifile           symbol
> UserList            crypt               multiprocessing     symtable
> UserString          csv                 mutex               sys
> _LWPCookieJar       ctypes              netrc               syslog
> _MozillaCookieJar   curl                new                 tabnanny
> __builtin__         curses              nis                 tarfile
> __future__          datetime            nntplib             telnetlib
> _abcoll             dbhash              ntpath              tempfile
> _ast                dbm                 nturl2path          termios
> _bisect             dbus                numbers             test
> _bsddb              dbus_bindings       oauth               textwrap
> _bytesio            debconf             opcode              this
> _codecs             decimal             operator            thread
> _codecs_cn          difflib             optparse            threading
> _codecs_hk          dircache            os                  time
> _codecs_iso2022     dis                 os2emxpath          timeit
> _codecs_jp          distutils           ossaudiodev         tkColorChooser
> _codecs_kr          django              parser              tkCommonDialog
> _codecs_tw          dl                  pdb                 tkFileDialog
> _collections        doctest             pexpect             tkFont
> _csv                dsextras            pickle              tkMessageBox
> _ctypes             dumbdbm             pickletools         tkSimpleDialog
> _ctypes_test

Does Django Template Support Nested Tags?

2012-05-10 Thread Wally Yu
Hi all,

I'm wondering if Django template supports nested tags? Here is my
situation:

My Template:



{% for module in modules %}

Automation Test Result for Test Suite: {{ module}}


{% for TC in 
TCs.{{forloop.parentloop.counter0}} %}
 ... ...

 {% endfor %}
   ... ...
   {% endfor %}

Here are the Lists I'm trying to pass into template:
 - modules = ['module1', 'module2']
 - TCs = [['TC1','TC2','TC3'],['Case1','Case2']]

But seems "{% for TC in TCs.{{forloop.parentloop.counter0}} %}" is not
working... That probably because a "forloop" is inside a "for" tag.
The error message is:
"Could not parse the remainder: '{{forloop.parentloop.counter}}' from
'TCs.{{forloop.parentloop.counter}}'"

Does anybody encounter the same problem with me? Could you help share
your idea to solve it? Thanks in advance.

Thanks,
Wally

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



[OFF TOPIC] Django job on Long Island; $110,000 + bonus

2012-05-10 Thread James Shaughnessy
DealerTrack is looking for a Python/Django Senior developer.
Ideal candidate will have more than 5 years of professional software
development experience building web-based systems.

**Requirements**

* 5 years of development experience, web dev experience a plus
* Experience using Django
* RDBMS experience, Oracle is a plus
* Experience with Java, Mule ESB is a plus

**About the company**

DealerTrack is a leader in OnDemand web solutions for car dealerships
and their financial partners where we value leadership role models at
all levels, teamwork, operational excellence, accountability, client
centricity, innovation and a passion for knowledge.
We're located in Lake Success, NY on Long Island, only 19 miles from
NYC.

**Contact Info:**

**Contact**: James Shaughnessy
**E-mail**: jws...@cornell.edu
**No telecommuting**

-- 
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: Setting current timezone in Django 1.4, and middleware

2012-05-10 Thread peppergrower
I set up a fresh Django 1.4 project and adapted the middleware described in 
the docs; I stored the timezone on the user profile of two different users, 
and logged in as each of them in separate browsers, along with a third 
completely separate window (so I had three different sessions). It appears 
that activate() only persists in a given request/response cycle; it didn't 
bleed through to the unauthenticated window, which wasn't setting its own 
timezone. So something like the middleware in the docs will work nicely for 
my uses, I think.

-- 
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/-/p7Qfxmu7UeoJ.
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: during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-10 Thread Bolkin
It really depends on linux flavor and how you installed apache, some common 
cases:
service httpd restart
service apache2 restart

On Thursday, May 10, 2012 4:01:24 PM UTC-4, doniyor wrote:
>
> Hi there, i need a small help. as the titel says, i cannot restart the 
> apache, i can get the version of apache, so it is there, but i cannot 
> restart it. OS is Linux. what can be the problem, anyone has had experience 
> with this? 
>
> many thanks 
>
> doni 
>
>

-- 
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/-/03Va2hI1h60J.
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.



during putting my djangosite on server, i cannot restart the apache server, apachectl nor apache2 is not found. why?

2012-05-10 Thread doniyor
Hi there, i need a small help. as the titel says, i cannot restart the 
apache, i can get the version of apache, so it is there, but i cannot 
restart it. OS is Linux. what can be the problem, anyone has had experience 
with this? 

many thanks 

doni 

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



Re: How to serve staticfiles with full URL for local development?

2012-05-10 Thread doniyor
if your problem is how to serve your static files, just create a folder 
with name static in your main app, then put all of your static files and 
and your STATIC_URL is /static/. 



Am Samstag, 5. Mai 2012 15:34:47 UTC+2 schrieb e.generalov:
>
> There was a snippet to display a content of response in browser during 
> debugging  http://miniblog.glezos.com/post/3388080372/tests-browser . 
>
> "One of the first issues you might face is seeing a style-less page. 
> This happens becuase the test server isn’t really a web server, and 
> you’re probably serving static files from something relative such as 
> '/ 
> site_media'. The solution is simple: Run a separate Django server and 
> tweak your development-only static URL to something like: 
>
> STATIC_URL = 'http://localhost:8000/site_media/ 
> " 
>
> but this doesn't works anymore, because django.contrib.staticfiles 
> doesn't serve static when STATIC_URL contains full URL. 
>
> I found the node at 
> https://docs.djangoproject.com/en/dev/howto/static-files/#serving-sta... 
> : 
>
> "That's because this view is grossly inefficient and probably 
> insecure. This is only intended for local development, and should 
> never be used in production. 
>
> Additionally, when using staticfiles_urlpatterns your STATIC_URL 
> setting can't be empty or a full URL, such as http://static.example.com/."; 
>
>
> Is there a way to omit this limitation for local development? 
>
>
> (reposted from 
>
> http://groups.google.com/group/django-developers/browse_thread/thread/2dcaab0939455308/c422ab645b335513#c422ab645b335513
> )

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



Re: How to serve staticfiles with full URL for local development?

2012-05-10 Thread e.generalov


On 6 май, 04:41, Reinout van Rees  wrote:
> On 05-05-12 15:34, e.generalov wrote:
>
> > There was a snippet to display a content of response in browser during
> > debugginghttp://miniblog.glezos.com/post/3388080372/tests-browser .
>
> > "One of the first issues you might face is seeing a style-less page.
> > This happens becuase the test server isn t really a web server, and
> > you re probably serving static files from something relative such as
> > '/
> > site_media'. The solution is simple: Run a separate Django server and
> > tweak your development-only static URL to something like:
>
> > STATIC_URL = 'http://localhost:8000/site_media/
> > "
>
> > but this doesn't works anymore, because django.contrib.staticfiles
> > doesn't serve static when STATIC_URL contains full URL.
>
> I don't have any problems with static stuff. The solution is probably
> simply to not include any hostname. What I have (on the server and
> locally on my development box):
>
> STATIC_URL = '/static_media/'

In order for static files at the temporary saved page,
become accessible to the browser,
them urls must be a full.

-- /tmp/pageXXX.html --

http://localhost:8080/static/img.png";>

(this suggestion has discribed at the sinppet's page).

>
> In case it still doesn't work: you probably use something else than the
> standard runserver. In that 
> case,https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/#django...
> applies. You have to add that to your urls.py. But normally, you don't
> have to.

I see the code at 
https://github.com/django/django/blob/master/django/contrib/staticfiles/handlers.py#L31
, and it looks like
the STATIC_URL checking logic is hardcoded to the handler.

When `django.contrib.staticfiles` is added to INSTALLED_APPS, it
overrides the standard `runserver` command and use
specialized WSGIHandler to serve static files. It is not possible to
change any behavior of this handler with standard
django's request handling tools (urls.py, middlewares, views), because
handler works before them all.


>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
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: Custom field names in ModelForm

2012-05-10 Thread Rajeesh Nair


> Is there a way to customize the field name (not just label) while creating 
> a ModelForm?
>
>
Override the change_form template for the concerned model and put the label 
for the field 
in whatever way you like. Check out the django-templates documentation to 
know how to 
do this.

-- 
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/-/lKCtxnQu4FsJ.
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 HttpResponse performance with mimetype=application/atom+xml or text/xml

2012-05-10 Thread Vinuta Shetty
Was your issue resolved? I am having a similar problem. I am rendering a 
PDF document and it takes forever. Not sure why?

On Monday, March 29, 2010 8:21:47 AM UTC-7, serjant wrote:
>
> Hi all.
>
> Can somebody help me and point me to solving the following problem:
>
> 1. I am writing an application where I render the needed information
> in the XML file (to be more specific GeoRSS)
> 2. I am generating the GeoRSS with the means of the GeoAtom1RSS django
> class, and passing it to HttpResponse in this way:
>
> response = HttpResponse(mimetype='application/atom+xml')
> geoFeed.write(response, encoding)  #geoFeed is the generated GeoRSS
> return response
>
> So the problem is time rendering of this XML file in browser. When I
> want to see the generated RSS or XML in borwser, then the rendering is
> too slow, takes at least 25-40 seconds.
> I wrote a TestCase, where i found that the generator is not to blame
> at all, cuz selecting data from the database and generating GeoRSS
> with it takes 2-3 seconds maximum (avg: 1.5 seconds) in case the data
> is so huge.
> By switching the mimetype to text/html, the performance was really
> good and stopped at 3 seconds of the rendering.
>
> Is there any way to increase the speed of the GeoRSS or XML rendering
> with HttpResponse?
> Is that a known issue?
>
> Thanks in advance
> David
>
>

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



unique key error doesn't show using copy record in modelform.

2012-05-10 Thread Min Hong Tan
hi,

my scenario as below:
- I want to copy existing record and show at the form. then clear the pk
and id then it will be able to "add" instead of "update".
- all working fine. but, if the record is exist (Unique error).  it should
prompt unique key 's error.  but, in the form.is_valid
   has no trigger the error. untill the cmodel.save() only it throw
exception.  but, the form doesn't render the error message.

if without using "form = ProgramTypeForm(request.POST or
None,instance=dataObject)"  and use "form = ProgramTypeForm(request.POST or
None)",
then, it will be false if we run form.is_valid() else, it will True if we
execute form.is_valid() , or maybe my method are incorrect?

below are the coding:

__
models.py
__

class ProgramType(Standard):
pt_type = models.CharField('Program Type',
max_length=20,blank=False,unique=True)
pt_desc = models.CharField('Program Description',max_length=100)

def __unicode__(self):
return self.pt_type

class Meta:
unique_together = (('pt_type'),)

__
views.py

def form_copy(request,id_key):
dataObject = get_object_or_404(ProgramType,pk=id_key)
dataObject.pk = None
dataObject.id = None
form = ProgramTypeForm(request.POST or None,instance=dataObject)
if form.is_valid():
try:
cmodel = form.save(commit=False)
cmodel.id = None
cmodel.pk = None
cmodel.save()# < *here is the error*
 except:
  # do exception
 finally:
  # do finally
 else:
 # return form invalid render.
__
forms.py

class ProgramTypeForm(ModelForm):
pt_desc = forms.CharField(widget=forms.Textarea(attrs = {'class':
"page-text", 'cols': 30, 'rows': 10}), label='Description')
class Meta(CommonForm.Meta):
model = ProgramType


Regards,
MH

-- 
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 to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread doniyor
many thanks eihli, i will follow the steps you gave.. cool, i let you know 
about how it worked..  

later 
 

Am Donnerstag, 10. Mai 2012 16:13:05 UTC+2 schrieb eihli:
>
> This won't be a complete list but it's what I can remember off the top of 
> my head.
> Things to do:
> Install Python
> Install Django
> Install database software (I chose Postgres. I guess you don't need this 
> if you are using SQLite3).
> Create database and users and assign permissions.
> Install mod_wsgi.
> Edit your apache httpd.conf file to use mod_wsgi: 
> http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
> If you are using apache to serve static html files (like your .css or 
> image files) then you'll need to add an Alias to your apache config. 
> Something like: Alias /myproject/static/ 
> /var/www/djangoapps/myproject/media/static
>
> Here are some links I bookmarked while trying to set up a VPS with Django:
>
> http://www.epicserve.com/blog/2011/nov/3/ubuntu-server-setup-guide-django-websites/
>  
>
> http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/
>  
>
> http://blog.kevin-whitaker.net/post/725558757/running-django-with-postgres-nginx-and-fastcgi-on
>  
>
> http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/
>  
>
>
>
> On Thursday, 10 May 2012 07:23:11 UTC-5, doniyor wrote:
>>
>> Hi there, 
>>
>> i need a small help: i have a django site, which is ready to test. now i 
>> talked to a hosting service, they had only php and mysql supporting server, 
>> but not django. they gave me a virtual server, where i can install django 
>> and put my site there. now i am stuck. i dont know how to install django on 
>> server and which python modules to install that run my site and where to 
>> install. is there any list of steps to do this kind of job? it would be 
>> very helpful. i just dont find a clue where to start. what i understand is: 
>> apache is webserver and it is there on server. so i need some module that 
>> supports python, right? i decided for mod_wsgi. i dont know why i decided 
>> for this. before that i installed easy_install then i installed all python 
>> packages including django. now when i log in to server thru Putty including 
>> switching to root, i land to: domainname: /www/vhtdocs/domainname # and 
>> this folder has some html files of my old site. they just copied from old 
>> server to this virtual one. now the question is: is it the place where i 
>> can just upload my whole django-site? 
>>
>> i would be very thanksful for some instructions.. 
>>
>> thanks thanks.
>>
>> Doni 
>>
>

-- 
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/-/n7QkL8SrRTYJ.
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 psycopg error

2012-05-10 Thread Lucas Xavier
Make shure you have psycopg2 module installed on the same path as python.
--
Atenciosamente,

Lucas Xavier


2012/5/10 Mike Di Domenico 

> Good afternoon,
> I am working on installing Django to work with a postgresql on ubuntu
> 10.04 server (32bit). I have postgresql-8.4 installed, Django version 1.5,
> python version 2.6.5, and I have the psycopg2 module installed (I think).
>
> I am getting the error "Error: No module named psycopg"
>
> I am doing the command "./manage.py syncdb" and in the settings.py file I
> have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I
> have tried it with just 'postgresql_psycopg2', both I get the same error.
>
> I have checked to see if psycopg2 is installed by doing the following:
> # python
> >>> import psycopg2
> >>> print(help('modules'))
>
> Please wait a moment while I gather a list of all available modules...
>
> ANSIaptsources  httplib select
> BaseHTTPServer  array   httplib2serial
> Bastion ast ihooks  sets
> CDROM   asynchatimageop setuptools
> CGIHTTPServer   asyncoreimaplib sgmllib
> Canvas  atexit  imghdr  sha
> CommandNotFound audiodevimp shelve
> ConfigParseraudioop imputil shlex
> Cookie  base64  inspect shutil
> DLFCN   bdb io  signal
> Dialog  binasciiitertools   simplejson
> DistUpgrade binhex  jsonsite
> DocXMLRPCServer bisect  keyword sitecustomize
> FSM bsddb   landscape   smart
> FileDialog  bz2 launchpadlibsmtpd
> FixTk   cPickle lazrsmtplib
> GnuPGInterface  cProfilelib2to3 snack
> HTMLParser  cStringIO   linecache   sndhdr
> IN  calendarlinuxaudiodev   socket
> LanguageSelectorcgi locale  spwd
> MimeWriter  cgitb   logging sqlite3
> OpenSSL chunk   lsb_release sre
> PAM cmath   macpath sre_compile
> Queue   cmd macurl2path sre_constants
> ScrolledTextcodemailbox sre_parse
> SimpleDialogcodecs  mailcap ssl
> SimpleHTTPServercodeop  markupbase  stat
> SimpleXMLRPCServer  collections marshal statvfs
> SocketServercolorsysmathstring
> StringIOcommandsmd5 stringold
> TYPES   compileall  mhlib   stringprep
> Tix compilermimetools   strop
> Tkconstants computerjanitor mimetypes   struct
> Tkdnd   contextlib  mimify  subprocess
> Tkinter cookielib   mmapsunau
> UpdateManager   copymodulefindersunaudio
> UserDictcopy_regmultifile   symbol
> UserListcrypt   multiprocessing symtable
> UserString  csv mutex   sys
> _LWPCookieJar   ctypes  netrc   syslog
> _MozillaCookieJar   curlnew tabnanny
> __builtin__ curses  nis tarfile
> __future__  datetimenntplib telnetlib
> _abcoll dbhash  ntpath  tempfile
> _astdbm nturl2path  termios
> _bisect dbusnumbers test
> _bsddb  dbus_bindings   oauth   textwrap
> _bytesiodebconf opcode  this
> _codecs decimal operatorthread
> _codecs_cn  difflib optparsethreading
> _codecs_hk  dircacheos  time
> _codecs_iso2022 dis os2emxpath  timeit
> _codecs_jp  distutils   ossaudiodev tkColorChooser
> _codecs_kr  django  parser  tkCommonDialog
> _codecs_tw  dl  pdb tkFileDialog
> _collectionsdoctest pexpect tkFont
> _csvdsextraspickle  tkMessageBox
> _ctypes dumbdbm pickletools tkSimpleDialog
> _ctypes_testdummy_threadpi

Re: Django psycopg error

2012-05-10 Thread Mike Di Domenico
I get no response/error: 
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> 

Thanks for your help,
Mike

On Thursday, May 10, 2012 1:25:29 PM UTC-4, Karl Sutt wrote:
>
> Hello,
>
> Open up a Python shell and try
> import psycopg2
>
> And let us know what happens.
>
> Karl Sutt
>
>
> On Thu, May 10, 2012 at 5:17 PM, Mike Di Domenico <
> didomenico.mi...@gmail.com> wrote:
>
>> Good afternoon, 
>> I am working on installing Django to work with a postgresql on ubuntu 
>> 10.04 server (32bit). I have postgresql-8.4 installed, Django version 1.5, 
>> python version 2.6.5, and I have the psycopg2 module installed (I think).
>>
>> I am getting the error "Error: No module named psycopg"
>>
>> I am doing the command "./manage.py syncdb" and in the settings.py file I 
>> have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I 
>> have tried it with just 'postgresql_psycopg2', both I get the same error. 
>>
>> I have checked to see if psycopg2 is installed by doing the following:
>> # python
>> >>> import psycopg2
>> >>> print(help('modules'))
>>
>> Please wait a moment while I gather a list of all available modules...
>>
>> ANSIaptsources  httplib select
>> BaseHTTPServer  array   httplib2serial
>> Bastion ast ihooks  sets
>> CDROM   asynchatimageop setuptools
>> CGIHTTPServer   asyncoreimaplib sgmllib
>> Canvas  atexit  imghdr  sha
>> CommandNotFound audiodevimp shelve
>> ConfigParseraudioop imputil shlex
>> Cookie  base64  inspect shutil
>> DLFCN   bdb io  signal
>> Dialog  binasciiitertools   simplejson
>> DistUpgrade binhex  jsonsite
>> DocXMLRPCServer bisect  keyword sitecustomize
>> FSM bsddb   landscape   smart
>> FileDialog  bz2 launchpadlibsmtpd
>> FixTk   cPickle lazrsmtplib
>> GnuPGInterface  cProfilelib2to3 snack
>> HTMLParser  cStringIO   linecache   sndhdr
>> IN  calendarlinuxaudiodev   socket
>> LanguageSelectorcgi locale  spwd
>> MimeWriter  cgitb   logging sqlite3
>> OpenSSL chunk   lsb_release sre
>> PAM cmath   macpath sre_compile
>> Queue   cmd macurl2path sre_constants
>> ScrolledTextcodemailbox sre_parse
>> SimpleDialogcodecs  mailcap ssl
>> SimpleHTTPServercodeop  markupbase  stat
>> SimpleXMLRPCServer  collections marshal statvfs
>> SocketServercolorsysmathstring
>> StringIOcommandsmd5 stringold
>> TYPES   compileall  mhlib   stringprep
>> Tix compilermimetools   strop
>> Tkconstants computerjanitor mimetypes   struct
>> Tkdnd   contextlib  mimify  subprocess
>> Tkinter cookielib   mmapsunau
>> UpdateManager   copymodulefindersunaudio
>> UserDictcopy_regmultifile   symbol
>> UserListcrypt   multiprocessing symtable
>> UserString  csv mutex   sys
>> _LWPCookieJar   ctypes  netrc   syslog
>> _MozillaCookieJar   curlnew tabnanny
>> __builtin__ curses  nis tarfile
>> __future__  datetimenntplib telnetlib
>> _abcoll dbhash  ntpath  tempfile
>> _astdbm nturl2path  termios
>> _bisect dbusnumbers test
>> _bsddb  dbus_bindings   oauth   textwrap
>> _bytesiodebconf opcode  this
>> _codecs decimal operatorthread
>> _codecs_cn  difflib optparsethreading
>> _codecs_hk  dircacheos  time
>> _codecs_iso2022 dis os2emxpath  timeit
>> _codecs_jp  distutils   ossaudiodev 

Re: Django psycopg error

2012-05-10 Thread Karl Sutt
Hello,

Open up a Python shell and try
import psycopg2

And let us know what happens.

Karl Sutt


On Thu, May 10, 2012 at 5:17 PM, Mike Di Domenico <
didomenico.mi...@gmail.com> wrote:

> Good afternoon,
> I am working on installing Django to work with a postgresql on ubuntu
> 10.04 server (32bit). I have postgresql-8.4 installed, Django version 1.5,
> python version 2.6.5, and I have the psycopg2 module installed (I think).
>
> I am getting the error "Error: No module named psycopg"
>
> I am doing the command "./manage.py syncdb" and in the settings.py file I
> have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I
> have tried it with just 'postgresql_psycopg2', both I get the same error.
>
> I have checked to see if psycopg2 is installed by doing the following:
> # python
> >>> import psycopg2
> >>> print(help('modules'))
>
> Please wait a moment while I gather a list of all available modules...
>
> ANSIaptsources  httplib select
> BaseHTTPServer  array   httplib2serial
> Bastion ast ihooks  sets
> CDROM   asynchatimageop setuptools
> CGIHTTPServer   asyncoreimaplib sgmllib
> Canvas  atexit  imghdr  sha
> CommandNotFound audiodevimp shelve
> ConfigParseraudioop imputil shlex
> Cookie  base64  inspect shutil
> DLFCN   bdb io  signal
> Dialog  binasciiitertools   simplejson
> DistUpgrade binhex  jsonsite
> DocXMLRPCServer bisect  keyword sitecustomize
> FSM bsddb   landscape   smart
> FileDialog  bz2 launchpadlibsmtpd
> FixTk   cPickle lazrsmtplib
> GnuPGInterface  cProfilelib2to3 snack
> HTMLParser  cStringIO   linecache   sndhdr
> IN  calendarlinuxaudiodev   socket
> LanguageSelectorcgi locale  spwd
> MimeWriter  cgitb   logging sqlite3
> OpenSSL chunk   lsb_release sre
> PAM cmath   macpath sre_compile
> Queue   cmd macurl2path sre_constants
> ScrolledTextcodemailbox sre_parse
> SimpleDialogcodecs  mailcap ssl
> SimpleHTTPServercodeop  markupbase  stat
> SimpleXMLRPCServer  collections marshal statvfs
> SocketServercolorsysmathstring
> StringIOcommandsmd5 stringold
> TYPES   compileall  mhlib   stringprep
> Tix compilermimetools   strop
> Tkconstants computerjanitor mimetypes   struct
> Tkdnd   contextlib  mimify  subprocess
> Tkinter cookielib   mmapsunau
> UpdateManager   copymodulefindersunaudio
> UserDictcopy_regmultifile   symbol
> UserListcrypt   multiprocessing symtable
> UserString  csv mutex   sys
> _LWPCookieJar   ctypes  netrc   syslog
> _MozillaCookieJar   curlnew tabnanny
> __builtin__ curses  nis tarfile
> __future__  datetimenntplib telnetlib
> _abcoll dbhash  ntpath  tempfile
> _astdbm nturl2path  termios
> _bisect dbusnumbers test
> _bsddb  dbus_bindings   oauth   textwrap
> _bytesiodebconf opcode  this
> _codecs decimal operatorthread
> _codecs_cn  difflib optparsethreading
> _codecs_hk  dircacheos  time
> _codecs_iso2022 dis os2emxpath  timeit
> _codecs_jp  distutils   ossaudiodev tkColorChooser
> _codecs_kr  django  parser  tkCommonDialog
> _codecs_tw  dl  pdb tkFileDialog
> _collectionsdoctest pexpect tkFont
> _csvdsextraspickle  tkMessageBox
> _ctypes dumbdbm pickletools tkSimpleDi

Django psycopg error

2012-05-10 Thread Mike Di Domenico
Good afternoon, 
I am working on installing Django to work with a postgresql on ubuntu 10.04 
server (32bit). I have postgresql-8.4 installed, Django version 1.5, python 
version 2.6.5, and I have the psycopg2 module installed (I think).

I am getting the error "Error: No module named psycopg"

I am doing the command "./manage.py syncdb" and in the settings.py file I 
have set DATABASE_ENGINE to 'django.db.backends.postgresql_psycopg2' and I 
have tried it with just 'postgresql_psycopg2', both I get the same error. 

I have checked to see if psycopg2 is installed by doing the following:
# python
>>> import psycopg2
>>> print(help('modules'))

Please wait a moment while I gather a list of all available modules...

ANSIaptsources  httplib select
BaseHTTPServer  array   httplib2serial
Bastion ast ihooks  sets
CDROM   asynchatimageop setuptools
CGIHTTPServer   asyncoreimaplib sgmllib
Canvas  atexit  imghdr  sha
CommandNotFound audiodevimp shelve
ConfigParseraudioop imputil shlex
Cookie  base64  inspect shutil
DLFCN   bdb io  signal
Dialog  binasciiitertools   simplejson
DistUpgrade binhex  jsonsite
DocXMLRPCServer bisect  keyword sitecustomize
FSM bsddb   landscape   smart
FileDialog  bz2 launchpadlibsmtpd
FixTk   cPickle lazrsmtplib
GnuPGInterface  cProfilelib2to3 snack
HTMLParser  cStringIO   linecache   sndhdr
IN  calendarlinuxaudiodev   socket
LanguageSelectorcgi locale  spwd
MimeWriter  cgitb   logging sqlite3
OpenSSL chunk   lsb_release sre
PAM cmath   macpath sre_compile
Queue   cmd macurl2path sre_constants
ScrolledTextcodemailbox sre_parse
SimpleDialogcodecs  mailcap ssl
SimpleHTTPServercodeop  markupbase  stat
SimpleXMLRPCServer  collections marshal statvfs
SocketServercolorsysmathstring
StringIOcommandsmd5 stringold
TYPES   compileall  mhlib   stringprep
Tix compilermimetools   strop
Tkconstants computerjanitor mimetypes   struct
Tkdnd   contextlib  mimify  subprocess
Tkinter cookielib   mmapsunau
UpdateManager   copymodulefindersunaudio
UserDictcopy_regmultifile   symbol
UserListcrypt   multiprocessing symtable
UserString  csv mutex   sys
_LWPCookieJar   ctypes  netrc   syslog
_MozillaCookieJar   curlnew tabnanny
__builtin__ curses  nis tarfile
__future__  datetimenntplib telnetlib
_abcoll dbhash  ntpath  tempfile
_astdbm nturl2path  termios
_bisect dbusnumbers test
_bsddb  dbus_bindings   oauth   textwrap
_bytesiodebconf opcode  this
_codecs decimal operatorthread
_codecs_cn  difflib optparsethreading
_codecs_hk  dircacheos  time
_codecs_iso2022 dis os2emxpath  timeit
_codecs_jp  distutils   ossaudiodev tkColorChooser
_codecs_kr  django  parser  tkCommonDialog
_codecs_tw  dl  pdb tkFileDialog
_collectionsdoctest pexpect tkFont
_csvdsextraspickle  tkMessageBox
_ctypes dumbdbm pickletools tkSimpleDialog
_ctypes_testdummy_threadpip toaiff
_curses dummy_threading pipes   token
_curses_panel   easy_installpkg_resources   tokenize
_dbus_bindings  email   pkgutil trace
_dbus_glib_bindings encodings   platform   

Re: Only Two Users Get : Forbidden (403) CSRF verification failed. Request aborted. Options

2012-05-10 Thread Nikolas Stevenson-Molnar
Django uses cookies for CSRF. Is it possible these two users have
cookies disabled?
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-works

_Nik

On 5/10/2012 7:56 AM, Johan wrote:
> Hi
>
> Does anybody maybee have some pointers for me? I have a site up and
> running and it has worked perfectly for hundreds of users. Except that
> today I got two users (from the same company, although others from the
> same company has used it perfectly well) who are getting the [CSRF
> verification failed] issue. I have looked in my access.log and it
> seems like all the requests around the time of the failure is coming
> from the same IP so I don't suspect a genuine CSRF. Also I know that
> the coding is according to the documentation because so many others
> has used this same form without any issues. Any help or hints would be
> appreciated 
>
> Thanks
>

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



Distinct queries and order_by

2012-05-10 Thread David
Hello

With a distinct query I understand the need to make the column that is 
required to be distinct the first column to order by.

eg:

lm = Modification.objects.select_related().distinct('object_id').filter(
content_type=topic_ct
).exclude(action=2).order_by('object_id', '-modified_on')

Having done the above, I need to reorder the resultset by modified_on and 
remove the object_id order. Is this possible? Do I need to take a copy of 
the queryset and order that?

Thank you for any assistance

-- 
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/-/g9J4DZXYj-kJ.
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: Question regarding Generic Foreign Keys and relations

2012-05-10 Thread David
Just an update, the following got me on the right track.  
http://blog.roseman.org.uk/2010/02/22/django-patterns-part-4-forwards-generic-relations/

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



Re: Best Practices for Changing Data Model

2012-05-10 Thread George Silva
Hi Mark,

There are some projects that aim to reduce friction in this process. I
recommend that you take a look at django-south.

It can handle all of that plus some other interesting things, using
administration commands.

On Thu, May 10, 2012 at 12:28 PM, Mark Phillips
wrote:

> I am new to django, and I was wondering what are the best practices for
> making changes to the data model? These are some scenarios, and I would
> appreciate feedback on my approach
>
> 1. Adding new class to models.py - run syncdb, and the new tables will be
> loaded
>
> 2. Add fields to existing class - drop the tables in the database (or drop
> the database) and run syncdb. The downside is the loss of all the test
> data. Perhaps use dumpdata, edit by hand to add the new fields, and then
> use loaddata?
>
> 3. Add methods to existing class - same as #2 because they are not picked
> up with syncdb?
>
> Are there better ways to handle these scenarios?
>
> Thanks,
>
> Mark
>
> --
> 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.
>



-- 
George R. C. Silva

Desenvolvimento em GIS
http://geoprocessamento.net
http://blog.geoprocessamento.net

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



Best Practices for Changing Data Model

2012-05-10 Thread Mark Phillips
I am new to django, and I was wondering what are the best practices for
making changes to the data model? These are some scenarios, and I would
appreciate feedback on my approach

1. Adding new class to models.py - run syncdb, and the new tables will be
loaded

2. Add fields to existing class - drop the tables in the database (or drop
the database) and run syncdb. The downside is the loss of all the test
data. Perhaps use dumpdata, edit by hand to add the new fields, and then
use loaddata?

3. Add methods to existing class - same as #2 because they are not picked
up with syncdb?

Are there better ways to handle these scenarios?

Thanks,

Mark

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



SlugField and Slugify Problem

2012-05-10 Thread Halit
Hi.I'm creating to free time project on Django.

And,I'm using " SlugField " on my models.(to post url)

Also,I'm using " Slugify " template tag on my template.

If my title is = " Deneme Başlık", slug = " deneme-baslik "

But,if i use in my template to = {{ title|slugify }} = "deneme-baslk"

Delete to "ı" characters.This article has my problem(http://
gokmengorgen.net/post/detail/djangoda-turkce-destekli-slugify/)

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



Only Two Users Get : Forbidden (403) CSRF verification failed. Request aborted. Options

2012-05-10 Thread Johan
Hi

Does anybody maybee have some pointers for me? I have a site up and
running and it has worked perfectly for hundreds of users. Except that
today I got two users (from the same company, although others from the
same company has used it perfectly well) who are getting the [CSRF
verification failed] issue. I have looked in my access.log and it
seems like all the requests around the time of the failure is coming
from the same IP so I don't suspect a genuine CSRF. Also I know that
the coding is according to the documentation because so many others
has used this same form without any issues. Any help or hints would be
appreciated 

Thanks

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



Re: i need to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread Andre Terra
Or just deploy on heroku

http://heroku.com


Cheers,
AT


On Thu, May 10, 2012 at 11:13 AM, eihli  wrote:

> This won't be a complete list but it's what I can remember off the top of
> my head.
> Things to do:
> Install Python
> Install Django
> Install database software (I chose Postgres. I guess you don't need this
> if you are using SQLite3).
> Create database and users and assign permissions.
> Install mod_wsgi.
> Edit your apache httpd.conf file to use mod_wsgi:
> http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
> If you are using apache to serve static html files (like your .css or
> image files) then you'll need to add an Alias to your apache config.
> Something like: Alias /myproject/static/
> /var/www/djangoapps/myproject/media/static
>
> Here are some links I bookmarked while trying to set up a VPS with Django:
>
> http://www.epicserve.com/blog/2011/nov/3/ubuntu-server-setup-guide-django-websites/
>
>
> http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/
>
>
> http://blog.kevin-whitaker.net/post/725558757/running-django-with-postgres-nginx-and-fastcgi-on
>
>
> http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/
>
>
>
>
> On Thursday, 10 May 2012 07:23:11 UTC-5, doniyor wrote:
>>
>> Hi there,
>>
>> i need a small help: i have a django site, which is ready to test. now i
>> talked to a hosting service, they had only php and mysql supporting server,
>> but not django. they gave me a virtual server, where i can install django
>> and put my site there. now i am stuck. i dont know how to install django on
>> server and which python modules to install that run my site and where to
>> install. is there any list of steps to do this kind of job? it would be
>> very helpful. i just dont find a clue where to start. what i understand is:
>> apache is webserver and it is there on server. so i need some module that
>> supports python, right? i decided for mod_wsgi. i dont know why i decided
>> for this. before that i installed easy_install then i installed all python
>> packages including django. now when i log in to server thru Putty including
>> switching to root, i land to: domainname: /www/vhtdocs/domainname # and
>> this folder has some html files of my old site. they just copied from old
>> server to this virtual one. now the question is: is it the place where i
>> can just upload my whole django-site?
>>
>> i would be very thanksful for some instructions..
>>
>> thanks thanks.
>>
>> Doni
>>
>  --
> 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/-/3jzFFzJ9KoEJ.
>
> 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: Model reversion

2012-05-10 Thread francescortiz
Well, creation and deletion should be tracket. Also, binary items should be 
purged once versions are purged, not before.

On Thursday, May 10, 2012 8:19:51 AM UTC+2, Alireza wrote:
>
> Thanks for your reply and the link.
>
> But what about binary items, i mean files. should we keep eyes on them, 
> and if user delete them we should not delete them and just hide them?
> Or reversion is just about text and text ?
>
> And something else, reversion model shoulda trace the creator of the 
> changes or no it shoulda just keep model's changes?
>
>
> On Wednesday, May 9, 2012 11:37:10 PM UTC+4, francescortiz wrote:
>>
>> Json and difflib won't work well together, unless you make a diff per 
>> field, which will add overhead. Look at 
>> http://stackoverflow.com/questions/4599456/textually-diffing-json
>>
>> Reverting is returning to a previous state. Just run all diffs from the 
>> first commit until you reach the desired state.
>>
>> It would be great that it showed side by side the older an newer values 
>> of each field in a table view and let you choose what you want to revert. 
>> Maybe text fields on the left, values on the right and a copy button on 
>> each side.
>>
>> Don't forget about foreign keys. A reversion might imply restoring a 
>> deleted item.
>>
>>
>> On Wednesday, May 9, 2012 3:15:06 PM UTC+2, Alireza wrote:
>>>
>>> Hi
>>> First of all i know there is a plugable app called *django-reversion*, 
>>> leave it now!
>>>
>>> I like to discus about some idea to implement a simple reversion app. i 
>>> have couple of thoughts about it, all i need is just another people's ideas 
>>> about it.
>>>
>>> If i'm wrong correct me!
>>> The model that used to keep history|changes, is a generic model and of 
>>> course powered by *ContentType *[framework|app], and revision should be 
>>> done in tracking the changes in git way, not svn-like which make a copy of 
>>> the changed file.
>>> And of course data should be saved in JSON format, thanks to simple 
>>> json! ( using django signals to keep eyes on model changes )
>>> Different between the models can be handled by *difflib*!
>>> Okay yet theoretically is not a big implementation!
>>> But the main point and important step is reverting, which i don't have 
>>> clear idea about it!
>>> And i know i probably missed couple of things there.
>>>
>>> i like to know your [idea|suggestion|advice]!
>>> Thanks!
>>>
>>
> On Wednesday, May 9, 2012 11:37:10 PM UTC+4, francescortiz wrote:
>>
>> Json and difflib won't work well together, unless you make a diff per 
>> field, which will add overhead. Look at 
>> http://stackoverflow.com/questions/4599456/textually-diffing-json
>>
>> Reverting is returning to a previous state. Just run all diffs from the 
>> first commit until you reach the desired state.
>>
>> It would be great that it showed side by side the older an newer values 
>> of each field in a table view and let you choose what you want to revert. 
>> Maybe text fields on the left, values on the right and a copy button on 
>> each side.
>>
>> Don't forget about foreign keys. A reversion might imply restoring a 
>> deleted item.
>>
>>
>> On Wednesday, May 9, 2012 3:15:06 PM UTC+2, Alireza wrote:
>>>
>>> Hi
>>> First of all i know there is a plugable app called *django-reversion*, 
>>> leave it now!
>>>
>>> I like to discus about some idea to implement a simple reversion app. i 
>>> have couple of thoughts about it, all i need is just another people's ideas 
>>> about it.
>>>
>>> If i'm wrong correct me!
>>> The model that used to keep history|changes, is a generic model and of 
>>> course powered by *ContentType *[framework|app], and revision should be 
>>> done in tracking the changes in git way, not svn-like which make a copy of 
>>> the changed file.
>>> And of course data should be saved in JSON format, thanks to simple 
>>> json! ( using django signals to keep eyes on model changes )
>>> Different between the models can be handled by *difflib*!
>>> Okay yet theoretically is not a big implementation!
>>> But the main point and important step is reverting, which i don't have 
>>> clear idea about it!
>>> And i know i probably missed couple of things there.
>>>
>>> i like to know your [idea|suggestion|advice]!
>>> Thanks!
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/1sWbZKe7PSkJ.
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 to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread eihli
This won't be a complete list but it's what I can remember off the top of 
my head.
Things to do:
Install Python
Install Django
Install database software (I chose Postgres. I guess you don't need this if 
you are using SQLite3).
Create database and users and assign permissions.
Install mod_wsgi.
Edit your apache httpd.conf file to use mod_wsgi: 
http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
If you are using apache to serve static html files (like your .css or image 
files) then you'll need to add an Alias to your apache config. Something 
like: Alias /myproject/static/ /var/www/djangoapps/myproject/media/static

Here are some links I bookmarked while trying to set up a VPS with Django:
http://www.epicserve.com/blog/2011/nov/3/ubuntu-server-setup-guide-django-websites/
 
http://bailey.st/blog/2012/05/02/ubuntu-django-postgresql-and-nginx-a-rock-solid-web-stack/
 
http://blog.kevin-whitaker.net/post/725558757/running-django-with-postgres-nginx-and-fastcgi-on
 
http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/
 



On Thursday, 10 May 2012 07:23:11 UTC-5, doniyor wrote:
>
> Hi there, 
>
> i need a small help: i have a django site, which is ready to test. now i 
> talked to a hosting service, they had only php and mysql supporting server, 
> but not django. they gave me a virtual server, where i can install django 
> and put my site there. now i am stuck. i dont know how to install django on 
> server and which python modules to install that run my site and where to 
> install. is there any list of steps to do this kind of job? it would be 
> very helpful. i just dont find a clue where to start. what i understand is: 
> apache is webserver and it is there on server. so i need some module that 
> supports python, right? i decided for mod_wsgi. i dont know why i decided 
> for this. before that i installed easy_install then i installed all python 
> packages including django. now when i log in to server thru Putty including 
> switching to root, i land to: domainname: /www/vhtdocs/domainname # and 
> this folder has some html files of my old site. they just copied from old 
> server to this virtual one. now the question is: is it the place where i 
> can just upload my whole django-site? 
>
> i would be very thanksful for some instructions.. 
>
> thanks thanks.
>
> Doni 
>

-- 
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/-/3jzFFzJ9KoEJ.
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.



Custom field names in ModelForm

2012-05-10 Thread Bhashkar Sharma
Is there a way to customize the field name (not just label) while creating 
a ModelForm?

Eg. for the model:

class Book(models.Model):
title = models.CharField(max_length=256, db_index=True)
author = models.CharField(max_length=512, db_index=True)
published = models.DateTimeField(db_index=True)


the ModelForm can be:


class BookForm(forms.ModelForm):

fields = ('title', 'author')


Is there a way I can expose 'title' as 'book_name'? As in, the form HTML should 
have:


book_name:

Author:

-- 
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/-/aUOMVI85ftoJ.
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: Apache does not display a flash file

2012-05-10 Thread atul khairnar
Sorry for dumping all Error Log.

The relevant part of log shows:

Error Log Shows : [19:09:24.001] GET 
http://127.0.0.1/site_media/flash/flashvortex.swf
[HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]



On May 10, 6:41 pm, atul khairnar  wrote:
> Error Log Shows : [19:09:24.001] 
> GEThttp://127.0.0.1/site_media/flash/flashvortex.swf
> [HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]
>
> [19:09:23.104] GEThttp://127.0.0.1/play/[HTTP/1.1 200 OK 166ms]
> [19:09:23.344] GEThttp://127.0.0.1/site_media/style1.css[HTTP/1.1
> 200 OK 4ms]
> [19:09:23.373] Expected declaration but found '/'.  Skipped to next
> declaration. @http://127.0.0.1/site_media/style1.css:9
> [19:09:23.383] Expected ':' but found '#DBDBDB'.  Declaration dropped.
> @http://127.0.0.1/site_media/style1.css:14
> [19:09:23.476] Error in parsing value for 'background-image'.
> Declaration dropped. @http://127.0.0.1/site_media/style1.css:68
> [19:09:23.553] Error in parsing value for 'filter'.  Declaration
> dropped. @http://127.0.0.1/site_media/style1.css:135
> [19:09:23.651] Error in parsing value for 'margin-left'.  Declaration
> dropped. @http://127.0.0.1/site_media/style1.css:229
> [19:09:23.791] GEThttp://127.0.0.1/site_media/images/Back.jpg[HTTP/
> 1.1 304 NOT MODIFIED 2ms]
> [19:09:23.805] GEThttp://127.0.0.1/site_media/images/Button.png[HTTP/
> 1.1 304 NOT MODIFIED 3ms]
> [19:09:23.929] GEThttp://127.0.0.1/site_media/fonts/MyriadPro-Regular.otf
> [HTTP/1.1 304 NOT MODIFIED 2ms]
> [19:09:24.001] GEThttp://127.0.0.1/site_media/flash/flashvortex.swf
> [HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]
> [19:09:24.072] GEThttp://127.0.0.1/media/audio/preview.mp3[HTTP/1.1
> 200 OK 361ms]
>
> On May 10, 4:58 pm, Anurag Chourasia 
> wrote:
>
>
>
>
>
>
>
> > Could you have a look at the Error Logs as shown on the Tools --> Web
> > Developer --> Web Console in Firefox if u have something in there?
>
> > On Thu, May 10, 2012 at 7:43 AM, atul khairnar 
> > wrote:
>
> > > When right-clicked at the location where flash should have rendered,
> > > it gives error message, "Movie Not Loaded"
>
> > > On May 10, 10:32 am, atul khairnar  wrote:
> > > > Hi,
> > > > Recently I deployed my django project on Apache using mod_wsgi.
> > > > Everything is working perfect except flash. The flash (.swf file) did
> > > > not render on the client's browser but it works perfect while hosting
> > > > on django built-in development server. What may be the problem?
>
> > > > I am using
>
> > > > Ubuntu  : 11.04
> > > > Apache2  :  Apache/2.2.17
>
> > > --
> > > 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: Apache does not display a flash file

2012-05-10 Thread atul khairnar
Error Log Shows : [19:09:24.001] GET 
http://127.0.0.1/site_media/flash/flashvortex.swf
[HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]

[19:09:23.104] GET http://127.0.0.1/play/ [HTTP/1.1 200 OK 166ms]
[19:09:23.344] GET http://127.0.0.1/site_media/style1.css [HTTP/1.1
200 OK 4ms]
[19:09:23.373] Expected declaration but found '/'.  Skipped to next
declaration. @ http://127.0.0.1/site_media/style1.css:9
[19:09:23.383] Expected ':' but found '#DBDBDB'.  Declaration dropped.
@ http://127.0.0.1/site_media/style1.css:14
[19:09:23.476] Error in parsing value for 'background-image'.
Declaration dropped. @ http://127.0.0.1/site_media/style1.css:68
[19:09:23.553] Error in parsing value for 'filter'.  Declaration
dropped. @ http://127.0.0.1/site_media/style1.css:135
[19:09:23.651] Error in parsing value for 'margin-left'.  Declaration
dropped. @ http://127.0.0.1/site_media/style1.css:229
[19:09:23.791] GET http://127.0.0.1/site_media/images/Back.jpg [HTTP/
1.1 304 NOT MODIFIED 2ms]
[19:09:23.805] GET http://127.0.0.1/site_media/images/Button.png [HTTP/
1.1 304 NOT MODIFIED 3ms]
[19:09:23.929] GET http://127.0.0.1/site_media/fonts/MyriadPro-Regular.otf
[HTTP/1.1 304 NOT MODIFIED 2ms]
[19:09:24.001] GET http://127.0.0.1/site_media/flash/flashvortex.swf
[HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]
[19:09:24.072] GET http://127.0.0.1/media/audio/preview.mp3 [HTTP/1.1
200 OK 361ms]

On May 10, 4:58 pm, Anurag Chourasia 
wrote:
> Could you have a look at the Error Logs as shown on the Tools --> Web
> Developer --> Web Console in Firefox if u have something in there?
>
> On Thu, May 10, 2012 at 7:43 AM, atul khairnar wrote:
>
>
>
>
>
>
>
> > When right-clicked at the location where flash should have rendered,
> > it gives error message, "Movie Not Loaded"
>
> > On May 10, 10:32 am, atul khairnar  wrote:
> > > Hi,
> > > Recently I deployed my django project on Apache using mod_wsgi.
> > > Everything is working perfect except flash. The flash (.swf file) did
> > > not render on the client's browser but it works perfect while hosting
> > > on django built-in development server. What may be the problem?
>
> > > I am using
>
> > > Ubuntu  : 11.04
> > > Apache2  :  Apache/2.2.17
>
> > --
> > 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: Language Translation using multilingual in django

2012-05-10 Thread Juan Pablo Martínez
If you only want to display information but dont want to work with
translations in code you can try

https://github.com/juanpex/django-model-i18n/

On Thu, May 10, 2012 at 10:13 AM, Madhu  wrote:

> Hi!
> I am new in django.
> I use multilingual & create flatpages.
> I add different languages into settings.py & i display all available
> languages in template,
> But i want to covert the content of flatpages into another language as per
> user requirement by using url getting current language code,
> can anybody suggest how it should be done?
>
> Thanks in advance.
>
>  --
> 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/-/F0Bw4f_Zt7wJ.
> 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.
>



-- 
juanpex

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



Language Translation using multilingual in django

2012-05-10 Thread Madhu
Hi!
I am new in django.
I use multilingual & create flatpages.
I add different languages into settings.py & i display all available 
languages in template,
But i want to covert the content of flatpages into another language as per 
user requirement by using url getting current language code,
can anybody suggest how it should be done?

Thanks in advance.

-- 
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/-/F0Bw4f_Zt7wJ.
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 to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread kenneth gonsalves
On Thu, 2012-05-10 at 05:23 -0700, doniyor wrote:
> i need a small help: i have a django site, which is ready to test. now
> i 
> talked to a hosting service, they had only php and mysql supporting
> server, 
> but not django. they gave me a virtual server, where i can install
> django 
> and put my site there. now i am stuck. i dont know how to install
> django on 
> server 

how did you install your site on your development machine (what os do
you have and what os in there on the vps?)
-- 
regards
Kenneth Gonsalves

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



Re: i need to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread azizmb.in
Have you looked at the django docs on installing
django
?

On Thu, May 10, 2012 at 5:53 PM, doniyor  wrote:

> Hi there,
>
> i need a small help: i have a django site, which is ready to test. now i
> talked to a hosting service, they had only php and mysql supporting server,
> but not django. they gave me a virtual server, where i can install django
> and put my site there. now i am stuck. i dont know how to install django on
> server and which python modules to install that run my site and where to
> install. is there any list of steps to do this kind of job? it would be
> very helpful. i just dont find a clue where to start. what i understand is:
> apache is webserver and it is there on server. so i need some module that
> supports python, right? i decided for mod_wsgi. i dont know why i decided
> for this. before that i installed easy_install then i installed all python
> packages including django. now when i log in to server thru Putty including
> switching to root, i land to: domainname: /www/vhtdocs/domainname # and
> this folder has some html files of my old site. they just copied from old
> server to this virtual one. now the question is: is it the place where i
> can just upload my whole django-site?
>
> i would be very thanksful for some instructions..
>
> thanks thanks.
>
> Doni
>
> --
> 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/-/6eGZVixF1CYJ.
> 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.
>



-- 
- Aziz M. Bookwala

Website  | Twitter  |
Github 

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



i need to place my django site on a server, i dont know how to do it! help!!!

2012-05-10 Thread doniyor
Hi there, 

i need a small help: i have a django site, which is ready to test. now i 
talked to a hosting service, they had only php and mysql supporting server, 
but not django. they gave me a virtual server, where i can install django 
and put my site there. now i am stuck. i dont know how to install django on 
server and which python modules to install that run my site and where to 
install. is there any list of steps to do this kind of job? it would be 
very helpful. i just dont find a clue where to start. what i understand is: 
apache is webserver and it is there on server. so i need some module that 
supports python, right? i decided for mod_wsgi. i dont know why i decided 
for this. before that i installed easy_install then i installed all python 
packages including django. now when i log in to server thru Putty including 
switching to root, i land to: domainname: /www/vhtdocs/domainname # and 
this folder has some html files of my old site. they just copied from old 
server to this virtual one. now the question is: is it the place where i 
can just upload my whole django-site? 

i would be very thanksful for some instructions.. 

thanks thanks.

Doni 

-- 
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/-/6eGZVixF1CYJ.
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: Apache does not display a flash file

2012-05-10 Thread Anurag Chourasia
Could you have a look at the Error Logs as shown on the Tools --> Web
Developer --> Web Console in Firefox if u have something in there?

On Thu, May 10, 2012 at 7:43 AM, atul khairnar wrote:

> When right-clicked at the location where flash should have rendered,
> it gives error message, "Movie Not Loaded"
>
> On May 10, 10:32 am, atul khairnar  wrote:
> > Hi,
> > Recently I deployed my django project on Apache using mod_wsgi.
> > Everything is working perfect except flash. The flash (.swf file) did
> > not render on the client's browser but it works perfect while hosting
> > on django built-in development server. What may be the problem?
> >
> > I am using
> >
> > Ubuntu  : 11.04
> > Apache2  :  Apache/2.2.17
>
> --
> 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: Google Drive with Django?

2012-05-10 Thread Elliot Bradbury
django-social-auth has some Google OAuth2 code. I'm not sure if it applies
to Drive but it might be worth looking at. I was able to create an OpenID
backend to a new service in about 2 minutes.

https://github.com/omab/django-social-auth/blob/master/social_auth/backends/google.py#L69

On Thu, May 10, 2012 at 12:16 AM, Jordon Wing  wrote:

> Hey guys,
> I'm trying to integrate Google Drive into my app, and I'm having some
> trouble using OAuth2. I'm not sure if any of you have played with the SDK,
> but if anyone has, what library (if any) did you use? Is there anything
> that simplifies the 200+ lines of code they have in the examples?
>
> Link to the SDK: https://developers.google.com/drive
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/qwx3ZJG5MYgJ.
> 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.



Problem with Django naming convence

2012-05-10 Thread Stone
Dear user,

I am novice with Django,

I have developed some applications but each time they have the same
URL as in physical path.
like URL: http:/testlab and on file system was /opt/Django/testlab
with view.py etc.

Now I would like to develop application called SSO
where all url.py, view.py will be stored in /srv/www/sso/htdocs2 and
in browser will be called over http:///SSO/
How shall I config settings.py and url.py

My settings.py and their important parts are:
linux-6cic:/srv/www/sso/htdocs2 # cat settings.py
# Django settings for htdocs2 project.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '',  # Or path to database file if
using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for
default. Not used with sqlite3.
}
}


# Absolute filesystem path to the directory that will hold user-
uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = '/srv/www/sso/htdocs2/media'

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/
media/"
MEDIA_URL = ''

ROOT_URLCONF = 'htdocs2.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/srv/www/sso/htdocs2/templates',
)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'SSO',
)

}
linux-6cic:/srv/www/sso/htdocs2 #
linux-6cic:/srv/www/sso/htdocs2 # cat urls.py
from django.conf.urls.defaults import patterns, include, url
from htdocs2.views import index, config_page

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
(r'^$', index),
(r'^status/$', index),
(r'^config/$', config_page),
)
linux-6cic:/srv/www/sso/htdocs2 #

Is this settings OK?

Thnak you in advance
Petr

-- 
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: Apache does not display a flash file

2012-05-10 Thread atul khairnar
When right-clicked at the location where flash should have rendered,
it gives error message, "Movie Not Loaded"

On May 10, 10:32 am, atul khairnar  wrote:
> Hi,
> Recently I deployed my django project on Apache using mod_wsgi.
> Everything is working perfect except flash. The flash (.swf file) did
> not render on the client's browser but it works perfect while hosting
> on django built-in development server. What may be the problem?
>
> I am using
>
> Ubuntu  : 11.04
> Apache2  :  Apache/2.2.17

-- 
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: Sorl permissions issues in media directory

2012-05-10 Thread Bastian
One more things, there is Redis installed too.

On Thursday, May 10, 2012 1:13:00 PM UTC+2, Bastian wrote:
>
> I have read the threads, searched google... to no avail. Stuck.
>
> I have Django running with Apache2  on Debian Squeeze and mod_wsgi in a 
> WSGIDaemonProcess with user=www-data, my user_media directory belongs to 
> www-data and is 777, as is the cache directory inside it. And sometimes the 
> sub-directories inside cache (like d1, f7...) are created by www-data and 
> sometimes they are created by lrprod1 (which is the system user I use to 
> host the code). I have no idea why, and it causes some permissions denied 
> that I cannot workaround with some simple group changing since the 
> directories are not even writable by group.
> I did not install this system myself so I may be missing so basic config 
> here. But yet I can't understand how the directories could be created by 
> Django with another user than the one specified in wsgi. I can provide more 
> info, right now I don't see what. How could I investigate that?
>
> Here is an example traceback:
>
> Traceback (most recent call last):
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/core/handlers/base.py",
>  
> line 111, in get_response
>response = callback(request, *callback_args, **callback_kwargs)
>
>  File 
> "/home/lrprod1/apps/project/apache/../src/project/application/project/generic/views.py",
>  
> line 23, in home
>context_instance=RequestContext(request))
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/shortcuts/__init__.py",
>  
> line 20, in render_to_response
>return HttpResponse(loader.render_to_string(*args, **kwargs), 
> **httpresponse_kwargs)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader.py",
>  
> line 188, in render_to_string
>return t.render(context_instance)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 123, in render
>return self._render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 117, in _render
>return self.nodelist.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 744, in render
>bits.append(self.render_node(node, context))
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 757, in render_node
>return node.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader_tags.py",
>  
> line 127, in render
>return compiled_parent._render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 117, in _render
>return self.nodelist.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 744, in render
>bits.append(self.render_node(node, context))
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 757, in render_node
>return node.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader_tags.py",
>  
> line 64, in render
>result = block.nodelist.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 744, in render
>bits.append(self.render_node(node, context))
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 757, in render_node
>return node.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/defaulttags.py",
>  
> line 311, in render
>return self.nodelist_true.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 744, in render
>bits.append(self.render_node(node, context))
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 757, in render_node
>return node.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/defaulttags.py",
>  
> line 500, in render
>output = self.nodelist.render(context)
>
>  File 
> "/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
>  
> line 744, in render
>bits.append(self.render_node(node, context))
>
>  File 
> "/home/lrprod1/apps/vir

Application scope variable

2012-05-10 Thread vamsy krishna
Hi,

I'm using an IMAP connection in my application and want to use the
same connection across sessions to fetch the relevant data. I added
the below snippet in my settings.py file and importing connection in
my view function where I need this. However this is instantiating the
variable each time for each connection. Consequently any parallel
connections exceeding 15 start throwing errors as that is the upper
limit for gmail. Is there a way to achieve what I want in Django/
Python?

import imaplib
connection = imaplib.IMAP4_SSL('imap.gmail.com')
connection.login('useremail', 'password')

Regards,
Vamsy

-- 
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: Model reversion

2012-05-10 Thread Alireza Savand
Another thing is which library shoulda be used to generate diff and do path 
on versions?
there is some of them such as:

   - *difflib *
   - *google-diff-match-patch
   *
   - ***

*
*
The google-diff-match-patch looks really well. and have good approach over 
difflib which is provided by python itself.
any advice about them ?

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



Sorl permissions issues in media directory

2012-05-10 Thread Bastian
I have read the threads, searched google... to no avail. Stuck.

I have Django running with Apache2  on Debian Squeeze and mod_wsgi in a 
WSGIDaemonProcess with user=www-data, my user_media directory belongs to 
www-data and is 777, as is the cache directory inside it. And sometimes the 
sub-directories inside cache (like d1, f7...) are created by www-data and 
sometimes they are created by lrprod1 (which is the system user I use to 
host the code). I have no idea why, and it causes some permissions denied 
that I cannot workaround with some simple group changing since the 
directories are not even writable by group.
I did not install this system myself so I may be missing so basic config 
here. But yet I can't understand how the directories could be created by 
Django with another user than the one specified in wsgi. I can provide more 
info, right now I don't see what. How could I investigate that?

Here is an example traceback:

Traceback (most recent call last):

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/core/handlers/base.py",
 
line 111, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File 
"/home/lrprod1/apps/project/apache/../src/project/application/project/generic/views.py",
 
line 23, in home
   context_instance=RequestContext(request))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/shortcuts/__init__.py",
 
line 20, in render_to_response
   return HttpResponse(loader.render_to_string(*args, **kwargs), 
**httpresponse_kwargs)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader.py",
 
line 188, in render_to_string
   return t.render(context_instance)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 123, in render
   return self._render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 117, in _render
   return self.nodelist.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 744, in render
   bits.append(self.render_node(node, context))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 757, in render_node
   return node.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader_tags.py",
 
line 127, in render
   return compiled_parent._render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 117, in _render
   return self.nodelist.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 744, in render
   bits.append(self.render_node(node, context))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 757, in render_node
   return node.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/loader_tags.py",
 
line 64, in render
   result = block.nodelist.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 744, in render
   bits.append(self.render_node(node, context))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 757, in render_node
   return node.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/defaulttags.py",
 
line 311, in render
   return self.nodelist_true.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 744, in render
   bits.append(self.render_node(node, context))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 757, in render_node
   return node.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/defaulttags.py",
 
line 500, in render
   output = self.nodelist.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 744, in render
   bits.append(self.render_node(node, context))

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/template/base.py",
 
line 757, in render_node
   return node.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/project/lib/python2.6/site-packages/django/templatetags/cache.py",
 
line 31, in render
   value = self.nodelist.render(context)

 File 
"/home/lrprod1/apps/virtual_environments/proj