sites framework + gunicorn

2011-03-02 Thread ronny
Hi, I'm trying to run multiples sites using the sites-framework, and gunicorn. I'm using the same project, same databases, only I try to use different settings.py files with different names. The idea is that in each gunicorn instance I set the DJANGO_SETTINGS_MODULE to a different settings.py fi

Re: sites framework + gunicorn

2011-03-06 Thread ronny
what I mean is that each supervisor thread calls a separate gunicorn process. Sorry I'm getting the terms confused. Anyway, I tried it, but I'm still having trouble. Here is my supervisor.conf [program:gunicorn-blog-HE-development] directory=/var/www/blog.development/private/blog command=/var/

rewrite rules

2011-03-06 Thread ronny
I have to make a blog application in multiple languages, to do this, I decided to use zinnia and create to separate urls blogfrench.com and blog.com (this is an example). I also used the multisite ability of django to have a single admin interface for both blogs. It works great, now I have a non-

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread ronny
Ignore the rest of these guys, and go here: http://south.aeracode.org/docs/tutorial/part1.html#tutorial-part-1 It's called django-south, all the cool kids are using it. Enjoy. :D -ron On Mar 8, 7:34 am, pankaj sharma wrote: > same as categories i have to add affiliation to every college. > s

Re: Filter on multiple fields and/or multiple values...

2008-10-29 Thread Ronny Haryanto
val, field2=val) You can even chain filters together to achieve the same effect: http://docs.djangoproject.com/en/dev/topics/db/queries/#id1 If you want to OR them together, have a look at Q objects: http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects Ronny --

Re: change the DEBUG in settings.py base on the remoteaddr

2008-11-05 Thread Ronny Haryanto
it loosely coupled probably should not) know anything about http requests. Have a look at INTERNAL_IPS setting to achieve what you want: http://docs.djangoproject.com/en/dev/ref/settings/#internal-ips Ronny --~--~-~--~~~---~--~~ You received this message because you ar

Re: Select only two posts from a database list and show them on a HTML page

2008-11-05 Thread Ronny Haryanto
lle', department]).order_by('-created')[:2] > Later on my plan is to make the archive so the messages again is > filtered or sorted in month, so the user can see that e.g. in November > month this and this message was posted and in Oc

Re: django admin - list filter - issues with model fields having name ending in 'y'

2008-11-05 Thread Ronny Haryanto
if this has any relation to your problem, but shouldn't the verbose_plural_name value be in lowercase (i.e 'countries' not 'Countries')? Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &

Re: Select only two posts from a database list and show them on a HTML page

2008-11-05 Thread Ronny Haryanto
nd out, they could inspect the generated SQL queries to check. I only use the slice filter if it's not possible for me to know in the view beforehand how I'm going to slice my list, or if I know for sure the size of my list is relatively small. Ronny --~--~-~--~~~-

Re: Change date format in admin

2008-11-11 Thread Ronny Haryanto
USE_I18N = True in your settings. Ronny --~--~-~--~~~---~--~~ 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, s

Re: Adding a "subtotal" row to the Admin change list page?

2008-11-11 Thread Ronny Haryanto
not too sure about this though). Once you get the subtotal you can display it using custom admin template. Hope that gives you a starting point. Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Intercepting return from new ForeignKey popups? (RelatedObjectLookups.js)

2008-11-18 Thread Ronny Haryanto
e update_info() in the opener template to do whatever's necessary. This is similar to what django's admin is doing (see django/contrib/admin/options.py around line 427 under response_add()). Hope I'm still making sense. It's 1am here. Ronny --~--~-~--~~~-

Re: How to create a form with dynamic number of fields?

2008-11-18 Thread Ronny Haryanto
However it's the > logic behind that gets me. Suggestions? James Bennett just recently wrote a (excellent) blog post about dynamic forms: http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/ Ronny --~--~-~--~~~---~--~~ You received this message because

Re: Django 1.0 tutorial

2008-11-27 Thread Ronny Haryanto
evs is stretching it a bit, don't you think? > > Have you looked at the license under which that book was released? > http://www.djangobook.com/license/ Malcolm, I think the previously mentioned book was Practical Django Project

Re: login problem

2008-12-06 Thread Ronny Haryanto
t;. That exception will always be raised if the view is called via GET method instead of POST. If you're sending it via POST, then the information you provided was not sufficient. We need to see template code that renders the form (or the html form if you're not using templates) and probably

Re: Development server crash with no error message

2008-12-09 Thread Ronny Haryanto
ly saw from the exceptions that there was an infinite recursion. It turned out that I defined a custom Manager's get_query_set() in a very wrong way causing an infinite loop (I stupidly returned self.filter(...) instead of calling super like the doc says). I don't know if this would help i

Re: How do wire Userprofile to UserAdmin ?

2008-12-09 Thread Ronny Haryanto
j.myapp.models import UserProfile class UserProfileAdminInline(admin.TabularInline): model = UserProfile class NewUserAdmin(UserAdmin): inlines = [UserProfileAdminInline] admin.site.unregister(User) admin.site.register(User, NewUserAdmin) Ronny --~--~-~--~~~--

Re: missing admin documentation

2008-12-09 Thread Ronny Haryanto
e, I > have my IP address listed in INTERNAL_IPS. > > Any ideas? Do you have 'django.contrib.admindocs' in your INSTALLED_APPS? Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

model instance version numbering, or concurrent model editing

2008-12-11 Thread Ronny Haryanto
rticular issue first, but if the bigger picture makes any difference: my WikiPage model is actually an abstract model, and I wanted to provide this feature for all of its subclasses. I would appreciate any help. Cheers, Ronny --~--~-~--~~~---~--~~ You received

Re: Filtering parents by child attributes

2009-01-04 Thread Ronny Haryanto
filter Students with no absences? > > something like Student.objects.filter(absence_set__count=0) CMIIW, but I think something like this should work: Student.objects.filter(absence__isnull=False) Ronny --~--~-~--~~~---~--~~ You received this message because you are s

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake wrote: > for category in category_list: >results = results.filter(categories__slug = category.slug) How about results.filter(category__in=category_list)? Ronny --~--~-~--~~~---~--~~ You received this m

Re: Dynamic OR statements

2009-01-05 Thread Ronny Haryanto
On Mon, Jan 5, 2009 at 11:59 PM, Ronny Haryanto wrote: > On Mon, Jan 5, 2009 at 11:52 PM, Bluemilkshake > wrote: >> for category in category_list: >>results = results.filter(categories__slug = category.slug) > > How about results.filter(category__in=category_li

Re: single list items in templates

2008-07-17 Thread Ronny Haryanto
an error > > > {{ data.0 }} should do the trick. Or {{ data|first }}. http://www.djangoproject.com/documentation/templates/#first Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

Re: How to tiger mail

2008-08-19 Thread Ronny Haryanto
plenty of info regarding cron on the web: http://www.google.com/search?q=cron Ronny --~--~-~--~~~---~--~~ 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@googleg

Re: Browser timeout on long processes

2008-08-20 Thread Ronny Haryanto
x27;repeatedly' to see the progress or completion of > the job. There is at least one such project that is specific to Django: http://code.google.com/p/django-queue-service/ Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-27 Thread Ronny Haryanto
7;) or 0) half = int(m.group('half') == u'\xbd') return (30.48 * feet) + (2.54 * inch) + (1.27 * half) I save the length in centimeters in database, then I can reformat it as needed in the template or admin using a custom filter. Ronny --~--~-~--~~

Re: About Site in django

2008-08-27 Thread Ronny Haryanto
explain how this variable is assigned? It's already set probably because INSTALLED_APPS includes 'django.contrib.sites' by default. More info: http://docs.djangoproject.com/en/dev/ref/contrib/sites/ Ronny --~--~-~--~~~---~--~~ You received this message b

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-30 Thread Ronny Haryanto
On Fri, Aug 29, 2008 at 2:54 AM, bkev <[EMAIL PROTECTED]> wrote: > > Ronny, > > This is fabulous...thank you so very much. If you don't mind me > asking, can you give me an example of how you implemented this method > in your Class? In my case, I've defined the f

Re: name 'admin' is not defined

2008-09-02 Thread Ronny Haryanto
#x27;admin' is not defined This probably sounds silly, but since you don't give any code snippets then I can't be sure. Have you uncommented the import line: from django.contrib import admin in urls.py? Ronny --~--~-~--~~~---~--~~ You receiv

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-09-04 Thread Ronny Haryanto
On Fri, Sep 5, 2008 at 1:53 AM, bkev <[EMAIL PROTECTED]> wrote: > > Ronny, > > Thank you so very much for your input; it has helped this newbie user > a great deal. The one outstanding problem I'm having here (and it's > the last field in my model...)

Re: DjangoCon video

2008-09-11 Thread Ronny Haryanto
goCon videos will be made available on the djangocon.org site. I will make a loud announcement when they're available." Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Generating widget based on class type for a Custom Form

2008-10-06 Thread Ronny Haryanto
get the > correct comparison. It always return true. Any idea how to fix this ? Leon, Any reason why {{ field.as_widget }} wouldn't work in your case? Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Ronny Haryanto
On Tue, Oct 7, 2008 at 7:31 PM, Leon Yeh | New Avenue.net <[EMAIL PROTECTED]> wrote: > Hi Ronny, terima kasih... :-) Sama-sama :-) > I am trying to generate different output for css styling purpose. > > For example for select widget I need to generate > > > and fo

Re: Best Practices in Implementing Mini-Content Boxes Across the Site

2008-10-13 Thread Ronny Haryanto
mplates supports inheritance and a way to include other templates that should make it easier: http://docs.djangoproject.com/en/dev/topics/templates/#id1 http://docs.djangoproject.com/en/dev/ref/templates/builtins/#include For static blocks, there's also a 3r

Re: icontains case-sensitive on MySQL

2008-10-16 Thread Ronny Haryanto
] >>>> b.filter(name__icontains='saff') > [] Could you do: from django.db import connection connection.queries to see the raw SQL queries? Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Limit choices by object, not model

2008-10-16 Thread Ronny Haryanto
x27;t need to) have any knowledge of that. Ronny --~--~-~--~~~---~--~~ 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 t

Re: some help with urls

2008-03-31 Thread Ronny Haryanto
Try: r'^test/fullpath/(?P[\w/]+) Ronny On Mon, Mar 31, 2008 at 4:08 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote: > > Hey guys, > > I'm trying to setup my urls.py file and am having trouble getting the > args to be passed correctly to my view. I basica

Re: Best practice for databases and distributed development with Django

2008-04-02 Thread Ronny Haryanto
atabase directly. Other developers would need to pay attention for additions in the SQL changes directory and update their database accordingly whenever there's a new file there. Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: passing form to base template

2008-04-28 Thread Ronny Haryanto
ase template, and have all the other inherited templates > get the forms too? the default forms are all static - no dynamic > values. Would a custom context processor work for you? http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext Ronny

Re: get for errors as string and not as HTML

2008-04-29 Thread Ronny Haryanto
m.user_name.errors as a python list (e.g. iterate with for, join, etc). Ronny --~--~-~--~~~---~--~~ 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@googl

Re: Access Control List

2008-05-01 Thread Ronny Haryanto
t; > Anyone has some sample code? The documentation clearly says that it's not currently possible (that is if you're using django's auth system). http://www.djangoproject.com/documentation/authentication/#permissions Ronny --~--~-~--~~~---~--~~ Yo

Re: Change password only for administrators

2008-05-07 Thread Ronny Haryanto
On Wed, May 7, 2008 at 4:21 PM, Alessandro Ronchi <[EMAIL PROTECTED]> wrote: > I want to make the change of the password possible only for administrators > and > not the whole staff. Is it possible? How I can do that? How do you currently allow staff to change p

Re: Getting back to the same page after completing a task in another page

2008-05-11 Thread Ronny Haryanto
, you could probably record the user's trail or view history in the database, then show it somewhere in the page, so the user can decide themselves which page they want to go back to. Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Dynamic lookup

2008-05-17 Thread Ronny Haryanto
hon kwargs (keyword arguments). You can do this: dictionary = {field1: val1, field2: val2} model.objects.filter(**dictionary) Ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: load external xml and css with varibles?

2008-05-21 Thread Ronny Haryanto
ed to HTML only. You can do something like this in the view: render_to_response('style.css', {'bgcol': '#fff', }) Then in style.css you can have: background-color: {{ bgcol }} You might need to set the correct mime type when ser

Re: Help for strategy to load dynamic content by domain (not subdomains)

2008-06-10 Thread Ronny Haryanto
r a different strategy completely, I > would love to hear those as well. You might be interested in this: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser You could extend/replace the middleware to capture the domain (instead of the user) from the

Re: How to handle all DoesNotExist?

2008-06-14 Thread Ronny Haryanto
xception. from django.db import models try: AnyModel.objects.get(pk=nonexistant) except (models.ObjectDoesNotExist): do whatever It should work as long as AnyModel is a subclass of models.Model. Ronny --~--~-~--~~~---~--~~ You received this message because

Re: CMS application: auto-setting the post author

2008-06-16 Thread Ronny Haryanto
s-based form, it requires that I select an author from a > list of existing users. What I'd prefer is to leave out the author > field entirely from the add form and have that field automatically set > to the current user. How can I do that? This is one way to do it:

Re: CMS application: auto-setting the post author

2008-06-16 Thread Ronny Haryanto
(which I personally prefer because it's more explicit and clear), is to do it in the view. Don't show the author field in the form, because we want to automatically add it before saving. def add_item(request): ... item.author = request.u

where to run extra SQL when "manage.py reset appname" is run

2006-06-20 Thread Ronny Srnka
t there doesn't seem to be a place for other SQL (like trigger declerations). thanks, ronny --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: problem with ImageField does not show me the picture on a template

2013-05-23 Thread Ronny Villarroel Mendoza
Thanks a lot. I do the following steps: aggregate an alias to the virtual host of my site: Alias /media /var/www/fourweb/media/ and modified: settings.MEDIA_ROOT = '/var/www/fourweb/media/' settings.MEDIA_URL = 'http://fourweb.com/media/' it works!. Cheers Ronny El martes

Re: View pictures from the template via models.FilePathField

2013-05-24 Thread Ronny Villarroel Mendoza
settings.MEDIA_URL, for use the imageField. Regards, Ronny El jueves, 23 de mayo de 2013 03:57:02 UTC-4, Federico Erbea escribió: > > I'm not sure this is the correct method to use, so I'm open to suggestions. > Practically I want to display the image retrieving the path where they ar