Re: Problem with get_absolute_url

2011-11-15 Thread Rubén Dugo Martín
You forget the decorator: @models.permalink def get_absolute_url(self): return ('blog_post_detail', None, { 'year': self.publish.year, 'month': self.publish.strftime('%b').lower(), 'day': self.publish.day, 'slug': self.slug }) 2011/11/15 Fredrik Grahn

Re: [HELP] To make a basecamp like - project management site

2011-11-15 Thread Anand
Hi Michael You can try BootStrapToday (http://bootstraptoday.com). Its based on python and django. Regards Anand -- 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-

Re: site organization best practices

2011-11-15 Thread Mike Thon
I'm no expert here but if it were me building this project, I'd build the logging mechanism as a separate app and still use the decorator as you are already doing. As for 'cross app reference' - you just import your logging app into your project they way you do any other app. Should be fairly s

Re: To make a basecamp like - project management site

2011-11-15 Thread Derek
This looks like spam. On Nov 15, 11:16 am, Anand wrote: > Hi Michael > > You can try BootStrapToday (http://bootstraptoday.com). Its based on python > and django. > > Regards > Anand -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

What's the best way to display user information in the base template?

2011-11-15 Thread Levi Campbell
I'm trying to create a base template that would display user-specific information such as an avatar and the number of unread messages a user has, what's the best way to do this? I know by reading the documentation that I can check if a user is logged in, which is a start, but doesn't fully answer m

Re: (fundamental) problem with password reset in 1.x: URL's become too long

2011-11-15 Thread Bram de Jong
Hmm, We have 2 milion users and this isn;t really a good solution for us... Does anyone else have an alternative password-reset app which doesn't use as many characters as the default one? - bram On Mon, Nov 14, 2011 at 4:57 PM, creecode wrote: > Hello Bram, > > It's been awhile since I've ha

Re: What's the best way to display user information in the base template?

2011-11-15 Thread Ivo Brodien
Hi, you are basically asking how views and templates work in django. I suggest start with the django tutorials [1] and then you will understand that what you are trying to do is nothing special. You might want to use a decorator called “@login_required” vor your views which show user info. Thi

Re: django.conf.urls.defaults.url documentation

2011-11-15 Thread Justin Myers
Docs are here: https://docs.djangoproject.com/en/1.3/topics/http/urls/#url -Justin On Nov 14, 11:59 pm, Mike Thon wrote: > I recently started working on a new Django project using the latest > release, and I found the function django.conf.urls.defaults.url being used > in urls.py.  There's no pyd

Re: Which Linux distro to use on EC2?

2011-11-15 Thread Eric Chamberlain
For stock web serving stuff, like what you list, we use the Amazon Linux AMI. Amazon handles the optimization and compatibility issues and they are pretty responsive about adding new packages to the distribution. For more specialized applications (VoIP infrastructure, XMPP server), where Amazo

Re: (fundamental) problem with password reset in 1.x: URL's become too long

2011-11-15 Thread Eric Chamberlain
We haven't used it for the password reset, but we've modified this short url code to reduce the length of our urls. -- Eric Chamberlain, Founder RingFree Mobility Inc. On Nov 15, 2011, at 7:11 AM, Bram de Jong wrote: > Hm

Django queryset on floating point range

2011-11-15 Thread RawProt
Hi Django Expert, I came through a problem which I never happened to face before in Django queryset. I have more then 1,00,000 of floating point datatype (records) along with foreign key field in one data model class. What I am trying to do is query on these records with following procedure.

Re: ConditionalGetMiddleware question

2011-11-15 Thread K.C. Smith
To clarify, if I just enable the "ConditionalGetMiddleware" module it won't change anything unless I also put in code to set the 'ETag' or 'Last-Modified' properties on responses for the pages that I want it to work with? That's my interpretation from reading a few sources on the subject. Has any

Anonymous session carries over to authenticated session

2011-11-15 Thread Byron Ruth
I have some data I persist in a user's session regardless if the user is anonymous or authenticated. I noticed after I logged in that my anonymous session data carried over in my authenticated session store. I thought this behavior was a bit unexpected although I could certainly see where this woul

Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
I have a site with lots of views. When someone comes to my site and is not logged in I direct them to the homepage to login. However a user could type in a whole url for a view and it will go there and cause an error because the view expects the user to be logged in. I could put logic in every view

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread Ivo Brodien
Hi, these views are protected by @login_required view, right? If so, users that are not logged in should be redirected to the login view. If you are not using the decorator, how are you handling users that are not logged in these different views? You are probably doing something against the DR

Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
I have a site with lots of views. When someone comes to my site and is not logged in I direct them to the homepage to login. However a user could type in a whole url for a view and it will go there and cause an error because the view expects the user to be logged in. I could put logic in every view

Re: (fundamental) problem with password reset in 1.x: URL's become too long

2011-11-15 Thread Tom Evans
On Tue, Nov 15, 2011 at 3:11 PM, Bram de Jong wrote: > Hmm, > > We have 2 milion users and this isn;t really a good solution for us... > > Does anyone else have an alternative password-reset app which doesn't > use as many characters as the default one? > >  - bram > Beware of url-shorteners, if

Why does collectstatic finds static files in admin 'media' directory?

2011-11-15 Thread Ivo Brodien
Hi, on 1.3.1. I ran: ./manage.py collectstatic --dry-run and it found files in: django/contrib/admin/media/ which is fine, but I am wondering, why these files are found since the docs says, that the default folder apps have to store there static assets is a folder called “static”. I haven’t

Re: Why does collectstatic finds static files in admin 'media' directory?

2011-11-15 Thread Philip Mountifield
I found this a little while ago and reported the mistake in the docs. There is an exception made in the code for the admin media to preserve backwards compatibility, and allow the files to remain in "media" rather than "static". Regards Phil On 15/11/2011 16:34, Ivo Brodien wrote: Hi, on 1.

Re: Anonymous session carries over to authenticated session

2011-11-15 Thread Tom Evans
On Tue, Nov 15, 2011 at 4:08 PM, Byron Ruth wrote: > I have some data I persist in a user's session regardless if the user > is anonymous or authenticated. I noticed after I logged in that my > anonymous session data carried over in my authenticated session store. > I thought this behavior was a b

DJANGO_SETTINGS_MODULE problem

2011-11-15 Thread James Pic
Hi all, I don't understand something about DJANGO_SETTINGS_MODULE. My intention is to serve several websites from the same project installation, by creating a subdir of website-specific settings. project_root/   settings.py   client_settings/     __init__.py     foo.py     bar.py     etc So

Re: Why does collectstatic finds static files in admin 'media' directory?

2011-11-15 Thread Ivo Brodien
Thanks Phil! that should really be in the docs! bye On Nov 15, 2011, at 17:38 , Philip Mountifield wrote: > I found this a little while ago and reported the mistake in the docs. There > is an exception made in the code for the admin media to preserve backwards > compatibility, and allow the f

Re: DJANGO_SETTINGS_MODULE problem

2011-11-15 Thread Tom Evans
On Tue, Nov 15, 2011 at 4:42 PM, James Pic wrote: > Hi all, > > I don't understand something about DJANGO_SETTINGS_MODULE. My > intention is to serve several websites from the same project > installation, by creating a subdir of website-specific settings. > > project_root/ >   settings.py >   clie

Re: Which Linux distro to use on EC2?

2011-11-15 Thread Greg Donald
On Sun, Nov 13, 2011 at 1:56 PM, ydjango wrote: > I am setting up nginex, apache, python django, mysql based application > on EC2. I expect high web traffic and high mysql query usage. Mysql > and web server will on seperate servers. > > Which linux distro should I use for heavy production use - U

Re: DJANGO_SETTINGS_MODULE problem

2011-11-15 Thread Tim Sawyer
I've done this. You should be able to startup the test server with --settings=client_settings/foo.py and get all of settings.py and HELLO available to you. What's not working? Tim. > Hi all, > > I don't understand something about DJANGO_SETTINGS_MODULE. My > intention is to serve several websit

Re: Which Linux distro to use on EC2?

2011-11-15 Thread Tom Evans
On Tue, Nov 15, 2011 at 5:19 PM, Greg Donald wrote: > You know, Linux isn't your only *nix choice for server software.  I've > had much success deploying FreeBSD over the years.  It has a hybrid > package management system.  You can use pkg_add to install a binary > version of something, or you ca

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
Ivo, Thank you. I was not using the @login_required decorator. I was using generic classes like FormView and TemplateView but I see that in order use login_required I have to put it in the url.py file and edit the settings.LOGIN_URL to point to my login page. On Nov 15, 11:25 am, Ivo Brodien

Re: Anonymous session carries over to authenticated session

2011-11-15 Thread Byron Ruth
Thanks for info Tom. This behavior is confusing. I am going to post it on the Django Developers group. On Nov 15, 11:40 am, Tom Evans wrote: > On Tue, Nov 15, 2011 at 4:08 PM, Byron Ruth wrote: > > I have some data I persist in a user's session regardless if the user > > is anonymous or authenti

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread Andres Reyes
You could also use the login_required decorator with the method decorator in the dispatch method of your view 2011/11/15 CrabbyPete > Ivo, > > Thank you. I was not using the @login_required decorator. I was using > generic classes like FormView and TemplateView but I see that in order > use logi

Re: Anonymous session carries over to authenticated session

2011-11-15 Thread Byron Ruth
Posted on Django Developers: http://groups.google.com/group/django-developers/browse_thread/thread/93dd04dc07ddf612 On Nov 15, 1:30 pm, Byron Ruth wrote: > Thanks for info Tom. This behavior is confusing. I am going to post it > on the Django Developers group. > > On Nov 15, 11:40 am, Tom Evans

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread Nan
If this is going to be the case for every single view on your site (i.e. there are no exceptions for help pages or forgotten password views or such), you could probably do it with a custom middleware. But @login_required is probably the best way to go, yeah. On Nov 15, 11:16 am, CrabbyPete wrote:

Re: site organization best practices

2011-11-15 Thread Stuart Laughlin
FWIW I agree with Mike. It's difficult to advise without seeing exactly what you're doing, but I think Mike's advice/approach is sound. --Stuart On Nov 15, 4:16 am, Mike Thon wrote: > I'm no expert here but if it were me building this project, I'd build the > logging mechanism as a separate app

Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread Colin Bean
On Tue, Nov 15, 2011 at 8:25 AM, CrabbyPete wrote: > I have a site with lots of views. When someone comes to my site and is > not logged in I direct them to the homepage to login. However a user > could type in a whole url for a view and it will go there and cause an > error because the view expec

Re: MVP--an open source repository for libraries and modules

2011-11-15 Thread Stuart Laughlin
I came across this acronym again today. I'm quite certain it refers to "minimum viable product," a term popularized by (so says wikipedia) Eric Ries (with whom I am also unfamiliar). --Stuart On Nov 13, 2:56 pm, Kurtis Mullins wrote: > Im assuming he means Model View Presentation because of the

Re: DJANGO_SETTINGS_MODULE problem

2011-11-15 Thread James Pic
On Tue, Nov 15, 2011 at 6:48 PM, Tim Sawyer wrote: > I've done this. > > You should be able to startup the test server with > --settings=client_settings/foo.py and get all of settings.py and HELLO > available to you. > FTR >>> ./manage.py shell --settings=client_settings.foo In [1]: from django

Re: MVP--an open source repository for libraries and modules

2011-11-15 Thread Kurtis Mullins
Ahh okay. That would make more sense :) So basically, he wants someone to code to specs. That should be easy to find. On Tue, Nov 15, 2011 at 2:35 PM, Stuart Laughlin wrote: > I came across this acronym again today. I'm quite certain it refers to > "minimum viable product," a term popularized by

Re: site organization best practices

2011-11-15 Thread Mike Dewhirst
On 16/11/2011 6:11am, Stuart Laughlin wrote: FWIW I agree with Mike. It's difficult to advise without seeing exactly what you're doing, but I think Mike's advice/approach is sound. I agree too. But in today's mail is a link to an answer to a similar question about centralising control of login

Manage exception from external services in a form

2011-11-15 Thread youpsla
Hello, I hope, despite my poor english, to be enough clear. In my Django app, users fill a form with adress, Zip, CIty informations. I like to geocode those informations to fill the lat and lng field of the table db. FOt this tak I use geocoders method from geopy module. It works fine if Google d

Re: Manage exception from external services in a form

2011-11-15 Thread youpsla
Sorry, I've not search enough, I think this post : http://stackoverflow.com/questions/6365318/custom-field-error-from-try-except-in-django-view give me the solution . but one question left, can I do this solution in the form_valid part of my class ... I'll try ... Regards Alain On 16 nov

Re: django.conf.urls.defaults.url documentation

2011-11-15 Thread Mike Thon
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/-/Cq5IlvKfjVAJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe fro