Re: mod_wsgi using a subpath in combination with a middleware that calls django.core.urlresolvers.resolve is not working

2012-11-29 Thread Jan Murre
Op maandag 26 november 2012 19:50:50 UTC+1 schreef ke1g het volgende: > > > > On Thu, Nov 22, 2012 at 11:28 AM, Jan Murre > > wrote: > >> Hi, >> >> I have the following peculiar problem that is very easy to reproduce. >> I use a simple middleware the attaches the 'app_name' that is defined in

Enforce HTTPS for authenticated users but HTTP for anonymous

2012-11-29 Thread Roarster
Is there any easy way to have a django site enforce HTTPS for authenticated users while any anonymous users would default to HTTP? This would allow me to protect the sessions and cookies for users who have logged on while conserving server resources for those who aren't authenticated (I would

Re: Userprofile, signal and admin inline edit.

2012-11-29 Thread Daniel Gerzo
Hello Jon, have you ever found a solution for this? Thanks. On Tuesday, June 14, 2011 5:04:09 PM UTC+2, Jon Biddle wrote: > > The issue seems to come from the fact that the order of operations > when you create the user looks like this: > > 1) Django admin saves the new User > 2) post_save on

Re: pyodbc utf-8

2012-11-29 Thread Nebros
Ich habe einen Holzweg beschritten und ich werde ihn auch zu Ende gehen... :) I have taken a wrong path and I will follow it through to the end ... :) Am Donnerstag, 29. November 2012 07:53:18 UTC+1 schrieb Nebros: > Its compatible with mysql, but it's not working with mssql. it gave only > e

Re: mod_wsgi using a subpath in combination with a middleware that calls django.core.urlresolvers.resolve is not working

2012-11-29 Thread Jan Murre
Op donderdag 29 november 2012 09:07:01 UTC+1 schreef Jan Murre het volgende: > > > > Op maandag 26 november 2012 19:50:50 UTC+1 schreef ke1g het volgende: >> >> >> >> On Thu, Nov 22, 2012 at 11:28 AM, Jan Murre wrote: >> >>> Hi, >>> >>> I have the following peculiar problem that is very easy to re

Re: Installing forum on django 1.4

2012-11-29 Thread Paul Backhouse
On Wed, 2012-11-28 at 03:15 -0800, Yogev Metzuyanim wrote: > Hi, > Did someone here managed to install a working forum on django 1.4, I > tried all these and I got all kinds of errors: > PyBB > django-forum > django-forumbr > askbot > snapboard > and more... I suspect your question is too general

Re: Enforce HTTPS for authenticated users but HTTP for anonymous

2012-11-29 Thread kahara
Could this be achieved, in a view, by quering if the user is logged in and if so, redirecting to the same page but with HTTPS? Something like: def index(request): if request.user.is_authenticated() and not request.is_secure(): # redirect to HTTPS One could argue though that to keep thin

Re: Django setup with elsatic beanstalk

2012-11-29 Thread Stefano Tranquillini
i give up after a while. every time it was a mess. and AWS is free for 12 months. i switched to appfog, which actually runs for you stuff on AWS. quite easy to set up and put code. basically you need the requirements.txt (as for AWS). and change a bit the setting.py ciao On Thu, Nov 29, 2012 at

Re: Enforce HTTPS for authenticated users but HTTP for anonymous

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 9:32 AM, Roarster wrote: > Is there any easy way to have a django site enforce HTTPS for authenticated > users while any anonymous users would default to HTTP? This would allow me > to protect the sessions and cookies for users who have logged on while > conserving server

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Tom Evans
On Wed, Nov 28, 2012 at 6:27 PM, Loai Ghoraba wrote: > Thanks for the reply, but I am still new to the web technology world, so I > would like to fully use Django now before , moving to another ways to host > my files. > Actually I am totally new to serving stuff, so if there is some best > practi

Re: Enforce HTTPS for authenticated users but HTTP for anonymous

2012-11-29 Thread Roarster
Possibly, but I guess this would involve updating all of my views? As for performance, I'm not sure yet since we haven't launched. I'm really just thinking about things that might keep costs down - particularly if it's easy to do. If any solution is complicated or messy then I probably will j

Re: Enforce HTTPS for authenticated users but HTTP for anonymous

2012-11-29 Thread Roarster
On Thursday, 29 November 2012 11:10:22 UTC, Tom Evans wrote: > Write some custom middleware to handle your logic. We have a similar > requirement at $JOB - SSL on logins, preference pages, anything with a > password form on it, but not on other views. I can't show the code, > but I can describe

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Loai Ghoraba
I am still new to sreving stuff (in fact I know barely anything about it :)) Then you instruct to have something like this url(r'^media/(?P.*)$', 'myview,func', { 'document_root': MEDIA_ROOT, }), and my func have the instructions to the real web servers ? And another

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 11:30 AM, Loai Ghoraba wrote: > I am still new to sreving stuff (in fact I know barely anything about it :)) > Then you instruct to have something like this > > url(r'^media/(?P.*)$', 'myview,func', { > 'document_root': MEDIA_ROOT, > }), > > and

504 Gateway Timeout

2012-11-29 Thread bikeridercz
Dear all, I'm just facing a problem with little longer runnig SQL select command, and DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds. My sql command is executed on Oracle SQL database through "django.db.backends.oracle" driver. Unfortunately I'm not able to find a place

Error: No module named books

2012-11-29 Thread Chris Recher
Hi all, I'm working through the Django book and I've run into an error that wasn't predicted. I've got a project called mysite. I used "python manage.py startapp books" to create an app called books inside of it. I added a few models to the models.py file inside books, then tried to use "python

Re: Where to put PDF files + how to authenticate the urls requesting them

2012-11-29 Thread Loai Ghoraba
I read it and it seems nice, I will further read about the topic Thanks a lot for the help :) On Thu, Nov 29, 2012 at 1:44 PM, Tom Evans wrote: > On Thu, Nov 29, 2012 at 11:30 AM, Loai Ghoraba wrote: > > I am still new to sreving stuff (in fact I know barely anything about it > :)) > > Then yo

Re: 504 Gateway Timeout

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 11:58 AM, bikeridercz wrote: > Dear all, > > I'm just facing a problem with little longer runnig SQL select command, and > DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds. My > sql command is executed on Oracle SQL database through > "django.db.backen

Re: 504 Gateway Timeout

2012-11-29 Thread Jirka Vejrazka
> I'm just facing a problem with little longer runnig SQL select command, and DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds. My sql command is executed on Oracle SQL database through "django.db.backends.oracle" driver. You'd have to change multiple timeouts to make this wo

Re: Error: No module named books

2012-11-29 Thread jianhui chen
I am learning django book too. Do you check the output of error.? Generally, there are hint like ValueError in the output. On Wednesday, November 28, 2012, Chris Recher wrote: > Hi all, > > I'm working through the Django book and I've run into an error that wasn't > predicted. I've got a project

Re: 504 Gateway Timeout

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 1:01 PM, Jirka Vejrazka wrote: >> I'm just facing a problem with little longer runnig SQL select command, >> and DJago framework returns a "504 Gateway Timeout" after aprox 10 seconds. >> My sql command is executed on Oracle SQL database through >> "django.db.backends.oracl

Re: Error: No module named books

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 4:51 AM, Chris Recher wrote: > Hi all, > > I'm working through the Django book and I've run into an error that wasn't > predicted. I've got a project called mysite. I used "python manage.py > startapp books" to create an app called books inside of it. I added a few > models

_set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
I dont get the hot_topic_set.all from the newsletter instance x and I really don't see why can anyone else please? model: class NewsLetter(models.Model): title = models.CharField(max_length=200) text = models.TextField(null=True, blank=True) document = models.FileField(upload_to="news

Re: 504 Gateway Timeout

2012-11-29 Thread Radim Kolek
Tom, you were right ! I'm using a Cherokee http server and 15s timeout was one of options. Now it works OK. Radim Kolek, Ing. GSM: +420602608696 ICQ: 85591428 Dne 29.11.2012 13:58, Tom Evans napsal(a): On Thu, Nov 29, 2012 at 11:58 AM, bikeridercz wrote: Dear all, I'm just facing a problem

admin foreign key issues

2012-11-29 Thread Larry Martell
This is probably very simple, but I've never run into this before and googling has not revealed anything. I have these 2 models: class Category(models.Model): class Meta: db_table = 'data_category' name = models.CharField(max_length=20, unique=True, db_index=True) class Tool(models.Model

how to use named urls from apps

2012-11-29 Thread Mike
I'm trying to use the url template tag to call the login view from contrib.auth. I've tried the following but none work: {% url login %} {% url auth:login %} {% url auth.login %} {% url contrib.auth.login %} Can someone enlighten me please? Mike -- You received this message because you are s

Re: how to use named urls from apps

2012-11-29 Thread Paul Backhouse
Try {% url 'auth_login' %} That works for me in Django 1.4 On Thu, 2012-11-29 at 06:32 -0800, Mike wrote: > I'm trying to use the url template tag to call the login view from > contrib.auth. I've tried the following but none work: > > > {% url login %} > {% url auth:login %} > {% url auth.log

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
Good question, I have attempted to shell the problem out and no I dont get a dataset returned, I should do as NewsLetter is foreignkeyed to Hot_Topic and Hot_Topic_Inline is an inlines to NewsLetterAdmin so the models are definately related -- You received this message because you are subscrib

Re: django/celery - celery status: Error: No nodes replied within time constraint

2012-11-29 Thread Hector Armando Vela Santos
Hi I solved my problem, it was a very simple solution, but it was also a weird one: What I did was: $ /etc/init.d/celerybeat restart $ /etc/init.d/celeryd restart $ service celeryd restart I had to do this in that order, other way I'd get an ugly Error: No nodes replied within time const

Re: how to use named urls from apps

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 2:32 PM, Mike wrote: > I'm trying to use the url template tag to call the login view from > contrib.auth. I've tried the following but none work: > > {% url login %} > {% url auth:login %} > {% url auth.login %} > {% url contrib.auth.login %} > > Can someone enlighten me p

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread carlos
{% for x in list %} {{x.text}} {% for t in x.hot_topic_set.all %} {{ t.topic }} {% endfor %} {% endfor %} try only erase the if tag work for me !! On Thu, Nov 29, 2012 at 9:17 AM, MikeKJ wrote: > Good question, I have attempted to shell the problem out and no I dont get

Re: admin foreign key issues

2012-11-29 Thread Bill Freeman
On Thu, Nov 29, 2012 at 9:10 AM, Larry Martell wrote: > This is probably very simple, but I've never run into this before and > googling has not revealed anything. > > I have these 2 models: > > class Category(models.Model): > class Meta: db_table = 'data_category' > name = models.CharFiel

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread Bill Freeman
You have specified related_name to the foreign key in HotTopic. Try either taking that out, or using newsletter_instance.letter_set.all . -- 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@googlegr

Re: how to use named urls from apps

2012-11-29 Thread Mike
> > > Named urls are URLs defined in your urlconf that have named views. The > contrib auth app, although it provides a bunch of views, does not > automatically install any of them at any URLs, hence this would fail. > > If you include the login view in one of your urlconfs, it will not > have

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread MikeKJ
Perfect, thanks On Thursday, November 29, 2012 3:48:41 PM UTC, ke1g wrote: > > You have specified related_name to the foreign key in HotTopic. Try > either taking that out, or using newsletter_instance.letter_set.all . > -- You received this message because you are subscribed to the Google Gro

Re: Error: No module named books

2012-11-29 Thread Timothy Makobu
Im betting you're using Django 1.4x The layout is different in 1.4. Download the version the book is using (1.1? https://www.djangoproject.com/download/ bottom right), then all should work. On Thu, Nov 29, 2012 at 4:33 PM, Tom Evans wrote: > On Thu, Nov 29, 2012 at 4:51 AM, Chris Recher > wro

Re: admin foreign key issues

2012-11-29 Thread Larry Martell
On Thu, Nov 29, 2012 at 10:43 AM, Bill Freeman wrote: > > > On Thu, Nov 29, 2012 at 9:10 AM, Larry Martell > wrote: >> >> This is probably very simple, but I've never run into this before and >> googling has not revealed anything. >> >> I have these 2 models: >> >> class Category(models.Model): >

Re: admin foreign key issues

2012-11-29 Thread Bill Freeman
On Thu, Nov 29, 2012 at 12:30 PM, Larry Martell wrote: > On Thu, Nov 29, 2012 at 10:43 AM, Bill Freeman wrote: > > > > > > On Thu, Nov 29, 2012 at 9:10 AM, Larry Martell > > wrote: > >> > >> This is probably very simple, but I've never run into this before and > >> googling has not revealed anyt

Re: admin foreign key issues

2012-11-29 Thread Larry Martell
On Thu, Nov 29, 2012 at 12:34 PM, Bill Freeman wrote: > > > On Thu, Nov 29, 2012 at 12:30 PM, Larry Martell > wrote: >> >> On Thu, Nov 29, 2012 at 10:43 AM, Bill Freeman wrote: >> > >> > >> > On Thu, Nov 29, 2012 at 9:10 AM, Larry Martell >> > wrote: >> >> >> >> This is probably very simple, bu

Re: [ANNOUNCE] Django 1.5 beta 1 released

2012-11-29 Thread victoria
On Tue, Nov 27, 2012 at 11:17 PM, James Bennett wrote: > Our second milestone on the road to Django 1.5 came today, with the > release of the first beta package. > > Blog post about it is here: > > https://www.djangoproject.com/weblog/2012/nov/27/15-beta-1/ > > Release notes are here: > > https://

difficulty with static files

2012-11-29 Thread Sammy
Hello django experts I am unable to get my static files to work. Here are my settings: projectfiles | |-myproject | | | |-static | | | | | |-css | | |-js | |-__init__.py | |-settings.py | |-urls.py | |-wsgi.py | |

Re: difficulty with static files

2012-11-29 Thread Tom Evans
On Thu, Nov 29, 2012 at 6:00 PM, Sammy wrote: > Hello django experts > I am unable to get my static files to work. Here are my settings: > > projectfiles > | > |-myproject > | | > | |-static > | | | > | | |-css > | | |-js > | |-__init__.py >

Re: Error: No module named books

2012-11-29 Thread Chris Recher
Thanks for the help everyone. I was using 1.4.x, not the 1.0 the book is based on. After fooling around with the commands for a bit, I was able to figure out that the problem was in the INSTALLED_APPS section - I included 'mysite.books', but the new way to do that is just 'books'. -- You recei

Re: django1.5 subclass AbstractUser, How to get a password-(re)set field in admin

2012-11-29 Thread Detectedstealth
Hi Russel, I have followed https://docs.djangoproject.com/en/dev/topics/auth/#a-full-example then added: password = ReadOnlyPasswordHashField(label=_("Password"), help_text=_("Raw passwords are not stored, so there is no way to see " "this user's password, but yo