Changes between Initial Version and Version 1 of Ticket #9992
- Timestamp:
- Jan 9, 2009, 5:34:59 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #9992 – Description
initial v1 5 5 Dear all, 6 6 7 I have difficulties with the get_profile to link my Profileclass with7 I have difficulties with the `get_profile` to link my `Profile` class with 8 8 the inbuilt User object. 9 9 … … 11 11 shown below, or via the shell) is: 12 12 13 {{{ 13 14 --------------------------------------------------------------------------- 14 15 AttributeError Traceback (most recent call last) … … 24 25 25 26 AttributeError: 'NoneType' object has no attribute '_default_manager' 26 27 28 This indicates that models.get_model() does return None, but I don't know why. 29 30 I have in settings.py: 27 }}} 28 29 This indicates that `models.get_model()` does return `None`, but I don't know why. 30 31 I have in `settings.py`: 32 {{{ 31 33 AUTH_PROFILE_MODULE = 'people.profile' 34 }}} 32 35 which I believe is the right entry. 33 36 … … 44 47 45 48 46 mysite/People/models.pycontains:47 49 `mysite/People/models.py` contains: 50 {{{ 48 51 #----------- 49 52 from django.contrib.auth.models import User … … 57 60 pass 58 61 #----------- 59 60 The corresponding view (which fails) is in mysite/People/views.py: 62 }}} 63 64 The corresponding view (which fails) is in `mysite/People/views.py`: 65 {{{ 61 66 #----------- 62 67 from django.contrib.auth.models import User … … 69 74 #at this point we get an error, equivalent to shell example 70 75 #----------- 71 72 The mysite/settings.pyreads73 76 }}} 77 The `mysite/settings.py` reads 78 {{{ 74 79 #----------- 75 80 # Django settings for mysite project. … … 158 163 ) 159 164 #------------ 160 161 and the url.py is 165 }}} 166 and the `url.py` is 167 {{{ 162 168 #------------ 163 169 from django.conf.urls.defaults import * … … 172 178 ) 173 179 #------------ 174 180 }}} 175 181 176 182 The error can be triggered by viewing … … 179 185 180 186 or by running the shell example shown here: 181 187 188 {{{ 182 189 phi:mysite fangohr$ python manage.py shell 183 190 Enthought Python Distribution -- http://code.enthought.com … … 212 219 213 220 In [4]: 214 221 }}} 215 222 216 223 … … 226 233 227 234 PS Version: 228 235 {{{ 229 236 phi:mysite fangohr$ python manage.py --version 230 237 1.0.2 final 231 238 }}} 232 239 PPS In the database for this example, the admin user is 'admin' and 233 240 the password is 'admin' -- in case anybody wants to play with that. … … 236 243 Solution (Karen Tracey): 237 244 238 (Thanks for the very detailed question.) I think you have found a documentation bug. I do not believe the 'people' part of that should be normalized to lower case. It is not normalized to lower case in INSTALLED_APPS, and I don't think it should be normalized to lower case here. Since you have a capital P in People for your directory name, try 'People.profile'. 239 240 Karen 241 242 Note: Changing people.profile to People.profile solves the problem. 245 > (Thanks for the very detailed question.) I think you have found a 246 > documentation bug. I do not believe the `'people'` part of that 247 > should be normalized to lower case. It is not normalized to lower 248 > case in `INSTALLED_APPS`, and I don't think it should be normalized 249 > to lower case here. Since you have a capital P in People for your 250 > directory name, try `'People.profile'`. 251 > 252 > 253 > Karen 254 255 Note: Changing `people.profile` to `People.profile` solves the problem. 243 256 244 257 … … 248 261 Related documentation: http://docs.djangoproject.com/en/dev/topics/auth/#auth-profiles 249 262 250 Here it says under 1.: "The (normalized to lower-case) name of the application in which the user profile model is defined (in other words, an all-lowercase version of the name which was passed to manage.py startappto create the application)."263 Here it says under 1.: "The (normalized to lower-case) name of the application in which the user profile model is defined (in other words, an all-lowercase version of the name which was passed to `manage.py startapp` to create the application)." 251 264 252 265 This is wrong.