Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleting auth from django trunk raises error #28

Closed
GoogleCodeExporter opened this issue May 6, 2015 · 8 comments
Closed

deleting auth from django trunk raises error #28

GoogleCodeExporter opened this issue May 6, 2015 · 8 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. located django trunk and removed auth, admin and databrowse dirs as 
mentioned in the docs.
2. changed the main.py according to docs.
3. tried to runserver

What is the expected output? What do you see instead?
[~/pys/fones]>python2.5 manage.py runserver
WARNING:root:Could not read datastore data from /home/sleytr/pys/fones/
django_google-app-engine-django.datastore
WARNING:root:Could not read datastore data from /home/sleytr/pys/fones/
django_google-app-engine-django.datastore.history
WARNING:root:Could not initialize images API; you are likely missing the 
Python "PIL" module. ImportError: No module named PIL
WARNING:root:Middleware module 
'django.contrib.sessions.middleware.SessionMiddleware' is not compatible. 
Removed!
WARNING:root:Application module 'django.contrib.sessions' is not 
compatible. Removed!
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    InstallAppengineHelperForDjango()
  File "/home/sleytr/pys/fones/appengine_django/__init__.py", line 373, in 
InstallAppengineHelperForDjango
    InstallAuthentication()
  File "/home/sleytr/pys/fones/appengine_django/__init__.py", line 394, in 
InstallAuthentication
    from django.contrib.auth import models
ImportError: No module named auth
[sleytr@slpardus][02:06:20]
[~/pys/fones]>python2.5 manage.py diffsettings
WARNING:root:Could not read datastore data from /home/sleytr/pys/fones/
django_google-app-engine-django.datastore
WARNING:root:Could not read datastore data from /home/sleytr/pys/fones/
django_google-app-engine-django.datastore.history
WARNING:root:Could not initialize images API; you are likely missing the 
Python "PIL" module. ImportError: No module named PIL
WARNING:root:Middleware module 
'django.contrib.sessions.middleware.SessionMiddleware' is not compatible. 
Removed!
WARNING:root:Application module 'django.contrib.sessions' is not 
compatible. Removed!
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    InstallAppengineHelperForDjango()
  File "/home/sleytr/pys/fones/appengine_django/__init__.py", line 373, in 
InstallAppengineHelperForDjango
    InstallAuthentication()
  File "/home/sleytr/pys/fones/appengine_django/__init__.py", line 394, in 
InstallAuthentication
    from django.contrib.auth import models
ImportError: No module named auth

What version of the product are you using? On what operating system?
r30, Linux 


Original issue reported on code.google.com by sle...@gmail.com on 30 May 2008 at 11:24

@GoogleCodeExporter
Copy link
Author

Never mind, my bad. I messed the docs. 

Original comment by sle...@gmail.com on 31 May 2008 at 12:35

@GoogleCodeExporter
Copy link
Author

sleytr, I'm not sure what you mean by your comment.. 

I just ran into this issue as well. The tutorial at
http://code.google.com/appengine/articles/appengine_helper_for_django.html says 
"To
reduce the number of files, you can safely remove: ... django/contrib/auth ..." 
yet
appengine_django/__init__.py tries to "from django.contrib.auth import models" 
(line
394), which doesn't work if django/contrib/auth has been removed. 

Original comment by stevehu...@gmail.com on 8 Jun 2008 at 2:25

@GoogleCodeExporter
Copy link
Author

stevehulet, do not consider the original documentation when you use the django 
helper package. It should work if you use the settings.py file which comes with 
the 
package. 

Original comment by sle...@gmail.com on 8 Jun 2008 at 8:42

@GoogleCodeExporter
Copy link
Author

This is a bug in the article.

It was correct for the initial version of the helper which did not contain code 
to
support Django's authentication functions. 

The article was  not correctly updated to match the latest release of the Django
helper which adds initial support for some of Django's authentication 
functionality.

I will prepare an update for the article that does not tell you to remove the 
auth/
directory.

Original comment by mattbrow...@gmail.com on 9 Jun 2008 at 10:41

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

i do think however that should you not want to use the auth module an error 
should
not be thrown :/ perhaps try to import and catch the exception

Original comment by andyster on 11 Jun 2008 at 3:16

@GoogleCodeExporter
Copy link
Author

r33 implements the try/except around the auth monkey patching.

An update to the article that does not mention removing contrib/auth should 
also go
live on the site in the next few hours.

Original comment by mattbrow...@gmail.com on 26 Jun 2008 at 9:11

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

With most recent downloads, currently getting this:

(555)$ python manage.py shell
WARNING:root:Could not read datastore data from
/var/folders/Ge/GeQ1BAWEHam3Czy2a6snzE+++TI/-Tmp-/django_google-app-engine-djang
o.datastore
WARNING:root:Could not read datastore data from
/var/folders/Ge/GeQ1BAWEHam3Czy2a6snzE+++TI/-Tmp-/django_google-app-engine-djang
o.datastore.history
Traceback (most recent call last):
  File "manage.py", line 18, in <module>
    InstallAppengineHelperForDjango()
  File "/Users/earino/work/mysite/appengine_django/__init__.py", line 373, in
InstallAppengineHelperForDjango
    InstallAuthentication()
  File "/Users/earino/work/mysite/appengine_django/__init__.py", line 394, in
InstallAuthentication
    from django.contrib.auth import models
  File "/usr/local/google_appengine/lib/django/django/contrib/auth/models.py", line
4, in <module>
    from django.contrib.contenttypes.models import ContentType
  File
"/usr/local/google_appengine/lib/django/django/contrib/contenttypes/models.py", 
line
33, in <module>
    class ContentType(models.Model):
  File "/usr/local/google_appengine/lib/django/django/db/models/base.py", line 30, in
__new__
    new_class.add_to_class('_meta', Options(attrs.pop('Meta', None)))
  File "/usr/local/google_appengine/lib/django/django/db/models/base.py", line 169,
in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/local/google_appengine/lib/django/django/db/models/options.py", line 53,
in contribute_to_class
    setattr(self, 'verbose_name_plural', meta_attrs.pop('verbose_name_plural',
self.verbose_name + 's'))
  File "/usr/local/google_appengine/lib/django/django/utils/functional.py", line 42,
in __wrapper__
    res = self.__func(*self.__args, **self.__kw)
  File
"/usr/local/google_appengine/lib/django/django/utils/translation/trans_real.py",
 line
268, in gettext
    _default = translation(settings.LANGUAGE_CODE)
  File
"/usr/local/google_appengine/lib/django/django/utils/translation/trans_real.py",
 line
197, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File
"/usr/local/google_appengine/lib/django/django/utils/translation/trans_real.py",
 line
180, in _fetch
    app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]), appname[p+1:])
ImportError: No module named mysite

Original comment by ear...@gmail.com on 27 Jun 2008 at 7:52

@GoogleCodeExporter
Copy link
Author

I had this problem too.  It seems that you have to leave out the project name.

i.e. instead of mysite.myapp.views.getdata you just use myapp.views.getdata

As far as I can tell this goes for all references throughout the project:
settings.py, urls.py, etc.

Original comment by altau...@gmail.com on 5 Aug 2008 at 8:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant