Re: django-admin.py startproject mysite

2012-06-18 Thread Seyfullah Tıkıç
Ok, now I did it as you said. It is the same : C:\Python27\MyFiles>assoc .py=py_auto_file .py=py_auto_file C:\Python27\MyFiles>ftype py_auto_file="C:\Python27\python.exe" "%1" %* py_auto_file="C:\Python27\python.exe" "%1" %* C:\Python27\MyFiles>t.py a s d Argument 0 is C:\Python27\MyFiles\t.py

Re: Wsgi path problem: deploying on a production server

2012-06-18 Thread Daniel Sokolowski
I believe you can accomplish handling specific locations with different modules by using the Location and SetHandler directives and using Alias for static content. Notice how I activate the "server-status" module on a sub directory of a site, and how I handle static content all from one

Re: Implementing Django Search

2012-06-18 Thread Daniel Sokolowski
I also found that piece of code when I needed to implement search - it was confusing so I ended up with my own approach that was easier to understand and simpler at least to me - I pasted an example of live code here: http://dpaste.org/KYhUq/ The searching piece of code is in the form_valid()

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread Kurtis Mullins
I've read over this many a time -- never paid much attention because I don't use Oracle: https://docs.djangoproject.com/en/dev/ref/models/fields/#null Anyways, if you don't allow NULL and you don't allow empty strings, what are you going to put in there when there's nothing? On Mon, Jun 18, 2012

RE: Using the django.contrib.auth User in my model - database error

2012-06-18 Thread LiuXianghe
Date: Sun, 10 Jun 2012 03:49:36 -0700 From: jonathan.talis...@gmail.com To: django-users@googlegroups.com Subject: Re: Using the django.contrib.auth User in my model - database error I just used an sqlite3 and sqlitemanager which is a sqlite front-end , I am guessing it should not be too

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread André Pang
On Jun 18, 2012, at 4:05 PM, Ian wrote: >> I'd assume that Django would only generate schemas where NULL is allowed for >> fields where blank=True, and that fields where blank=False would have "NOT >> NULL" included in the Oracle DDL. > > blank=True is a validation option, not a database

Re: Making fields read-only after first save in admin

2012-06-18 Thread Russell Keith-Magee
On Tue, Jun 19, 2012 at 4:11 AM, Thomas Weholt wrote: > I want to make a few foreignkey-fields read-only in the admin after > the post is saved, ie when the change-form for that item is opened > after the item has been saved the two foreignkeys in question should > not be

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread Ian
On Monday, June 18, 2012 2:17:26 PM UTC-6, André Pang wrote: > > Hi all, > > The Django Oracle documentation has the following to say about NULL and > empty > strings > (emphasis > mine): > > Django generally

Re: Custom Tags and Includes, invalid block !

2012-06-18 Thread Ernesto Guevara
Hi! Try {% load name_of_custom_tag %} after the extends tag in template. 2012/6/18 upmauro > Hello, sorry my english ! > > I have one question, i create one custom tag and this works fine. > > But i have a situation : > > *site.html* > * > * > {% include "header.html" %} >

Custom Tags and Includes, invalid block !

2012-06-18 Thread upmauro
Hello, sorry my english ! I have one question, i create one custom tag and this works fine. But i have a situation : *site.html* * * {% include "header.html" %} Django looks the best framework for web ! {% include "footer.html" %} If, i use {% load %} in site.html, tag works, but if i {%

Re: django-admin.py startproject mysite

2012-06-18 Thread Seyfullah Tıkıç
Thank you for suggestions. What I have done is as follows : The problem still exists, what can I do next? C:\Users\syftkc>assoc .py .py=py_auto_file .py .py=py_auto_file C:\Users\syftkc>ftype py_auto_file py_auto_file="C:\Python27\python.exe" "%1" % py_auto_file

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread salai...@gmail.com
Hello ! You must import the user model before using it ! Thks Le lundi 18 juin 2012 14:29:55 UTC, Kurtis a écrit : > > Give this a shot: > > user = User.objects.create_user(request.POST['apelido'], > request.POST['email'], request.POST['pwd']) > user.save() > profile = user.get_profile()

Re: django-admin.py startproject mysite

2012-06-18 Thread Seyfullah Tıkıç
Any suggestions please? 2012/6/18 Seyfullah Tıkıç > Yes, I restarted my computer. > > > 2012/6/18 şahin mersin > >> Did you restart your computer? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users"

Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread André Pang
Hi all, The Django Oracle documentation has the following to say about NULL and empty strings (emphasis mine): Django generally prefers to use the empty string ('') rather than NULL, but > Oracle treats both

Select * from users,country where country.id = users.id in Django using amin.contrib

2012-06-18 Thread django noob
Greetings Django Experts! Say for example i have the following on my models.py class Country(models.Model): name = models.CharField(max_length=50) def __unicode__(self): return u'%s %s' % (self.name, self.ID) class Meta: verbose_name = 'Countries' class Users(models.Model): name =

blank, null, Oracle, and empty_strings_allowed

2012-06-18 Thread André Pang
Hi all, The Oracle database backend has the following note about NULLs vs empty strings (emphasis is mine): Django generally prefers to use the empty string ('') rather than NULL, but > Oracle treats both identically. To get around this, the Oracle backend > ignores an *explicit null option

Wsgi path problem: deploying on a production server

2012-06-18 Thread wgw
I was able to deploy my django app on a new server with this configuration option: WSGIScriptAlias / app1.wsgi Everything works beautifully (so I have wsgi configured properly), but the wsgi script captures all traffic to my server, which I don't want. So I tried this: WSGIScriptAlias

Making fields read-only after first save in admin

2012-06-18 Thread Thomas Weholt
I want to make a few foreignkey-fields read-only in the admin after the post is saved, ie when the change-form for that item is opened after the item has been saved the two foreignkeys in question should not be editable. In my case the user has to chose two foreignkeys when first adding an entry,

Re: Implementing Django Search

2012-06-18 Thread Nikolas Stevenson-Molnar
There are a number of ways you can use it. Must straight-forward is to use built-in views with a customized template: http://django-haystack.readthedocs.org/en/latest/tutorial.html#setting-up-the-views You can get a bit more advanced by using the various search forms with your own view:

Re: Implementing Django Search

2012-06-18 Thread DF
Does it provide instructions on connecting it to a search form? Dumb question, but sometimes documentation can be lacking. On Monday, June 18, 2012 2:40:58 PM UTC-4, Nikolas Stevenson-Molnar wrote: > > I've used Haystack with Whoosh: http://haystacksearch.org/. It's > straight-forward, well

Re: Implementing Django Search

2012-06-18 Thread Nikolas Stevenson-Molnar
I've used Haystack with Whoosh: http://haystacksearch.org/. It's straight-forward, well documented, and mimics the Django ORM. No need to parse the query yourself or anything like that, just pass the raw input to Haystack and enjoy delicious search results :) _Nik On 6/18/2012 11:23 AM, DF

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread upmauro
Solve, thank you ! On Monday, June 18, 2012 11:29:55 AM UTC-3, Kurtis wrote: > > Give this a shot: > > user = User.objects.create_user(request.POST['apelido'], > request.POST['email'], request.POST['pwd']) > user.save() > profile = user.get_profile() > profile.apelido = request.POST['apelido'] >

Implementing Django Search

2012-06-18 Thread DF
I'm working on my first project and I'm attempting to implement a basic search function where users can search for a specific terms. There are many options available, most a bit too heavy for what I require. I found this posting which illustrates how to implement a basic search function that

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Kurtis Mullins
On Mon, Jun 18, 2012 at 1:45 PM, Dennis Lee Bieber wrote: > > > First, is everybody on the same page (terminology)... (Independent > of Django) > >First is: multiple database engines (SQLite3, MySQL, Access/JET, > etc.). Working across multiple engines is

Re: django-admin.py startproject mysite

2012-06-18 Thread Seyfullah Tıkıç
Yes, I restarted my computer. 2012/6/18 şahin mersin > Did you restart your computer? > > -- > 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

Re: django-admin.py startproject mysite

2012-06-18 Thread Seyfullah Tıkıç
I created a file named t.py and wrote what you wrote. In the first step, I see this : C:\Python27\MyFiles>t.py a one and a two Argument 0 is C:\Python27\MyFiles\t.py 2012/6/18 Dennis Lee Bieber > On Sun, 17 Jun 2012 15:54:39 -0700 (PDT), stikic >

Production errors

2012-06-18 Thread Satan Study Django
Hi. As said in the https://docs.djangoproject.com/en/1.4/howto/error-reporting/ production server with "DEBUG = False" will send "Unhandled exception" errors to ADMINS and it's great. But besides it will return http error code 200 and if I'd make some http check for my service, like nagios

Re: Authentication

2012-06-18 Thread Jonathan Baker
I just implemented Django Registration on an app and found it very easy to work with: https://bitbucket.org/ubernostrum/django-registration/ On Mon, Jun 18, 2012 at 9:14 AM, Harjot Mann wrote: > I want to give a username and password to my project in django...can >

Re: Django Tutorial part 2... Admin Site won't work...

2012-06-18 Thread Harjot Mann
have you uncomment the lines in the urls.py file???if not uncomment the 4th,5th and 16th line in urls.py file And then run the server command. On Mon, Jun 18, 2012 at 1:06 PM, Laurence MacNeill wrote: > I'm using 1.4 > > I finally figured out that if I just create

Authentication

2012-06-18 Thread Harjot Mann
I want to give a username and password to my project in django...can anyone tell me what should i do??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Kurtis Mullins
> > On Mon, Jun 18, 2012 at 9:30 AM, Daniel Roseman > wrote: There are certain "advanced" features of Django - multiple DBs, model > subclassing, that sort of thing I feel there's quite a few problems that would be relatively unsolvable without model subclassing. At

Re: Problem using User.get_profile() in DJANGO

2012-06-18 Thread Kurtis Mullins
Give this a shot: user = User.objects.create_user(request.POST['apelido'], request.POST['email'], request.POST['pwd']) user.save() profile = user.get_profile() profile.apelido = request.POST['apelido'] profile.save() Also, I recommend using Forms (and better yet, ModelForms with Class-Based

Problem using User.get_profile() in DJANGO

2012-06-18 Thread upmauro
Sorry my english. In my *models.py* class Usuario(models.Model): user = models.ForeignKey(User,primary_key=True) apelido = models.CharField(max_length=75, blank=True) class Meta: db_table = u'usuario' def create_user_profile(sender, instance, created, **kwargs): if

Re: Apache/mod_wsgi documentation problem

2012-06-18 Thread Daniel Roseman
On Monday, 18 June 2012 13:42:46 UTC+1, coolgeek wrote: > > Hello - > > Django newb. I hope this is the right place to post this. > > I had a problem with the virtualenv section of the Apache/mod_wsgi > documentation > > >

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread Daniel Roseman
On Monday, 18 June 2012 13:16:55 UTC+1, lawgon wrote: > > On Mon, 2012-06-18 at 05:12 -0700, Daniel Roseman wrote: > > Multiple databases is a whole different > > question, which you really don't want to get into as a newbie (or, > > indeed, > > at all if possible). > > could you elaborate on

Re: Various thoughts on authentication, registration and social logins

2012-06-18 Thread Ien Cheng
Mattias, It may be worth checking out django-allauth. It doesn't use the flow you are proposing -- as register-by-email users do need to enter a password -- but it has an nicely integrated one-click login via Facebook/Google/etc. alternative option for users. I haven't tried, as I like the

Apache/mod_wsgi documentation problem

2012-06-18 Thread coolgeek
Hello - Django newb. I hope this is the right place to post this. I had a problem with the virtualenv section of the Apache/mod_wsgi documentation https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/#using-a-virtualenv Please remove the line: "To do this, you can add

Re: multiple databases [was]Trying to find something in multiple databases... Confused...

2012-06-18 Thread kenneth gonsalves
On Mon, 2012-06-18 at 05:12 -0700, Daniel Roseman wrote: > Multiple databases is a whole different > question, which you really don't want to get into as a newbie (or, > indeed, > at all if possible). could you elaborate on this - I was thinking on getting into multiple databases and would

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Daniel Roseman
On Monday, 18 June 2012 08:40:53 UTC+1, Laurence MacNeill wrote: > > Ok, I'm a total django noob here, so I am probably doing this wrong... > But here goes... > > When someone comes to my django app's root (index), I need to verify their > user-name (which is stored in a Linux environment

Re: How to call perl script in my django application

2012-06-18 Thread Sergiy Khohlov
>>> from subprocess import call >>> call("uname") Linux 0 >>> call("uname", "-a") 2012/6/18 Carsten Agger : > Den 18-06-2012 13:10, Tanveer Ali Sha skrev: >> >> sorry, i dint get that.Please can u give example .?? >> >> >>  visit this group at

Re: Stuck already on step one, django on windows

2012-06-18 Thread Vincent
I had the same problem as you do. You can try the instructions on this site: http://djangolife.blogspot.sg/2008/06/part-vi-django.html Remember to restart your cmd prompt after you changed the environment variables though. I didn't and it took me sometime to figure out that the reason the

Re: How to call perl script in my django application

2012-06-18 Thread Carsten Agger
Den 18-06-2012 13:10, Tanveer Ali Sha skrev: sorry, i dint get that.Please can u give example .?? visit this group at http://groups.google.com/group/django-users?hl=en. There's a discussion of how to do this here:

Re: How to call perl script in my django application

2012-06-18 Thread Tanveer Ali Sha
sorry, i dint get that.Please can u give example .?? On Mon, Jun 18, 2012 at 4:36 PM, Sergiy Khohlov wrote: > Such as in trivial python code . Check python system and os module > > 2012/6/18 Tanveer Ali Sha : >> Hello, >> >> how can I call Perl

Re: How to call perl script in my django application

2012-06-18 Thread Sergiy Khohlov
Such as in trivial python code . Check python system and os module 2012/6/18 Tanveer Ali Sha : > Hello, > > how can I call Perl script (EX:hello world) in my django application ? > > -- > You received this message because you are subscribed to the Google Groups >

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Melvyn Sopacua
On 18-6-2012 9:52, Laurence MacNeill wrote: > well -- I hit the wrong key and posted that before I was finished typing... > > here's what's in my views.py file: > def index(request) > current_username = os.environ['REMOTE_USER'] And you're sure this works? Try: return

How to call perl script in my django application

2012-06-18 Thread Tanveer Ali Sha
Hello, how can I call Perl script (EX:hello world) in my django application ? -- 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

SOLVED: Django 1.3 Admin Changelist column alignment

2012-06-18 Thread kooliah
I solved cloning and renaming the templatetag result_list (the rows builder) and modifying it. It checks if the field is a number and set the class attribute of the tag to "numb", so using the admin css i can change alignment Obviously i had to override change_list.html too to let it load my

Re: Various thoughts on authentication, registration and social logins

2012-06-18 Thread Melvyn Sopacua
On 18-6-2012 2:25, Mattias Linnap wrote: > I would argue that this is as secure as ordinary password reset emails. > Emailing users their passwords is insecure if they *themselves* chose > the password - because they often re-use it on multiple sites. > As long as it is a randomly generated one,

Re: full_validation fails upon validating an inherited model

2012-06-18 Thread Carsten Reimer
in my previous post I named the method in question full_validation. This is obviously wrong. It must be full_clean. Sorry for that. Carsten Reimer schrieb: Hallo, I have a problem running Django's full_validation-method upon an instance of an inherited model. Please consider the following

full_validation fails upon validating an inherited model

2012-06-18 Thread Carsten Reimer
Hallo, I have a problem running Django's full_validation-method upon an instance of an inherited model. Please consider the following two models: class ParentModel(models.Model): parent_model_id = models.IntegerField(primary_key=True) parent_model_attr =

Re: Trying to find something in multiple databases... Confused...

2012-06-18 Thread Laurence MacNeill
well -- I hit the wrong key and posted that before I was finished typing... here's what's in my views.py file: def index(request) current_username = os.environ['REMOTE_USER'] This should provide me with their username (yes I do have 'import os' at the top of the file)... Now, after I get

Trying to find something in multiple databases... Confused...

2012-06-18 Thread Laurence MacNeill
Ok, I'm a total django noob here, so I am probably doing this wrong... But here goes... When someone comes to my django app's root (index), I need to verify their user-name (which is stored in a Linux environment variable). Based on where (or if) I find their user-name, I want to send them

Re: Django Tutorial part 2... Admin Site won't work...

2012-06-18 Thread Laurence MacNeill
I'm using 1.4 I finally figured out that if I just create the site manually, everything works fine... I don't know why it wasn't being created when syncdb was run... L. On Sunday, June 17, 2012 2:17:35 AM UTC-4, Xavier Ordoquy wrote: > > Hi, > > The site entry is usually created when the