Re: Django driving me nuts

2013-09-01 Thread Alexis Bellido
It seems like you haven't read the documentation. That's the best place to start. Also, as Lloyd already said, you should offer more details about your problem. If you are coming from another programming language or frameworks, you mentioned PHP, you should try to stop comparing and doing

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-27 Thread Alexis Bellido
I just created a ticket reporting this issue as a bug: https://code.djangoproject.com/ticket/18863 Thanks for all the suggestions. On Tuesday, August 21, 2012 2:27:04 PM UTC-3, Alexis Bellido wrote: > > Hello, > > I am working on a Django 1.4 project and writing one simple applicat

Re: runserver error: "No module named app3"

2012-08-23 Thread Alexis Bellido
I'd suggest you decouple your apps from your projects. If you want to have everything under the same tree you could, I don't do it that way though. You could have a tree like this: /home/user --proj proj (this contains settings.py in Django 1.4) app1 app2 --app3 You already noticed

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-23 Thread Alexis Bellido
that does this, which will incur the lookup > costs for all views. > > Bill > > On Tue, Aug 21, 2012 at 1:27 PM, Alexis Bellido > <ale...@ventanazul.com> > wrote: > > Hello, > > > > I am working on a Django 1.4 project and writing one simple applic

Re: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-23 Thread Alexis Bellido
this, which will incur the lookup > costs for all views. > > Bill > > On Tue, Aug 21, 2012 at 1:27 PM, Alexis Bellido > <ale...@ventanazul.com> > wrote: > > Hello, > > > > I am working on a Django 1.4 project and writing one simple application >

CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-21 Thread Alexis Bellido
Hello, I am working on a Django 1.4 project and writing one simple application using per-site cache as described here: https://docs.djangoproject.com/en/dev/topics/cache/#the-per-site-cache I have correctly setup a local Memcached server and confirmed the pages are being cached. Then I set

Re: Django site updater

2012-05-23 Thread Alexis Bellido
I use Fabric to automate as much as possible, not only for production but also for my development and staging environments. I have shared some code in github: https://github.com/alexisbellido/The-Django-gunicorn-fabfile-project I'm currently finishing some changes for making this code more

Re: How do you organize your deployment enviroment

2012-01-05 Thread Alexis Bellido
I think Fabric is the easiest solution, the tutorial is pretty good [http:/fabfile.org], Katie wrote about how she uses Fabric [http://therealkatie.net/blog/2011/nov/28/katie-finally-talks-about-her-fabfiles/], and I tried to extend the idea a little to setup a server from scratch just with a

Re: Django dev/deploy environment for distributed agile teams

2012-01-05 Thread Alexis Bellido
I wrote a Fabric script to automate Django deployment, in my tests with Ubuntu servers (actually, virtual machines running under KVM) the script took 14 minutes from a clean Ubuntu install to a running Django environment. You can get the code in GitHub:

Re: How to deploy new code to the Production Server?

2012-01-05 Thread Alexis Bellido
I don't think you need different braches in your code repository for your development and production (and don't forget staging) environments. The main differences are in the settings.py values and the database used. You can even use the same settings.py for different environments with clever

Solution to custom tags error: 'coltrane_tags' is not a valid tag library

2009-06-28 Thread Alexis Bellido
Hello, I'm reading 'Practical Django Projects' and I'm getting this error from section 'A Simple Custom Tag' on chapter 6: TemplateSyntaxError at /weblog/ 'coltrane_tags' is not a valid tag library: Could not load template library from django.templatetags.coltrane_tags, No module named

How to setup Apache, mod_python and a reverse proxy to Lighttpd for Django on Ubuntu

2008-10-17 Thread Alexis Bellido
Hi guys, I've got my first 'serious' Django application running on a production environment and after learning a lot from the great Django community and extensive documenation I decided to give something back. Here's a simple tutorial on how to setup Apache, mod_python and a reverse proxy to

Re: How to get additional dynamic data into ModelChoiceField and ModelMultipleChoiceField?

2008-10-15 Thread Alexis Bellido
Finally I got my code working by using an __init__ method in my class form to populate my ChoiceField fields as described in this post: http://groups.google.com/group/django-users/browse_thread/thread/98bde0a6d818e627 I also tried Malcolm's suggestion:

Re: How to get additional dynamic data into ModelChoiceField and ModelMultipleChoiceField?

2008-10-14 Thread Alexis Bellido
Replying to myself :) I haven't found the solution yet but after reading a few posts in the group I think I have to try the "dynamic choices in a ChoiceField" approach and forget about the ModelChoiceField. There seems to be a few options on getting that done so I'll try tomorrow with a fresh

How to get additional dynamic data into ModelChoiceField and ModelMultipleChoiceField?

2008-10-14 Thread Alexis Bellido
Hello, I have a Django app with two models: User and ChatRoom. Each user can be the owner of many chatrooms and can also link to his friends's chatrooms. There's is no authentication in this little app, the User model is just a custom model containing user ids. This is an app that will work with

Re: Keyword arguments with spaces and the url tag

2008-10-06 Thread Alexis Bellido
Thanks for the reply. I just submitted it as bug 9315. http://code.djangoproject.com/ticket/9315 Regards. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Keyword arguments with spaces and the url tag

2008-10-05 Thread Alexis Bellido
Hi, I'm reading the docs and was testing named url patterns, I have something like this in my URLConf: url(r'^search/(?P.*)$', 'books.views.search', name='search_page'), And the view is defined like this: def search(request, words): Now I'd like to print a link to the search page with certain

Re: Questions about HttpResponseRedirect and reverse

2008-10-05 Thread Alexis Bellido
Cool, now it's completely clear. Thanks a lot Malcolm :) --~--~-~--~~~---~--~~ 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

Re: Questions about HttpResponseRedirect and reverse

2008-10-05 Thread Alexis Bellido
After some more reading and testing I'll try to answer myself, if any of you could confirm if I'm on the right track please let me know and please correct me if I'm not using the right terminology as well: First, in my URLConf I have a url pattern like: (r'^search/$', 'books.views.search', {},

Re: Questions about HttpResponseRedirect and reverse

2008-10-05 Thread Alexis Bellido
Hey, Malcolm, maybe an example could help. I'm reading the forms documentation at http://docs.djangoproject.com/en/dev//topics/forms/ and I see this code as part of the view function for a contact form: def contact(request): if request.method == 'POST': # If the form has been submitted...

Re: Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Alexis Bellido
Cool, thanks for the confirmation. I'm still devouring all the documentation, a couple of books and practicing a lot on Django :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Alexis Bellido
Hello, I was reading this discussion: http://groups.google.com/group/django-users/browse_thread/thread/d2d9ed6599089301 There Donn asks: "Lastly, on the decoupling thing again, if I end up using (sometime) HttpResposeRedirect(reverse(project.app.view)) does that not tie the view to the app to

Re: How to know which fields a model contains?

2008-08-29 Thread Alexis Bellido
That's also a good idea. Thanks Jim. --~--~-~--~~~---~--~~ 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

Re: Modules path when importing models

2008-08-29 Thread Alexis Bellido
Thanks a lot, now I get it. That's exactly why I asked, I suspected that the imports had to be done is such a way that they would be independent of the location of app so I can reuse the code in many projects. Cheers! --~--~-~--~~~---~--~~ You received this

Re: How to know which fields a model contains?

2008-08-25 Thread Alexis Bellido
Thanks everybody, using __dict__ and meta_fields helped but the most complete data came from the documentation in admin, that's exactly what I needed :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Modules path when importing models

2008-08-25 Thread Alexis Bellido
I'm reading the Django book and playing with the 'mysite' test site, in many parts I've noticed something like this in views.py: from mysite.models import Event, BlogEntry I was wondering if it's good practice using 'mysite.models' (which seems to be an 'absolute path' for importing) or if it

How to know which fields a model contains?

2008-08-21 Thread Alexis Bellido
Hello, I'm reading the Django book and after reviewing the database API I was wondering if there was some method to find out which fields a model contains. For example, if I have a Publisher model (which translates to a publisher table in the database) I'm looking for some method in Django