Sto usando l'app di registrazione django. Sto cercando di creare un sito web di social networking. Sono un principiante nello sviluppo di siti web. Qui è l'errore che sto ottenendo:Non riesco a creare il profilo utente usando la registrazione django
Ambiente:
metodo di richiesta POST Richiesta URL: 127.0.0.1:8000/accounts/register/
Django Versione: 1.4.2 Python Versione: 2.7.2
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'registration_defaults',
'django.contrib.admin',
'registration',
'polls')
Installed Middleware:
('django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/registration/views.py" in register
187. new_user = backend.register(request, **form.cleaned_data)
File "/Library/Python/2.7/site-packages/registration/backends/default/__init__.py" in register
79. password, site)
File "/Library/Python/2.7/site-packages/django/db/transaction.py" in inner
209. return func(*args, **kwargs)
File "/Library/Python/2.7/site-packages/registration/models.py" in create_inactive_user
78. new_user = User.objects.create_user(username, email, password)
File "/Library/Python/2.7/site-packages/django/contrib/auth/models.py" in create_user
160. user.save(using=self._db)
File "/Library/Python/2.7/site-packages/django/db/models/base.py" in save
463. self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/Library/Python/2.7/site-packages/django/db/models/base.py" in save_base
565. created=(not record_exists), raw=raw, using=using)
File "/Library/Python/2.7/site-packages/django/dispatch/dispatcher.py" in send
172. response = receiver(signal=self, sender=sender, **named)
File "/Users/dineshsingh/Desktop/django/mysite/users/models.py" in create_user_profile
20. UserProfile.objects.create(user=instance)
File "/Library/Python/2.7/site-packages/django/db/models/manager.py" in create
137. return self.get_query_set().create(**kwargs)
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in create
377. obj.save(force_insert=True, using=self.db)
File "/Library/Python/2.7/site-packages/django/db/models/base.py" in save
463. self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/Library/Python/2.7/site-packages/django/db/models/base.py" in save_base
551. result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
File "/Library/Python/2.7/site-packages/django/db/models/manager.py" in _insert
203. return insert_query(self.model, objs, fields, **kwargs)
File "/Library/Python/2.7/site-packages/django/db/models/query.py" in insert_query
1593. return query.get_compiler(using=using).execute_sql(return_id)
File "/Library/Python/2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql
910. cursor.execute(sql, params)
File "/Library/Python/2.7/site-packages/django/db/backends/util.py" in execute
40. return self.cursor.execute(sql, params)
File "/Library/Python/2.7/site-packages/django/db/backends/sqlite3/base.py" in execute
344. return Database.Cursor.execute(self, query, params)
Exception Type: DatabaseError at /accounts/register/
Exception Value: no such table: users_userprofile
Qualsiasi aiuto sarà molto apprezzato.
Ok fare una cosa, verificare manualmente se si dispone di tutta la tabella creata a colpire 'syncdb' o meno. –
Ho controllato e la tabella users_userprofile non è stata creata. L'elenco delle tabelle create è: auth_group, auth_group_permissions, auth_permission, AUTH_USER, auth_user_groups, auth_user_user_permissions, django_admin_log, django_content_type, django_session, django_site, polls_choice, polls_poll, registration_registrationprofile, –
No no, non ci non sarà una tabella chiamata 'users_userprofile'. 'registration_registrationprofile' è la tabella principale qui. –