DjangoAppEngine TestApp - python

Need some help starting up the djangoappengine testapp.I followed the instructions at http://www.allbuttonspressed.com/projects/djangoappengine, but when I run ./manage.py runserver . while in the project directory I get the following error:
WARNING 2011-03-24 12:23:21,994 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Error: option --rdbms_sqlite_path not recognized
Runs a development application server for an application.
manage.py [options] <application root>__
When I try and comment the ' 'rdbms_sqlite_path': os.path.join(DATA_ROOT, 'rdbms'),' line in app/djangoappengine/db/base.py I get the following error:
WARNING 2011-03-24 12:26:07,239 datastore_file_stub.py:657] Could not read datastore
data from /media/disk/Projex/AppEngineApp/app/.gaedata/datastore
Traceback (most recent call last):
File "./manage.py", line 11, in <module>
execute_manager(settings)
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 438,
in execute_manager
utility.execute()
File "/media/disk/Projex/AppEngineApp/app/django/core/management/__init__.py", line 379,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 94, in run_from_argv
start_dev_appserver(argv)
File
"/media/disk/Projex/AppEngineApp/app/djangoappengine/management/commands/runserver.py",
line 81, in start_dev_appserver
dev_appserver_main.main([progname] + args + [PROJECT_DIR])
File "/usr/local/gaepy/google/appengine/tools/dev_appserver_main.py", line 426, in main
static_caching=static_caching)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3820, in
CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "/usr/local/gaepy/google/appengine/tools/dev_appserver.py", line 3840, in __init__
request_handler_class)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
self.server_bind()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: [Errno -5] No address associated with hostname
Anyone experienced this issue ?

You probably already solved this, but for future users:
The warning can have multiple causes:
data store is empty, in that case ignore
wrong permissions on the datastore files
data corruption issue
The error can be solved by updating djangoappengine

Update to the latest version of google app engine.

Related

OS Error on running django-celery as daemon

I need to run celery as a daemon. I am not using supervisor for this. Instead, I want to run celery with init on system start.
Here is the traceback of the error I am getting on starting the celery with sudo /etc/init.d/celeryd start
/usr/local/lib/python2.7/dist-packages/django/core/management/base.py:260: RemovedInDjango19Warning: "requires_model_validation" is deprecated in favor of "requires_system_checks".
RemovedInDjango19Warning)
Traceback (most recent call last):
File "/var/www/html/halwee/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/djcelery/management/commands/celery.py", line 23, in run_from_argv
['{0[0]} {0[1]}'.format(argv)] + argv[2:],
File "/usr/local/lib/python2.7/dist-packages/celery/bin/celery.py", line 770, in execute_from_commandline
super(CeleryCommand, self).execute_from_commandline(argv)))
File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 309, in execute_from_commandline
argv = self.setup_app_from_commandline(argv)
File "/usr/local/lib/python2.7/dist-packages/celery/bin/base.py", line 450, in setup_app_from_commandline
os.chdir(workdir)
OSError: [Errno 2] No such file or directory: '"/var/www/html/hello"'
/var/www/html/hello
is the path of my root django application
I am following the tutorial from here.
I browsed through few answers on stackoverflow, etc and discovered that it might be a permission issue. But then I created a new group and a user and assigned this group to entire django root application. Issue still persist.
I have been stuck on this for like forever. Can anyone tell me how to fix this?

Django error: too many open files

I'm using Anaconda python and I'm trying to run a simple Django server using the official documentation. When I run python manage.py runserver I get this error
Nuseirs-MacBook-Pro:anothertry nyassin$ python manage.py runserver
Validating models...
0 errors found
November 06, 2013 - 18:27:10
Django version 1.7.dev20131105182658, using settings 'anothertry.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 416, in execute_from_command_line
utility.execute()
File "/Users/nyassin/django-trunk/django/core/management/__init__.py", line 408, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 244, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/nyassin/django-trunk/django/core/management/base.py", line 291, in execute
output = self.handle(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 76, in handle
self.run(*args, **options)
File "/Users/nyassin/django-trunk/django/core/management/commands/runserver.py", line 85, in run
autoreload.main(self.inner_run, args, options)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 359, in main
reloader(wrapped_main_func, args, kwargs)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 325, in python_reloader
reloader_thread()
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 304, in reloader_thread
if fn():
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in kqueue_code_changed
new_descriptors = set(open(filename) for filename in new_filenames)
File "/Users/nyassin/django-trunk/django/utils/autoreload.py", line 217, in <genexpr>
new_descriptors = set(open(filename) for filename in new_filenames)
IOError: [Errno 24] Too many open files: '//anaconda/lib/python2.7/lib-dynload/resource.so'
Any ideas what might be causing this?
It's an operating system error. The maximum number of open files is limited. Try to find where you open files and forget to close them.
Open less file descriptors at once.
set(open(filename) for filename in new_filenames)
is where the error occurs.

How to fix socket.gaierror: (11004, 'getaddrinfo failed') error in GAE?

I'm using Aptana and GAE. When I run GAE launcher or run a server in Aptana 3, I get this error... I've downloaded the lastest version of GAE and still doesnt work...
Traceback (most recent call last):
File "C:\google_appengine\dev_appserver.py", line 76, in <module>
run_file(__file__, globals())
File "C:\google_appengine\dev_appserver.py", line 72, in run_file
execfile(script_path, globals_)
File "C:\google_appengine\google\appengine\tools\dev_appserver_main.py", line 665, in <module>
sys.exit(main(sys.argv))
File "C:\google_appengine\google\appengine\tools\dev_appserver_main.py", line 629, in main
static_caching=static_caching)
File "C:\google_appengine\google\appengine\tools\dev_appserver.py", line 4818, in CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "C:\google_appengine\google\appengine\tools\dev_appserver.py", line 4844, in __init__
request_handler_class)
File "C:\Python25\lib\SocketServer.py", line 330, in __init__
self.server_bind()
File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind
SocketServer.TCPServer.server_bind(self)
File "C:\Python25\lib\SocketServer.py", line 341, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: (11004, 'getaddrinfo failed')
Exception exceptions.AttributeError: '_shutdown' in <module 'threading' from 'C:\Python25\lib\threading.pyc'> ignored
2011-05-30 21:57:24 (Process exited with code 1)
FIXED! after days looking for this problem: I just deleted this line "0.0.0.0 localhost " from my hosts file located in "C:\Windows\System32\drivers\etc" thanks anyway!!
Had same problem here, I had to add
127.0.0.1 myhostname
and
::1 myhostname
to /etc/hosts

GAE " no attribute 'HTTPSHandler' " dev_appserver.py

I am trying to use the google appengine python SKD from my ubuntu lucid. I have already compiled python2.5. But when I execute any "dev_appserver.py" command with it I get the following error:
Traceback (most recent call last):
File "dev_appserver.py", line 69, in <module>
run_file(__file__, globals())
File "dev_appserver.py", line 65, in run_file
execfile(script_path, globals_)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 90, in <module>
from google.appengine.tools import appcfg
File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appcfg.py", line 59, in <module>
from google.appengine.tools import appengine_rpc
File "/media/Ultimate/WebD/django/app_engine/google_appengine/google/appengine/tools/appengine_rpc.py", line 24, in <module>
import fancy_urllib
File "/media/Ultimate/WebD/django/app_engine/google_appengine/lib/fancy_urllib/fancy_urllib/__init__.py", line 328, in <module>
class FancyHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'
I have checked the urllib2 moduls of python2.6 and python2.5 but there was no difference in the models defination and HTTPSHandelr is there in python2.5 too. So I guess it is some other sort of error.
I tried to run with the default python2.6 too but then I get the following error:
WARNING 2010-09-11 12:08:40,848 datastore_file_stub.py:657] Could not read datastore data from /tmp/dev_appserver.datastore
Traceback (most recent call last):
File "./dev_appserver.py", line 69, in <module>
run_file(__file__, globals())
File "./dev_appserver.py", line 65, in run_file
execfile(script_path, globals_)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 449, in <module>
sys.exit(main(sys.argv))
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver_main.py", line 426, in main
static_caching=static_caching)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3820, in CreateServer
server = HTTPServerWithScheduler((serve_address, port), handler_class)
File "/home/rohan/workspace/app_en/google_appengine/google/appengine/tools/dev_appserver.py", line 3840, in __init__
request_handler_class)
File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
self.server_bind()
File "/usr/lib/python2.6/BaseHTTPServer.py", line 108, in server_bind
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.error: [Errno 98] Address already in use
It works well in windows and even under wine.
Update
Problem with python2.6 solved.
I had configured my apache server for a django deployment on the 8080 and 80 port some time earlier.
But there is still same error with python2.5 isntallation.
Solved the issue...just needed to build all dependencies of python using:
apt-get build-dep python
python compiles with no error even when all the dependencies are not installed. It just skips the modules which require them and builds python.
Solution for missing HTTPSHandler:
Before you build python 2.5 from source you need to enable ssl-socket by editing Modules/Setup.dist (more info here http://paltman.com/2007/nov/15/getting-ssl-support-in-python-251/)
The method described in this post worked perfectly for me (Ubuntu 11.10).
http://dewbot.posterous.com/installation-of-python-25-and-google-app-engi

Django failing to find apps

I have been working on a django app on my local computer for some time now and i am trying to move it to a mediatemple container and im having a problem when i try to start up django. it gives me this traceback:
application failed to start, starting manage.py fastcgi failed:Traceback
(most recent call last): File "manage.py", line 11, in ?
execute_manager(settings) File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 340,
in execute_manager utility.execute() File
"/home/58626/data/python/lib/django/core/management/__init__.py", line 295,
in execute self.fetch_command(subcommand).run_from_argv(self.argv) File
"/home/58626/data/python/lib/django/core/management/base.py", line 192, in
run_from_argv self.execute(*args, **options.__dict__) File
"/home/58626/data/python/lib/django/core/management/base.py", line 210, in
execute translation.activate('en-us') File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
73, in activate return real_activate(language) File
"/home/58626/data/python/lib/django/utils/translation/__init__.py", line
43, in delayed_loader return g['real_%s' % caller](*args, **kwargs) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
209, in activate _active[currentThread()] = translation(language) File
"/home/58626/data/python/lib/django/utils/translation/trans_real.py", line
198, in translation default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/58626/data/python/lib/django/utils/translation/trans_real.py",
line 181, in _fetch app = getattr(__import__(appname[:p], {}, {},
[appname[p+1:]]), appname[p+1:]) AttributeError: 'module' object has no
attribute 'web'
The name of the first app is "web".
Steps I would take would be
Run the dev server on your Media Template instance. If that runs successfully, it obviously is an error with your apache/nginx/whaever setup.
I dont have experience running apps as FCGI, which it looks to em you are trying to do. It looks to me that somehow when Fcgi runs, it is unable to find your apps. So this is possibly a PYTHONPATH issue. Log/Print sys.path from your fcgi script and look there.

Categories

Resources