Closed GoogleCodeExporter closed 9 years ago
froland,
i dont think its really expected to add a super user when syncing db. Instead,
just
answer 'no' and then create a user on your site.
Original comment by rajeev.s...@gmail.com
on 24 Jul 2008 at 2:42
i guess we can add a syncdb signal listener to create the profile even when
super
user is created via syncdb
Original comment by jtau...@gmail.com
on 25 Jul 2008 at 8:19
So how do we fix this if we already ran the syncdb, as is expected in initially
setting up a django project?
Also, how does a superuser get created if it's not done at syncdb? Should we be
modifying settings.py? Is the first user created automatically made superuser?
Original comment by bobwayc...@gmail.com
on 1 Aug 2008 at 5:41
I'm not sure if I should separate these into separate issues, but the /tweets
page
and /account/other_services page exhibit identical behavior to what is
described here
for the /profile/username page.
I have removed the dev.db file and reran syncdb, answering 'no' when asked to
create
the superuser. Indeed, the errors on profile, tweets, and
account/other_services no
longer exhibit this behavior -- but now my user is not able to login at /admin.
I can provide more thorough error reports, but didn't want to create a duplicate
issue since all three failures are linked to the same step -- answering 'yes' to
create a superuser during initial syncdb.
Is pinax designed to expect that we define our admin user explicitly in
settings.py?
I am running pinax with default django test server atop a repaired Python2.5 in
Mac
OS 10.5.4
Original comment by bobwayc...@gmail.com
on 1 Aug 2008 at 1:27
The fix if you're already done a syncdb is to run ./manage.py shell_plus, grab
the
user, (e.g. user = User.objects.get(pk=1)) then create the project with
Profile(user=user).save()
Original comment by jtau...@gmail.com
on 1 Aug 2008 at 5:10
Maybe Pinax could add a command that creates profiles for users who do not have
them:
from django.core.management.base import NoArgsCommand
from django.contrib.auth.models import User
from django.contrib.profile.models import Profile
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list
help = 'Used to create profiles for user who do not have one'
def handle_noargs(self, **options):
for user in User.objects.all():
try:
user.get_profile()
except:
Profile(user=user).save()
print "Creating profile for user.username"
Original comment by ingenier...@gmail.com
on 2 Aug 2008 at 9:38
The fix didn't solve the problem for me; I created a separate issue for what's
happening now.
If I re-syncdb, how do I make my user a superuser and access the admin area?
Original comment by bobwayc...@gmail.com
on 4 Aug 2008 at 3:34
Attaching create_missing_profiles command.
Original comment by ingenier...@gmail.com
on 13 Aug 2008 at 11:57
Attachments:
fixed in r762 and r763.
r762 creates the post_save signal which ensures there is always a profile for a
user.
r763 adds the management command.
Original comment by doug.nap...@gmail.com
on 17 Aug 2008 at 1:44
Original issue reported on code.google.com by
frol...@gmail.com
on 22 Jul 2008 at 8:40