2013-08-22 312 views
-1

獲取導入錯誤,而試圖從我urls.py運行本地主機:導入錯誤:無法導入註冊

from django.conf.urls.defaults import * 
from django.conf import settings 
from django.http import HttpResponseRedirect 
from django.contrib import admin 
from mainapp.feeds import LatestReports, CityIdFeed, CitySlugFeed, WardIdFeed, WardSlugFeed,LatestUpdatesByReport 
from mainapp.models import City 
from social_auth.views import auth as social_auth 
from social_auth.views import disconnect as social_disconnect 
#Error at this line 
from registration.views import register 

from mainapp.forms import FMSNewRegistrationForm,FMSAuthenticationForm 
from mainapp.views.account import SUPPORTED_SOCIAL_PROVIDERS 
from django.contrib.auth import views as auth_views 
from mainapp.views.mobile import open311v2 
import mainapp.views.cities as cities 

回溯:

ImportError at/
cannot import name register 
Request Method: GET 
Request URL: http://127.0.0.1:8000/ 
Django Version: 1.3 
Exception Type: ImportError 
Exception Value:  
cannot import name register 
Exception Location: /home/sourabh/Django/fixmystreet/fixmystreet/../fixmystreet/urls.py in <module>, line 9 
Python Executable: /home/sourabh/Django/fixmystreet/bin/python 
Python Version: 2.7.3 
Python Path:  
['/home/sourabh/Django/fixmystreet/fixmystreet', 
'/home/sourabh/Django/fixmystreet/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg', 
'/home/sourabh/Django/fixmystreet/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/site-packages/pip-1.1-py2.7.egg', 
'/home/sourabh/Django/fixmystreet/lib/python2.7', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/plat-linux2', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/lib-tk', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/lib-old', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/lib-dynload', 
'/usr/lib/python2.7', 
'/usr/lib/python2.7/plat-linux2', 
'/usr/lib/python2.7/lib-tk', 
'/home/sourabh/Django/fixmystreet/local/lib/python2.7/site-packages', 
'/home/sourabh/Django/fixmystreet/local/lib/python2.7/site-packages/PIL', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/site-packages', 
'/home/sourabh/Django/fixmystreet/lib/python2.7/site-packages/PIL'] 
Server time: Thu, 22 Aug 2013 09:34:40 -0500 
+2

:)同時投票下來,請考慮提及什麼是不明確的pr會徽? – shifu

+0

您是否在使用['django-registration'](https://bitbucket.org/ubernostrum/django-registration)? –

+0

你試過了什麼?在哪裏註冊?你的python路徑是什麼樣的? – RickyA

回答

1

如果你看的文檔,你看到寄存器的東西,曾經存在並且在上一個版本中被棄用。從documentation

的Django登記的1.0版本代表了以前的代碼庫的完全重寫 ,並引入了一些新功能,其中 [...]

你要麼降級到django註冊v0.8(其中registration.views.register仍然存在)或學習如何實施更改,以適應最新版本

相關問題