more info to the user

2012-08-14 Thread heni yemun
Hi, I have set up a UserProfile using the technique outlined in the standard. What i can do give values to the fields in the user profile model. So if i've a city field in the UserProfile, how can i put the value 'Asmara' to it and save it in the database? Second question is whenever i try to

Re: 'NoneType' object has no attribute 'datetime' bug?

2012-08-14 Thread Peter of the Norse
I had a similar problem in one of my views. It looked like: from X import y def my_func(): foo = y.baz() ... y = foo + bar; Since I was assigning to y later in the function, “y” represented a local variable throughout the function. Somewhere you have “datetime =”, but it might be

Re: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-14 Thread Sky
I've having a similar problem here using Django 1.4 and I can't quite figure what's wrong. The error reads: Could not import polls.views.index. View does not exist in module polls.views. urls.py from django.conf.urls import patterns, include, url from django.views.generic import DetailView,

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
Thanks for all! i'm solving this problem! 2012/8/14 Melvyn Sopacua > On 15-8-2012 1:02, Furbee wrote: > > > DJANGO_SETTINGS_MODULE is an environment variable that must be set. I > > believe this is taken care of for you when you create a project using > > django-admin.

'bool' object has no attribute 'render'

2012-08-14 Thread yao ge
When delete a record in admin raise error : Request Method: POST Request URL:http://localhost/admin/tvplays/news/ Django Version: 1.4 Exception Type: AttributeError Exception Value: 'bool' object has no attribute 'render' Exception Location:

Re: New to dj: relational limitations

2012-08-14 Thread Melvyn Sopacua
On 15-8-2012 1:49, Russell Keith-Magee wrote: >> SERIAL was not mapped to AutoField (all my primary keys have either >> SERIAL or BIGSERIAL), no AutoField with BigInteger (AFAICS), >> referential constraint action was not mapped to >> ForeignKey.on_delete, ENUM type not supprted (I found a way

Re: New to dj: relational limitations

2012-08-14 Thread Russell Keith-Magee
On Wed, Aug 15, 2012 at 12:48 AM, Axel Rau wrote: > Hi, > > I'm starting to investigate django while designing a web GUI for an already > productive DB. > 3 applications are currently maintaining the DB contents, one of them is a > real-time app (email server), others are

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Melvyn Sopacua
On 15-8-2012 1:02, Furbee wrote: > DJANGO_SETTINGS_MODULE is an environment variable that must be set. I > believe this is taken care of for you when you create a project using > django-admin. You may need to create it manually. No, the trick is to run the manage.py script from the project's

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Furbee
DJANGO_SETTINGS_MODULE is an environment variable that must be set. I believe this is taken care of for you when you create a project using django-admin. You may need to create it manually. Without that environmental variable set, the Django shell won't open. As Jirka said, please review the

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Jirka Vejrazka
> right, I was being very brief in my description! > But it is the following: > I want to insert data into the database from the shell, django shell, but > the result is always that you can not import the settings because the va > riavel DJANGO_SETTINGS_MODULE is not set Did you read my previous

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
right, I was being very brief in my description! But it is the following: I want to insert data into the database from the shell, django shell, but the result is always that you can not import the settings because the va riavel DJANGO_SETTINGS_MODULE is not set 2012/8/14

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread jirka . vejrazka
It's always good to copy the error message you're getting. It seems that you try to run "python manage.py shell" ang getting an error that DJANGO_SETTINGS_MODULE is not set. Please follow at least a bit of the tutorial on docs.djangoproject.com which will teach you how to set this variable

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Kurtis Mullins
Hey Carlos, Unfortunately I'm having a difficult time understanding your English. I do apologize! If I understand correctly, it sounds like you want to insert some data using the shell and you're running into an error. Can you show us the error you are getting? On Tue, Aug 14, 2012 at 2:48 PM,

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
Ok, the quest is relative a how that work with forms of data in settins.py! not relative to date time. in real i'm want insert data in databases athroughl shell and thi error is show! 2012/8/14 Satinderpal Singh > On Tue, Aug 14, 2012 at 9:42 PM, Carlos Andre

Re: Using Forms without Request Data

2012-08-14 Thread Kurtis Mullins
Thanks a lot! I was curious on how to grab the raw POST data but didn't spend any time looking into it. This will definitely come in handy. On Tue, Aug 14, 2012 at 12:35 PM, S.Prymak wrote: > Here is the code snippet about JSON validation I use in my application: > >

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Satinderpal Singh
On Tue, Aug 14, 2012 at 9:42 PM, Carlos Andre wrote: > hi developers i'm with a ptoblem in this date. How work? > thanks! Please clear your question, if you are looking for date and time at your page please follow the following tutorial:

New to dj: relational limitations

2012-08-14 Thread Axel Rau
Hi, I'm starting to investigate django while designing a web GUI for an already productive DB. 3 applications are currently maintaining the DB contents, one of them is a real-time app (email server), others are periodic background tasks. ERM is the central design method

Re: Using Forms without Request Data

2012-08-14 Thread S.Prymak
Here is the code snippet about JSON validation I use in my application: try: json_data = json.loads(request.raw_post_data) except Exception, e: return HttpResponseBadRequest() form = forms.AttributeForm(json_data) if not form.is_valid():

DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Carlos Andre
hi developers i'm with a ptoblem in this date. How work? thanks! -- 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 to

(demo included) Switching Languages still relies on LANGUAGE_CODE for forms

2012-08-14 Thread Houmie
Hello, I have created a small demo to show the problem. Please open the demo here: http://sandbox.chasebot.com/ When you click on British English, you can see how both the date- and Time format change. Now if you click on Add, you will see how both date and time are pre-populated for you.

Re: NoReverseMatch Error

2012-08-14 Thread Serge G. Spaolonzi
Try removing the quotes from 'polls.views.vote': Regards -- Serge G. Spaolonzi Cobalys Systems http://www.cobalys.com On Mon, Aug 13, 2012 at 11:46 PM, Syam Palakurthy wrote: > Hi - I could not find any explanation that fixed the problem, until I ran > across this

Re: Hot to use widgets with generic views

2012-08-14 Thread Tomas Neme
well, for starters, you won't magically get "on keyup" behavior by adding something on your backend, you'll need to use ajax for this, and, depending on your expected number of elements, it might be better to send everything and do any filtering on the client side (if you're handling, say, up to a

Re: multiple profile

2012-08-14 Thread Tomas Neme
Well, it depends on what you want to do exactly, you could create something like this: class UserProfile(models.Model): common_data class ClientProfile(UserProfile): specific_data class StudentProfile(UserProfile): specific_data class TeacherProfile(UserProfile):

Re: join models on Timestamp field without foreign keys

2012-08-14 Thread Melvyn Sopacua
On 14-8-2012 6:58, Jeff Dickens wrote: > class Md_model(models.Model): > Timestamp = > models.DateTimeField(auto_now_add=True,unique=True,db_index=True) > def __unicode__(self): > return self.Timestamp.strftime('%Y %m %d %H:%M') > def as_dict(self): >

Re: Not reading from TEMPLATE_DIRS in settings.py

2012-08-14 Thread Alexis Roda
Al 14/08/12 12:50, En/na madala ha escrit: So I carried on and started tutorial 3 till I got halfway down and had to do same thing but no matter what I try can't get Django to recognize my directories. Can anyone see where I am going wrong please? thanks in anticipation. What error are you

Re: Not reading from TEMPLATE_DIRS in settings.py

2012-08-14 Thread ephan
Have you checked the permissions of the directory and template files? run ls -l in the parent directory of the template folder and inside the folder itself . madala wrote: > Have followed tutorial 2 instructions carefully. So far everything has > worked as described in tutorials but cannot get

Re: Django 1.4 pkbdf2 password hashing issue

2012-08-14 Thread José Moreira
Created a new virtualenv, this time based on Python 2.7[.2] , ran the unit tests and wasn't able to reproduce the issue. Terça-feira, 14 de Agosto de 2012 14:36:11 UTC+1, José Moreira escreveu: > > I can also reproduce it on a new project. > > Terça-feira, 14 de Agosto de 2012 14:22:34 UTC+1,

Re: Django 1.4 pkbdf2 password hashing issue

2012-08-14 Thread José Moreira
I can also reproduce it on a new project. Terça-feira, 14 de Agosto de 2012 14:22:34 UTC+1, José Moreira escreveu: > > Hi, i'm test upgrading a 1.1 project to 1.4 and the password hasher is > raising an exception > while generating passwords (on several Django unit tests): > > >

Django 1.4 pkbdf2 password hashing issue

2012-08-14 Thread José Moreira
Hi, i'm test upgrading a 1.1 project to 1.4 and the password hasher is raising an exception while generating passwords (on several Django unit tests): == ERROR: test_pkbdf2 (django.contrib.auth.tests.hashers.TestUtilsHashPass)

Re: Django: How to get American date format in a form?

2012-08-14 Thread houmie
I found here what I needed: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date There are shortcuts to customize the settings. Thanks for your kind help Melvyn. Regards, Houman On 13/08/12 21:52, Melvyn Sopacua wrote: On 13-8-2012 22:41, Melvyn Sopacua wrote: On 13-8-2012

Incorrect string value when running GeoDjango tutorial

2012-08-14 Thread Matias Burak
Hi, I was trying to go through the GeoDjango tutorial and when I try to import data with LayerMapping I'm getting the following error: Warning: Incorrect string value: '\xC2\x85land...' for column 'name' at row 1 I'm using MySQL and my charset and collation are set to latin1 (I also

Not reading from TEMPLATE_DIRS in settings.py

2012-08-14 Thread madala
Have followed tutorial 2 instructions carefully. So far everything has worked as described in tutorials but cannot get django to load files from my own template directory. Seems a very simple problem. here's the part of my settings.py: TEMPLATE_DIRS = (

Hot to use widgets with generic views

2012-08-14 Thread mjd
This is a general question. Im am using generic views to display all objects in a model. This is working great. However, i want to add text field widget to filter the objects onkeyup. That is, I want the text field to re-render the generic view after applying the text filter in the queryset

join models on Timestamp field without foreign keys

2012-08-14 Thread Jeff Dickens
Hi all. I have a number of models, each of which is based on an abstract class that includes a Timestamp field. The model definitions look like this: class Md_model(models.Model): Timestamp = models.DateTimeField(auto_now_add=True,unique=True,db_index=True) def __unicode__(self):

Re: invoking a funcion or module as root

2012-08-14 Thread Jirka Vejrazka
Hi there, you definitely don't want to allow apache to setuid() to root as you've pointed out. You have a few options, probably the easiest one is to write a pair of scripts for each task you want your application to perform with root privileges. - the first script will only contain "sudo "

invoking a funcion or module as root

2012-08-14 Thread Blaxton
Hi I have setup Django with wsgi and Apache on Linux and all is good, but the application that I am building should be able to modify Linux files which are only allowed by root. so, I have created a function named myfunc in a module named mymodule.py and has invoked the function in my

Re: calling perl script from HTML on submit button

2012-08-14 Thread Joris
On Tuesday, August 14, 2012 7:15:45 AM UTC+2, Pervez Mulla wrote: > > Thank you for your time and concern, > > Actually the entire back-end is in perl so, Am using Django for front-end. > So am asking is there any why to call perl objects in python . > You can always use subprocess() to run perl