Re: [help] Server Config: django + uwsgi + nginx

2012-04-29 Thread Roberto De Ioris

> i followed the django-http+uwsgi quick start and ended up with an error.
> ImportError: no module named django.core.handlers.wsgi \n unable to load
> app ...
> here's the error log: dpaste.org/BM5BW

Are you sure you are not using a >=1.4 django version or a virtualenv ?

If you are uging a virtualenv, add

virtualenv = 

to the uWSGI config file

>
> On Sunday, April 29, 2012 11:31:43 AM UTC-7, Roberto De Ioris wrote:
>>
>>
>> > I have this file that was created for me by one of the users in
>> django's
>> > irc channel. I edited to have the right information inserted but I"m
>> not
>> > sure what I'm doing wrong to not make it work. I've spent some time
>> trying
>> > to understand each line by searching the web. There's still a thing or
>> two
>> > that's missing from the puzzle. Maybe it's the server config that has
>> a
>> > flaw or the way I went about it. I haven't done a fresh install of
>> uwsgi
>> > and nginx yet. However, please take a look to see if there's an error
>> or
>> > solution that could work. Thanks.
>> >
>> > Link to code: http://www.dpaste.org/wWVd3/
>> >
>>
>> I suggest you to not start with such a complex scenario.
>>
>> I would go step-by-step with a very simple setup involving only uWSGI:
>>
>> http://projects.unbit.it/uwsgi/wiki/Quickstart
>>
>> Then, change the http protocol to the uwsgi one (simply replace http =
>> with socket = ) and put it behind a simple nginx config (like the one
>> you
>> will find following the uWSGI quickstart).
>>
>> Then move to the 'upstart' part, adding the script to the /etc/init
>> directory.
>>
>> Finally start playing with caching (it can be the most challenging part)
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>>
>
> --
> 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/-/73nF9MjDBvYJ.
> 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.
>
>


-- 
Roberto De Ioris
http://unbit.it

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



Re: [help] Server Config: django + uwsgi + nginx

2012-04-29 Thread easypie
i followed the django-http+uwsgi quick start and ended up with an error. 
ImportError: no module named django.core.handlers.wsgi \n unable to load 
app ...
here's the error log: dpaste.org/BM5BW

On Sunday, April 29, 2012 11:31:43 AM UTC-7, Roberto De Ioris wrote:
>
>
> > I have this file that was created for me by one of the users in django's 
> > irc channel. I edited to have the right information inserted but I"m not 
> > sure what I'm doing wrong to not make it work. I've spent some time 
> trying 
> > to understand each line by searching the web. There's still a thing or 
> two 
> > that's missing from the puzzle. Maybe it's the server config that has a 
> > flaw or the way I went about it. I haven't done a fresh install of uwsgi 
> > and nginx yet. However, please take a look to see if there's an error or 
> > solution that could work. Thanks. 
> > 
> > Link to code: http://www.dpaste.org/wWVd3/ 
> > 
>
> I suggest you to not start with such a complex scenario. 
>
> I would go step-by-step with a very simple setup involving only uWSGI: 
>
> http://projects.unbit.it/uwsgi/wiki/Quickstart 
>
> Then, change the http protocol to the uwsgi one (simply replace http = 
> with socket = ) and put it behind a simple nginx config (like the one you 
> will find following the uWSGI quickstart). 
>
> Then move to the 'upstart' part, adding the script to the /etc/init 
> directory. 
>
> Finally start playing with caching (it can be the most challenging part) 
>
> -- 
> Roberto De Ioris 
> http://unbit.it 
>

-- 
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/-/73nF9MjDBvYJ.
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: Can't start new project

2012-04-29 Thread Sandra
I have the same problem Jani had and I tried this but it is not
working for me. The window still appears when i run "django-admin.py
startproject ". The window is the django-admin file and the text
it contents is:

#!/usr/bin/env python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()

Thanks.


On 15 abr, 23:07, Jani Tiainen  wrote:
> One more advice so you don't get caught with the problems:
>
> (Well I suggest that you start using virtualenvs as well, they really rock)
>
> After installing TCC/LE create one batch file (I use tcstart.btm) with
> the following contents:
>
> @echo off
> rem Set python binding to handle virtualenvironments
> set .py;.pyc=python.exe
>
> Note, if you're not using virtual environments or not have your python
> in the path use full absolute path instead of just "python.exe".
>
> Create a shortcut on your desktop (or anywhere you like).
>
> Open properties of the shortcut and set "target" to something like
> "C:\Program Files (x86)\JPSoft\TCCLE12\tcc.exe" "c:\mysettings\tcstart.btm"
>
> And of course, "start in" is good to place where ever you have your
> projects, removes need for extra cd.
>
> This should get you up and running smoothly and should get around the
> problem of windows peculiarities in python invocation.
>
> 16.4.2012 1:23, Brandy kirjoitti:
>
>
>
>
>
>
>
> > I certainly will. Thanks for the advice:)
>
> > On Sunday, April 15, 2012 2:42:00 PM UTC-5, Jani Tiainen wrote:
>
> >     It's apparently TCC/LE which saves me about all that command
> >     execution and arg passing hazzle.. :)
>
> >     Never used plain command prompt so I've been immune to peculiarities
> >     of Windows command line utilities.
>
> >     I suggest you give it a try - it's really nice.
>
> >     On Sun, Apr 15, 2012 at 10:04 PM, Brandy  >     > wrote:
>
> >         If you would like to read more about the issue, I found the
> >         error already reported on the Python website:
> >        http://bugs.python.org/issue7936
>
> >         On Saturday, April 14, 2012 1:52:00 PM UTC-5, Jani Tiainen wrote:
>
> >             Sounds very goofy.django-admin.pyjust creates files,
> >             doesn't open any editors so there is somthing really fishy
> >             going on in your machine...
>
> >             On Sat, Apr 14, 2012 at 8:27 PM, Brandy
> >              >             > wrote:
>
> >                 What I mean is, I can create 2 or 3 new projects without
> >                 problems. I play with them and create files, etc. Then,
> >                 for whatever reason, when I rundjango-admin.py
> >                 startproject  again, an editor widow opens
> >                 (emacs in my case, since that is what I was using), and
> >                 django doesn't create any files. All I can do is edit
> >                 the projects I already have created.
>
> >                 On Saturday, April 14, 2012 12:45:32 AM UTC-5, Jani
> >                 Tiainen wrote:
>
> >                     I really suggest you to use virtualenv, it makes
> >                     your life easier in the long run. Also I use a
> >                     TCC/LE instead of powershell / cmd prompt to mimic
> >                     more unix like environment.
>
> >                     Though you mentioned " After a while, if I try to
> >                     start a new project, my editor opens and no files or
> >                     directories are created. " what you exactly mean by
> >                     that?
>
> >                     I feel that I should write short article how to make
> >                     development in win7 slightly less painful...
>
> >                     On Sat, Apr 14, 2012 at 8:19 AM, Brandy
> >                      >                     > wrote:
>
> >                         No, I'm not using virtual environments.
>
> >                         On Friday, April 13, 2012 11:51:33 PM UTC-5,
> >                         Jani Tiainen wrote:
>
> >                             Are you using virtual environments?
>
> >                             Since I've been doing all my django
> >                             development on windows last 3 years without
> >                             any major problems...
>
> >                             On Sat, Apr 14, 2012 at 6:04 AM, Brandy
> >                              >                             > wrote:
>
> >                                 After first installing Django, I am able
> >                                 to use "django-admin.pystartproject
> >                                 " with no problem. After a
> >                                 while, if I try to start a new project,
> >                                 my editor opens and no files or
> >                                 directories are created

Re: @login_required do nothing

2012-04-29 Thread Reinout van Rees

On 28-04-12 21:00, marcelo nicolet wrote:

Following the on-line docs (
https://docs.djangoproject.com/en/1.4/topics/auth/ ) I decorated my
"index" view with @login_required, but nothing happens. In other words,
it'supossed I would be redirected to a login page, else an exception
migth raise. But the whole thing keeps doing as always.
What am I doing the wrong way?


Are you using a function as a view or a new class based one?
In the latter case, the decorator won't work if you place it on the class:
http://www.caktusgroup.com/blog/2011/12/29/class-based-views-django-13/


Reinout

--
Reinout van Reeshttp://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: outdated django book

2012-04-29 Thread Reinout van Rees

On 29-04-12 21:24, knowledge_seeker wrote:

On Friday, April 27, 2012 7:09:32 PM UTC-7, knowledge_seeker wrote:

My Django book (from the university library) said to add the label
"@login_required" to views that I wish to restrict user access on.
Django 1.4 does not allow this; obviously the book is dated! Is there
a more modern way to get the same effect?


Perhaps your @login_required error was also an forgot-to-import-it 
error. But it also might be because you're using a class based view.


If so, look for the 'decorators' heading in the following link:
http://www.caktusgroup.com/blog/2011/12/29/class-based-views-django-13/

You need to decorate the dispatch() method in the class-based-view case.


Reinout

--
Reinout van Reeshttp://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: Unable to get result using distance query

2012-04-29 Thread Reinout van Rees

On 26-04-12 00:02, vishy wrote:

I am using PointField to store longitude and latitude with SRID 4326.
All my places are in USA. Now, given a reference point, I do

lat = "41.881944"
lng = "-87.627778"

 ref_pnt = fromstr("POINT(%s %s)" % (lng, lat))


You have probably mixed up latitude and longitude. First pass lat, then lng.


DatabaseError: Coordinate values are out of range [-180 -90,
180 90] for GEOGRAHY type


Only thing that springs to mind is that web-mercator coordinates 
(="google") don't work from latitude 85 upwards and -85 downwards (so, 
on the two poles). And as you swapped lat/lon, the 87 value ends up as 
latitude. Long shot...


Another wild guess: print the value of ref_pnt. So what comes out of 
fromstr(). Is that really the correct value? Is there some 
number-formatting mishap that treats points differently?


Wild guesses...



Reinout

--
Reinout van Reeshttp://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: buildout development vs. deployment

2012-04-29 Thread Reinout van Rees

On 25-04-12 12:21, Reikje wrote:

Hi, I am looking into buildout to deploy a django webapp and all it's
dependencies. I find it quite useful even during development because it
forces you to keep track of your dependencies. A question regarding some
best practices. Lets say I have buildout.cfg and setup.py in my project
root and checked in into SCM. My webapp is listed under develop in
buildout.cfg. While this is great, during deployment this is probably
not what you want because you wanna lock the version of your source
code. I want to do a git revision checkout to archive this. So i guess I
need to maintain two different buildout.cfg files, one for development
and one for deployment. How can this be organized to avoid DRY?


I have a production.cfg that extends buildout.cfg. I can then add extra 
parts ("set up a supervisord to run gunicorn") of modify settings in 
existing ones ("use port 10026 instead of 8000").


I get to keep it pretty DRY that way.

Note that I make proper packages out of my development apps and stick 
them somewhere that buildout can find them. You could try to use the 
mr.developer add-on to check out tags of your stuff.


For hints on getting your own packages up on a pypi of your own:
http://reinout.vanrees.org/weblog/2009/11/09/eggproxy-plus-private-packages.html
That ought to give you some hints.


On a side note, what are the alternatives to buildout. Maybe there is
something even better :)


Buildout provides two things:

- Installation + isolation of python packages, just like the 
pip+virtualenv environment. With the note that buildout works just fine 
on windows and that pip won't install binary windows eggs. Otherwise the 
effect is mostly the same, though I like buildout's version handling 
better as it is impossible to forget it (unlike forgetting to pass pip a 
requirements.txt file).


- Add-on recipes for extra automation. Great for deployment. Generating 
nginx/apache config files, setting up a cron job, creating 
your_site_dir/var/log directories and so on.


=> for handling everything *within* your project directory, nothing 
beats the functionality of buildout. And it combines fine with tools 
like fabric that can handle everything outside of the project directory.



Reinout


--
Reinout van Reeshttp://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: Loading static files from a dev environment

2012-04-29 Thread Reinout van Rees

On 23-04-12 12:56, gnesher wrote:

I'm having an odd problem with my test Django environment.

It seems that static filles I've collected from different apps using
the collectstatic command works fine, while other static files I
placed in myself result in 404 error. This can happen from the same
directory (where a png that was collected will load, but a png i just
drop in will fail).


In development mode, staticfiles will just serve the files directly from 
your app's static/ directories without using the directory where 
collectstatic places them. That's proper behaviour for development.


The directory that collectstatic fills is just for your production 
environment where you've got a proper webserver to serve that directory.


So... it is by design :-)


Reinout

--
Reinout van Reeshttp://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: outdated django book

2012-04-29 Thread knowledge_seeker
Thanks for the help guys; I am glad the books were not so out of date!

On Friday, April 27, 2012 7:09:32 PM UTC-7, knowledge_seeker wrote:
>
> My Django book (from the university library) said to add the label 
> "@login_required" to views that I wish to restrict user access on. 
> Django 1.4 does not allow this; obviously the book is dated! Is there 
> a more modern way to get the same effect? 
>
> Similarly, admin does not allow access to my classes, even when I have 
> created an Admin class; is this a new security feature? 
>
> Finally, when I tried to create a view that allowed web-based user 
> creation, the views.py file would not recognize the class "User"; is 
> there something I need to import?


On Friday, April 27, 2012 7:09:32 PM UTC-7, knowledge_seeker wrote:
>
> My Django book (from the university library) said to add the label 
> "@login_required" to views that I wish to restrict user access on. 
> Django 1.4 does not allow this; obviously the book is dated! Is there 
> a more modern way to get the same effect? 
>
> Similarly, admin does not allow access to my classes, even when I have 
> created an Admin class; is this a new security feature? 
>
> Finally, when I tried to create a view that allowed web-based user 
> creation, the views.py file would not recognize the class "User"; is 
> there something I need to import?

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



Re: [help] Server Config: django + uwsgi + nginx

2012-04-29 Thread Karl Sutt
Here is my uWSGI command and nginx.conf contents:

uwsgi -- http://www.dpaste.org/aiJuq/
nginx -- http://www.dpaste.org/bAG0o/

I've used it for a Flask application, but I've just tested it and it works
for a Django project as well. Note that wsgi.py file in the uwsgi command
is the Python file that Django generates when you first create a project,
there is no need to change it.

Good luck!

Karl Sutt


On Sun, Apr 29, 2012 at 6:49 PM, easypie  wrote:

> I have this file that was created for me by one of the users in django's
> irc channel. I edited to have the right information inserted but I"m not
> sure what I'm doing wrong to not make it work. I've spent some time trying
> to understand each line by searching the web. There's still a thing or two
> that's missing from the puzzle. Maybe it's the server config that has a
> flaw or the way I went about it. I haven't done a fresh install of uwsgi
> and nginx yet. However, please take a look to see if there's an error or
> solution that could work. Thanks.
>
> Link to code: http://www.dpaste.org/wWVd3/
>
> --
> 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/-/2rekHP0I6V0J.
> 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.



Many-to-Many Intermediary Models in Django admin

2012-04-29 Thread LuSyo
Hello,

Here is the model I am working on :

class Recipe(models.Model):
title = models.CharField(max_length=200)
description = models.TextField(blank=True)
ingredient = models.ManyToManyField('Ingredient',
through='Content',null=True)

class Ingredient(models.Model):
name = models.CharField(max_length=200)

class Content(models.Model):
recipe = models.ForeignKey('Recipe')
ingredient = models.ForeignKey('Ingredient')
quantity = models.FloatField()

As you can see, I used a many-to-many relation to link an ingredient
to a recipe, and I did it through an intermediate model, Content, so I
can specify a quantity for the ingredient.

Here is my problem : In the Django admin I would like to be able to
add new Contents when I edit/create a Recipe.

So I did this in admin.py :

class ContentInline(admin.TabularInline):
model = Content
extra = 3

class RecipeAdmin(admin.ModelAdmin):
inlines = [ContentInline]

admin.site.register(Recipe, RecipeAdmin)

As expected, I can add new Contents but that does not allow me to
create a new Ingredient directly.
I could create new Ingredients independently and then create my
recipes but it is not convenient :/

Is there a way I can create an Ingredient along with a Content while I
edit my Recipe ?

Thank you for your answers ! Hope my question is clear enough...

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



Re: [help] Server Config: django + uwsgi + nginx

2012-04-29 Thread Roberto De Ioris

> I have this file that was created for me by one of the users in django's
> irc channel. I edited to have the right information inserted but I"m not
> sure what I'm doing wrong to not make it work. I've spent some time trying
> to understand each line by searching the web. There's still a thing or two
> that's missing from the puzzle. Maybe it's the server config that has a
> flaw or the way I went about it. I haven't done a fresh install of uwsgi
> and nginx yet. However, please take a look to see if there's an error or
> solution that could work. Thanks.
>
> Link to code: http://www.dpaste.org/wWVd3/
>

I suggest you to not start with such a complex scenario.

I would go step-by-step with a very simple setup involving only uWSGI:

http://projects.unbit.it/uwsgi/wiki/Quickstart

Then, change the http protocol to the uwsgi one (simply replace http =
with socket = ) and put it behind a simple nginx config (like the one you
will find following the uWSGI quickstart).

Then move to the 'upstart' part, adding the script to the /etc/init
directory.

Finally start playing with caching (it can be the most challenging part)

-- 
Roberto De Ioris
http://unbit.it

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



[help] Server Config: django + uwsgi + nginx

2012-04-29 Thread easypie
I have this file that was created for me by one of the users in django's 
irc channel. I edited to have the right information inserted but I"m not 
sure what I'm doing wrong to not make it work. I've spent some time trying 
to understand each line by searching the web. There's still a thing or two 
that's missing from the puzzle. Maybe it's the server config that has a 
flaw or the way I went about it. I haven't done a fresh install of uwsgi 
and nginx yet. However, please take a look to see if there's an error or 
solution that could work. Thanks.

Link to code: http://www.dpaste.org/wWVd3/

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



Re: Using Django to develop a Database?

2012-04-29 Thread Alec Taylor
Quick offside: checkout the NLTK project for processing the information

On Sun, Apr 29, 2012 at 5:05 PM, Kevin A  wrote:
> Hello,
>
> I'm hoping someone can help me with my research.
>
> I've been tasked with helping to construct a Database. Within this
> database will be information (such as their strengths and weaknesses,
> how successful they are, etc.) about various organizations. Most of
> this information is more qualitative in nature.
>
> My question is two-fold:
>
> 1) Can Django be used to create such a database?
>
> 2) If so, once its created, does the user have to have an
> understanding of Python? Or is it possible to code a webpage, that is
> password protected, and then be able to use the webpage like a normal
> website?
>
> I would really appreciate any help/advice you can offer.
>
> --
> 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: Django + Windows Server 2003 + IIS6 + MSSQL 2005

2012-04-29 Thread Samuel Pérez Osés
I know it is not the same version you have mentioned, but have you 
tried http://www.helicontech.com/ they have deployed django over IIS 7, and 
it is well documented



El jueves, 26 de abril de 2012 13:59:43 UTC+2, honyczek escribió:
>
> Hi,
>
> there is a isapi library in the PyWin32 project (
> http://sourceforge.net/projects/pywin32/). I use that. For SQL Server 
> connection I use django-mssql (http://code.google.com/p/django-mssql/).
>
> Jan
>
> Dne úterý, 17. dubna 2012 16:35:35 UTC+2 Enrique Juan de Dios napsal(a):
>>
>> Hello Everyone,
>> Please I need tips and common errors to this environment:  
>> Django 1.3 + Windows Server 2003 + IIS6 + MSSQL 2005
>> I found this project:
>> https://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer 
>> Have anyone tested this project?
>> What is the best way to install to setup a Django Webapp in that?
>> 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/-/5foKYUIsWAcJ.
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: Storing Sorl-thumbnail created images in separate folder

2012-04-29 Thread Swaroop Shankar V
Thanks Kelly, could you tell me what all settings you had provided for it
to cache into a separate directory?

Thanks and Regards,
Swaroop Shankar V



On Sun, Apr 29, 2012 at 8:09 PM, Kelly Nicholes wrote:

> It always just caches the files for me in a completely different directory.
>
> On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote:
>>
>> Hello All,
>> I am using sorl-thumbnail extensively in my project. It works perfectly
>> fine except for one issue which is regarding the storage. The default
>> behaviour of sorl-thumbnail is to create the images in the same folder
>> where the original image is stored. Is it possible to provide
>> a separate location for storage of generated file rather than the source
>> folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to
>> be used? I am not able to figure it out from the documentation. If yes then
>> should i provide the absolute or relative path?
>>
>> Thanks and Regards,
>>
>> Swaroop Shankar V
>>
>>   --
> 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/-/Tfl7B7Xir_gJ.
> 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: django- accessing items in a python dictionary

2012-04-29 Thread creecode
On Sunday, April 29, 2012 7:36:17 AM UTC-7, hius...@qq.com wrote:

what is value of the etc?
>

I believe that etc. in this case is an abbreviation for etcetera.

-- 
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/-/CupTM1pXfVoJ.
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- accessing items in a python dictionary

2012-04-29 Thread Karen Tracey
On Sun, Apr 29, 2012 at 6:01 AM, Alan Mo  wrote:
> My dictionary is as follows:
>
> data={"BE1234":"abc", "BA3212":"efg", etc}
>
> I call it through django templates. According to the online manual, they say
> "if your context contained a dictionary data, the following would display
> the keys and values of the dictionary":
>
> {% for key, value in data.items %}
> {{ key }}: {{ value }}
> {% endfor %}
>
> I get the error: TemplateSyntaxError: 'for' statements with five words
> should end in 'reversed': for key, value in data.items

What version of Django are you using? This particular error message
was removed from Django five years ago (before Django 1.0):

https://code.djangoproject.com/changeset/5443

(not-so-coincidentally when the support for iterating over dictionary
items like you are trying was added).

If you are changing and old project you'll need to stick to docs from
the version of Django you have, or upgrade the project. If you are
just starting out you should definitely delete whatever Django you
have installed and start with 1.4 instead.

Karen
-- 
http://tracey.org/kmt/

-- 
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: Storing Sorl-thumbnail created images in separate folder

2012-04-29 Thread Kelly Nicholes
It always just caches the files for me in a completely different directory.

On Saturday, April 28, 2012 1:06:12 PM UTC-6, Swaroop Shankar wrote:
>
> Hello All,
> I am using sorl-thumbnail extensively in my project. It works perfectly 
> fine except for one issue which is regarding the storage. The default 
> behaviour of sorl-thumbnail is to create the images in the same folder 
> where the original image is stored. Is it possible to provide 
> a separate location for storage of generated file rather than the source 
> folder? I could find a setting called THUMBNAIL_STORAGE, is it the one to 
> be used? I am not able to figure it out from the documentation. If yes then 
> should i provide the absolute or relative path?
>
> Thanks and Regards,
>
> Swaroop Shankar V
>
>  

-- 
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/-/Tfl7B7Xir_gJ.
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- accessing items in a python dictionary

2012-04-29 Thread Hiuser Su
what is value of the etc?



2012/4/29 Alan Mo :
> My dictionary is as follows:
>
> data={"BE1234":"abc", "BA3212":"efg", etc}
>
> I call it through django templates. According to the online manual, they say
> "if your context contained a dictionary data, the following would display
> the keys and values of the dictionary":
>
> {% for key, value in data.items %}
> {{ key }}: {{ value }}
> {% endfor %}
>
> I get the error: TemplateSyntaxError: 'for' statements with five words
> should end in 'reversed': for key, value in data.items
>
> Can anyone help me fix this error? It's really frustrating. Just wondering
> if I'm doing something stupid. Thanks in advance.
>
>
> posted on
> stackoverflow: http://stackoverflow.com/questions/10371168/django-accessing-items-in-a-python-dictionary
>
> --
> 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/-/jZK0GkgxJ0oJ.
> 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: Using Django to develop a Database?

2012-04-29 Thread Timothy Makobu
Django Admin fits your needs well
https://docs.djangoproject.com/en/dev/ref/contrib/admin/


On Sun, Apr 29, 2012 at 10:05 AM, Kevin A wrote:

> Hello,
>
> I'm hoping someone can help me with my research.
>
> I've been tasked with helping to construct a Database. Within this
> database will be information (such as their strengths and weaknesses,
> how successful they are, etc.) about various organizations. Most of
> this information is more qualitative in nature.
>
> My question is two-fold:
>
> 1) Can Django be used to create such a database?
>
> 2) If so, once its created, does the user have to have an
> understanding of Python? Or is it possible to code a webpage, that is
> password protected, and then be able to use the webpage like a normal
> website?
>
> I would really appreciate any help/advice you can offer.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



django- accessing items in a python dictionary

2012-04-29 Thread Alan Mo


My dictionary is as follows:

data={"BE1234":"abc", "BA3212":"efg", etc}

I call it through django templates. According to the online manual, they 
say "if your context contained a dictionary data, the following would 
display the keys and values of the dictionary":

{% for key, value in data.items %}
{{ key }}: {{ value }}
{% endfor %}

I get the error: TemplateSyntaxError: 'for' statements with five words 
should end in 'reversed': for key, value in data.items

Can anyone help me fix this error? It's really frustrating. Just wondering 
if I'm doing something stupid. Thanks in advance.


posted on 
stackoverflow: 
http://stackoverflow.com/questions/10371168/django-accessing-items-in-a-python-dictionary

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



Using Django to develop a Database?

2012-04-29 Thread Kevin A
Hello,

I'm hoping someone can help me with my research.

I've been tasked with helping to construct a Database. Within this
database will be information (such as their strengths and weaknesses,
how successful they are, etc.) about various organizations. Most of
this information is more qualitative in nature.

My question is two-fold:

1) Can Django be used to create such a database?

2) If so, once its created, does the user have to have an
understanding of Python? Or is it possible to code a webpage, that is
password protected, and then be able to use the webpage like a normal
website?

I would really appreciate any help/advice you can offer.

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



html5 + Django

2012-04-29 Thread collectiveSQL
Hi Everyone,

I'm working on a heavily animated web site using the html5 canvas tag.
Its mainly made of html, javascript and css static files and I'd like
to integrate the Google Identity Toolkit for an Oauth 2.0 account
chooser for signup and registration.

The first question is Django a good candidate for serving up mainly
static files and using a small Django app for authentication?

And secondly what performance impact would this have over straight
apache?

More info:

1. Static web files such as html, javascript and css are stored on
Amazon AWS S3
2. Data is loaded via oData using jsdata for animations
3. Amazon AWS EC2 is used to scale apache web servers

Thanks in advance.

-- 
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: ValueError: unknown locale: UTF-8

2012-04-29 Thread Timothy Makobu
The database is PostgreSQL 9.1.3


On Sun, Apr 29, 2012 at 1:09 PM, Timothy Makobu  wrote:

> Hi,
>
> I'm getting an "unknown locale" exception and yet the LANG environment
> variable is set:
>
> Traceback (most recent call last):
>   File "manage.py", line 14, in 
> execute_manager(settings)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 459, in execute_manager
> utility.execute()
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/opt/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
> line 90, in handle_noargs
> syncdb.Command().execute(**options)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 110, in handle_noargs
> emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/sql.py",
> line 189, in emit_post_sync_signal
> interactive=interactive, db=db)
>   File
> "/opt/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> line 172, in send
> response = receiver(signal=self, sender=sender, **named)
>   File
> "/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 73, in create_superuser
> call_command("createsuperuser", interactive=True, database=db)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 150, in call_command
> return klass.execute(*args, **defaults)
>   File
> "/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
> line 70, in handle
> default_username = get_default_username()
>   File
> "/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 105, in get_default_username
> default_username = get_system_username()
>   File
> "/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 85, in get_system_username
> return getpass.getuser().decode(locale.getdefaultlocale()[1])
>   File "/opt/local/lib/python2.7/locale.py", line 503, in getdefaultlocale
> return _parse_localename(localename)
>   File "/opt/local/lib/python2.7/locale.py", line 435, in _parse_localename
> raise ValueError, 'unknown locale: %s' % localename
> ValueError: unknown locale: UTF-8
>
>
> # echo $LANG
> # en_US.UTF-8
>
>

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



ValueError: unknown locale: UTF-8

2012-04-29 Thread Timothy Makobu
Hi,

I'm getting an "unknown locale" exception and yet the LANG environment
variable is set:

Traceback (most recent call last):
  File "manage.py", line 14, in 
execute_manager(settings)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 459, in execute_manager
utility.execute()
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 232, in execute
output = self.handle(*args, **options)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 371, in handle
return self.handle_noargs(**options)
  File
"/opt/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
line 90, in handle_noargs
syncdb.Command().execute(**options)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 232, in execute
output = self.handle(*args, **options)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 371, in handle
return self.handle_noargs(**options)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/sql.py",
line 189, in emit_post_sync_signal
interactive=interactive, db=db)
  File
"/opt/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
line 172, in send
response = receiver(signal=self, sender=sender, **named)
  File
"/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 150, in call_command
return klass.execute(*args, **defaults)
  File
"/opt/local/lib/python2.7/site-packages/django/core/management/base.py",
line 232, in execute
output = self.handle(*args, **options)
  File
"/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
line 70, in handle
default_username = get_default_username()
  File
"/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
line 105, in get_default_username
default_username = get_system_username()
  File
"/opt/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
  File "/opt/local/lib/python2.7/locale.py", line 503, in getdefaultlocale
return _parse_localename(localename)
  File "/opt/local/lib/python2.7/locale.py", line 435, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8


# echo $LANG
# en_US.UTF-8

-- 
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: dutch django hoster

2012-04-29 Thread Marcin Tustin
checkout djangofriendly.com - there are a couple of dutch-speaking hosting
companies with decent reputations.

On Sat, Apr 28, 2012 at 23:23, Vidja  wrote:

> I'm looking for a reliable Dutch (speaking) hosting company that is
> able to host a Django based website for a small non-profit
> organization with ,surprise, ... a low budget. The idea is that when
> something goes wrong they can just call a support help desk and they
> don't have to deal with maintenance etc. The expected traffic is low.
>
> Any suggestions are welcome.
>
> --
> 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.
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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: Can't find module

2012-04-29 Thread Gerald Klein
OK thanks I changed and it worked, I appreciate your help

--jerry

On Sat, Apr 28, 2012 at 4:28 AM, Alagappan  wrote:

> In your installed applications list you have mentioned 'search' as an
> application. But in your url pattern you are using 'cms.search'. Either use
> 'cms' as your installed application or mention it as just
> 'search.views.search' in your url pattern.
>
> I feel that should do the job.
>
> Thanks,
> Alagappan
>
> --
> 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.
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

j...@zognet.com

708-599-0352


Linux registered user #548580

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