Re: loading a typical image to Django 1.3

2011-06-26 Thread Kenny Meyer
What about your urls.py? Kenny On Sun, Jun 26, 2011 at 1:15 PM, vahidR wrote: > Hi There, > > I have a very basic question about adding images to Django 1.3. > I've almost read the whole documents on adding Static files , searched > for relevant results both in here

Re: Admin User registration problem...

2011-06-16 Thread Kenny Meyer
> i want to create superuser(administrator) on registration User.objects.create_superuser is your friend. >             user=User.objects.create_user( >                 username=form.cleaned_data['username'], >                 password=form.cleaned_data['password1'], >                

Re: using django on a server?

2011-05-10 Thread Kenny Meyer
:-) You will not always need web frameworks. It really depends on what you want to make. http://dfhu.org/blog/should-you-use-a-framework Kenny On Tue, May 10, 2011 at 5:57 AM, Kenny Meyer <knny.m...@gmail.com> wrote: >> 1. What is the purpose of using a web framework like django? C

Re: using django on a server?

2011-05-10 Thread Kenny Meyer
> 1. What is the purpose of using a web framework like django? Could I > get the same functionality by just using pythong cgi and python to > access mysql? (like php scripting) A web application framework is a software framework that is designed to support the development of dynamic websites, web

Re: DateTime in Django (Help)

2011-05-09 Thread Kenny Meyer
Oh! I have found a precious discussion on SO. http://stackoverflow.com/questions/38601/using-django-time-date-widgets-in-custom-form I think you might like the highest-voted solution. Kenny On Mon, May 9, 2011 at 9:28 PM, Kenny Meyer <knny.m...@gmail.com> wrote: > s/sting/string &

Re: DateTime in Django (Help)

2011-05-09 Thread Kenny Meyer
s/sting/string On Mon, May 9, 2011 at 9:27 PM, Kenny Meyer <knny.m...@gmail.com> wrote: >> However, I keep getting validating errors with datetime, probably is >> how I am entering the data. I have also tried the SplitDateTimeWidget >> I am getting the

Re: DateTime in Django (Help)

2011-05-09 Thread Kenny Meyer
ng the same > validation error. I have tried manually creating  the form and it > worked. I wonder what is the normally approach to DateTimeField in > django templates. Is using the > SplitDateTimeWidget the norm or should I use the AdminDateTimeWidget ? > > Thanks again. > >

Re: DateTime in Django (Help)

2011-05-09 Thread Kenny Meyer
On Mon, May 9, 2011 at 10:55 AM, Kevin Miller wrote: > Dear all, > > I am new to django but is in the process of building my first website. I have > been ok for a while as I am not new to programming in python. However, I have > one problem that I cannot figure out the

Re: Best practice for async task in django?

2011-05-06 Thread Kenny Meyer
Look at the Celery project ( http://celeryproject.org/ ) to be sure it fits your needs. You can easily integrate with Django by using https://github.com/ask/django-celery . You could also use a signal, listening for a request_finished, which will run the task inside a Thread. Here's a concrete

Re: form input

2011-04-30 Thread Kenny Meyer
As a newbie I recommend you taking the Django tutorial. Here's the part about forms: http://docs.djangoproject.com/en/dev/intro/tutorial04/ Kenny On Sat, Apr 30, 2011 at 7:24 PM, Pulkit Mehrotra wrote: > can anyone tell me the precise way of taking an input from a

Re: Print "flash" messages in templates for certain levels

2011-04-30 Thread Kenny Meyer
> Or is there other better solution? I think you should handle this in the view, like checking there if the user has sufficient privileges for seeing the message. Kenny -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Custom template tag -- Not registered?

2011-04-29 Thread Kenny Meyer
On Fri, Apr 29, 2011 at 5:11 PM, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Friday, 29 April 2011 21:24:44 UTC+1, Kenny Meyer wrote: >> >> Hello, >> >> I have the following inclusion tag in templatetags/show_submissions.py : >> >

Custom template tag -- Not registered?

2011-04-29 Thread Kenny Meyer
Hello, I have the following inclusion tag in templatetags/show_submissions.py : ## BOF register = template.Library() @register.inclusion_tag('competition/templatetags/show_submissions.html') def show_submissions(participant): submissions = Submission.objects.get(participant=participant)

Re: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Kenny Meyer
Hi Rosemarie, Try a quick google search with terms like "django has no ForeignKey to " and you'll get a bunch of results. I promise. Here's only one of those results: http://stackoverflow.com/questions/609556/django-admin-inlining-foreign-key-issue AFAICS this issue has been discussed various

Re: Running tests automatically as you work.

2011-04-27 Thread Kenny Meyer
something horrible like put os.walk in a loop. > >    call_command: Kenny Meyer pointed this out to me. It lets you run > 'manage.py' commands from a Python script. > http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code > >    

Re: Running Django tests from Python

2011-04-27 Thread Kenny Meyer
Hi Shawn, http://docs.djangoproject.com/en/dev/ref/django-admin/#running-management-commands-from-your-code Does this answer your question? Kenny On Wed, Apr 27, 2011 at 12:41 PM, Shawn Milochik wrote: > Sorry, I realize that last post is missing the context of the

Re: User Profile and Form initial values

2011-04-26 Thread Kenny Meyer
On Tue, Apr 26, 2011 at 4:17 PM, Shawn Milochik wrote: > If you're creating a ModelForm that already has data in the database, don't > pass in request.POST. Instead, pass in the instance with the 'instance' > keyword argument. > > For example, if it was a ModelForm for the

Re: Checking for user type in view

2011-04-24 Thread Kenny Meyer
On Sun, Apr 24, 2011 at 5:23 PM, Shawn Milochik wrote: > It's not recommended that you subclass User. > > Better: Create a class to use for a user profile and associate it with > the User using the instructions here: > >

Re: Checking for user type in view

2011-04-24 Thread Kenny Meyer
> I have done the following, and it works most of the time for me: > > def index(request): >    user = request.user >    if user.is_authenticated(): >        if user.is_superuser: >            return redirect('/admin') > >        judge = None >        participant = None >        competition = None

Checking for user type in view

2011-04-24 Thread Kenny Meyer
Hello guys, In my application models I have two models, Judge and Participant: from django.contrib.auth.models import User class Judge(User): pass class Participant(User): pass In my view I want to find out if the authenticated user is either a Judge or a Participant. How

Re: Unicode translation problem

2011-04-22 Thread Kenny Meyer
On Fri, Apr 22, 2011 at 4:22 PM, John Maines wrote: > Hello, > > I am going through the Django Tutorials on the Django home page. All > has gone fine, except one thing: > > When building the admin page, I can't get the unicode translator to > work. It is supposed to

Re: Extremely Frustrated

2011-04-21 Thread Kenny Meyer
Can you give us the following information: - Django version installed on your system - Full tracebacks, not just what type of Exception has been thrown. Please? Kenny On Thu, Apr 21, 2011 at 4:00 PM, Gandeida wrote: > Hello, > > I have been working through the

Re: How to build a social network

2011-04-20 Thread Kenny Meyer
On Wed, Apr 20, 2011 at 8:09 PM, Rodrigo Ruiz wrote: > Another thing I still haven't decided is between python with Django or ruby > on rails. > I know it's a Django group, so I know i must expect the good aspects on > Django, but why should I use Django instead of ruby

Re: Create a ContentType object on model save

2010-11-09 Thread Kenny Meyer
Kenny Meyer (knny.m...@gmail.com) wrote: > Hello, > > I have two models, 1) FlashCard and 2) Practice, and I have a generic relation > in the FlashCard model pointing to the Practice model using the contenttypes > framework. > The Practice model tracks information like how ma

Create a ContentType object on model save

2010-11-08 Thread Kenny Meyer
ct. I started a research on Google, but I really haven't found anything really helping me to do that. Can you guys give me a helping hand on this with your expertise, please? Additional information about my environment: - Django 1.2.3 - PostgreSQL 8.4.5 Cheers, Kenny -- - Kenny Meyer <kn

Re: Pluggable Q app?

2010-05-15 Thread Kenny Meyer
oks very similar to Stack Overflow, but beware that similar does *not* mean the *same*. Actually, you could cherry-pick all the modules you'd like to have in your app and mix them together. [1] http://github.com/cnprog/CNPROG -- Regards, Kenny Meyer | http://kenny.alwaysdata.net -- You recei

Re: Question!!!

2010-03-05 Thread Kenny Meyer
Russell Keith-Magee (freakboy3...@gmail.com) wrote: > On Sat, Mar 6, 2010 at 6:55 AM, Kenny Meyer <knny.m...@gmail.com> wrote: > > Wilmer A. Delpratt (wdelprat...@gmail.com) wrote: > >> Hi everyone..i'm new in this group...my friends says this is one of > >>

Re: Question!!!

2010-03-05 Thread Kenny Meyer
...my friends says this is one of > the best groups... They're certainly right your friends. ;) Hope I could help, Kenny .. [1] http://www.hoax-slayer.com/email-subject-lines.html .. [2] http://catb.org/~esr/faqs/smart-questions.html -- Kenny Meyer Software Geek | http://kenny.alwaysdata.

Re: Multiple views files

2010-03-04 Thread Kenny Meyer
Tom Evans (tevans...@googlemail.com) wrote: > On Thu, Mar 4, 2010 at 10:39 AM, Kenny Meyer <knny.m...@gmail.com> wrote: > > ... > > I would probably have an app tree structure like this: > > > > test_app/ > > |-- __init__.py > > |-- models.py > >

Re: Multiple views files

2010-03-04 Thread Kenny Meyer
;) > b. many people do it. AFAIK I don't know many Django developers who do that (if any). But why not do it? Large views modules can be quite readable and browseable if your editor supports intelligent code folding. Correct me if I got something wrong. Cheers, Kenny -- Kenny Meyer Soft

Re: upgrade to released version 1.1.1 problems

2010-03-04 Thread Kenny Meyer
xist. Compare your MIDDLEWARE_CLASSES with this working example: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.

Re: Python app Installers

2010-01-27 Thread Kenny Meyer
zweb (traderash...@gmail.com) wrote: > What is the best way to build installer for python/django based > software product ? > Like in Microsoft world you can have .exe and installshield? > > I need to way which can guide user to setup database, run DB script, > set up parameters and guide him

Re: Django 1.1 - Restart required for after creating and saving object for viewing it

2010-01-26 Thread Kenny Meyer
Martin J. Laubach (mjl+goo...@emsi.priv.at) wrote: > > post_info_dict = { > >     'queryset': Post.objects.all(), > > You probably don't want to evaluate your queryset here. Drop the .all > () and you'll be good. > > mjl > Argh, the tiny details... Thanks mjl! -- You received

Django 1.1 - Restart required for after creating and saving object for viewing it

2010-01-26 Thread Kenny Meyer
Hello, Problem: I basically have a blog with a ``Post`` model, representing each post of the blog. Now if I create an object, save it and want to view it I get a 404 Error with Django saying "No post found for". This like this until I restart the development server (actually when

Re: Feed not available - Syndication - Django 1.1.1

2010-01-22 Thread Kenny Meyer
Kenny Meyer (knny.m...@gmail.com) wrote: > El 22/01/10 07:31, Kenny Meyer escribió: > > I'm trying to generate some feeds for my blog with Django's high-level > > Syndication Framework. > > My problem is, when browsing to the URL defined in the ``link`` > > attribut

Feed not available - Syndication - Django 1.1.1

2010-01-22 Thread Kenny Meyer
Hi guys, I'm trying to generate some feeds for my blog with Django's high-level Syndication Framework. My problem is, when browsing to the URL defined in the ``link`` attribute of the ``syndication.Feed`` model, there's no Feed generated/displayed. If not clear what I'm trying to say, please

Re: how relate webpage with databse in my harddisk?

2010-01-06 Thread Kenny Meyer
> How other can access pages i generated with django? You mean how others can access pages which Django generated *for you*. If you're connected with computers in a home network they can see your work with a webbrowser, knowing the IP address of the Pc which is serving the Django "pages". Usually

Re: Django 1.1 - comments - ‘render_comment_ form’ returns TemplateSyntaxError

2009-12-10 Thread Kenny Meyer
On Wed, 9 Dec 2009 21:58:39 -0500 Karen Tracey <kmtra...@gmail.com> wrote: > On Wed, Dec 9, 2009 at 8:24 PM, Kenny Meyer <knny.m...@gmail.com> > wrote: > > > > > /urls.py[shortened]: > > urlpatterns = patterns('', > >(r'', include('p

Django 1.1 - comments - ‘render_comment_for m’ returns TemplateSyntaxError

2009-12-09 Thread Kenny Meyer
Hello, I want to simply render a built-in comment form in a template, using Django's builtin commenting module, but this returns a TemplateSyntaxError Exception. I need help debugging this error, please, because after googling and using the Django API reference, I'm still not getting any

Re: Browsing Django modules from interactive python shell

2009-12-02 Thread Kenny Meyer
.core .) > > On Wed, Dec 2, 2009 at 11:14 AM, Kenny Meyer <knny.m...@gmail.com> > wrote: > > Hi guys, > > > > I have some strange behaviour in my interactive python shell, when > > trying to browse Django modules... > > > > Example: > > >

Re: Browsing Django modules from interactive python shell

2009-12-02 Thread Kenny Meyer
t; '__path__', 'cache', 'exceptions', 'files', 'management', 'signals', > 'urlresolvers'] > > > On Dec 2, 2009, at 11:14 AM, Kenny Meyer wrote: > > > Hi guys, > > > > I have some strange behaviour in my interactive python shell, when > > trying to browse Dja

Browsing Django modules from interactive python shell

2009-12-02 Thread Kenny Meyer
Hi guys, I have some strange behaviour in my interactive python shell, when trying to browse Django modules... Example: >>> import django >>> dir(django.core) AttributeError: 'module' object has no attribute 'core' >>> import django.core >>> dir(django.core) ['__builtins__', '__doc__',