Thank you so much for the reply, Karen. Greatly appreciated.
I am using Django-0.96.2 which is installed in the C drive of my
machine (running Windows XP SP2).
As advised in the documentation, I tried to use 'setup.py install' but
I get the following error:C:\Django-0.96.2>setup.py install
running install
running build
running build_py
error: package directory '\django' does not exist
Can you please advise me how I can get rid of this error.
I am trying out Django but I get this error in my console
C:\DjangoProj\UserApp>python manage.py syncdb
Error: Couldn't install apps, because there were errors in one or more
models:
UserApp.UserProfile: invalid syntax (models.py, line 12)
------------------------------------------------------------------------
---
C:\DjangoProj\UserApp\UserProfile\models.py
------------------------------------------------------------------------
----
1. from django.db import models
2. from django.contrib.auth.models import User
3.
4. GENDER_CHOICES = (
5. ('M', 'Male'),
6. ('F', 'Female'),
7. )
8.
9. # Create your models here.
10. class UserProfile(models.Model):
11. user_id = models.CharField('User ID', max_length=5,
primary_key=True)
12. user_fname = models.CharField('First Name', max_length=30)
user_lname = models.CharField('Last Name', max_length=50)
user_email = models.EmailField('Email Address', blank=True)
user_gndr = models.CharField(max_length=1,
choices=GENDER_CHOICES)
user_headshot = models.ImageField(upload_to='img', blank=True,
null=True)
user_bday = models.DateField('Birthday')
user_uname = models.ForeignKey(User, unique=True)
def __str__(self):
return self.user_id
------------------------------------------------------------------------
---
Thanks Myles
> 12. user_fname = models.CharField('First Name', max_length=30)
> user_lname = models.CharField('Last Name', max_length=50)
> user_email = models.EmailField('Email Address', blank=True)
> user_gndr = models.CharField(max_length=1,
> choices=GENDER_CHOICES)
> user_headshot = models.ImageField(upload_to='img', blank=True,
>
> null=True)
> user_bday = models.DateField('Birthday')
> user_uname = models.ForeignKey(User, unique=True)
looks like an indentation error
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/
The indentions of my code in my editor are ok
I hope the code will not be distorted here again
I am trying out Django but I get this error in my console
C:\DjangoProj\UserApp>python manage.py syncdb
Error: Couldn't install apps, because there were errors in one or more
models:
UserApp.UserProfile: invalid syntax (models.py, line 12)
------------------------------------------------------------------------
C:\DjangoProj\UserApp\UserProfile\models.py
------------------------------------------------------------------------
1. from django.db import models
2. from django.contrib.auth.models import User 3.
4. GENDER_CHOICES = (
5. ('M', 'Male'),
6. ('F', 'Female'),
7. )
8.
9. # Create your models here.
10. class UserProfile(models.Model):
11. user_id = models.CharField('User ID',
max_length=5,primary_key=True)
12. user_fname = models.CharField('First Name', max_length=30)
user_lname = models.CharField('Last Name', max_length=50)
user_email = models.EmailField('Email Address', blank=True)
user_gndr = models.CharField(max_length=1,choices=GENDER_CHOICES)
user_headshot = models.ImageField(upload_to='img',
blank=True,null=True)
user_bday = models.DateField('Birthday')
user_uname = models.ForeignKey(User, unique=True)
def __str__(self):
return self.user_id
------------------------------------------------------------------------
Thanks Myles
The indentions of my code in my editor are ok
I hope the code will not be distorted here again
I am trying out Django but I get this error in my console
C:\DjangoProj\UserApp>python manage.py syncdb
Error: Couldn't install apps, because there were errors in one or more
models:
UserApp.UserProfile: invalid syntax (models.py, line 12)
------------------------------------------------------------------------
C:\DjangoProj\UserApp\UserProfile\models.py
Here is the link of my code
------------------------------------------------------------------------
Thanks Myles