Re: Installing django
#manage.py syncdb is not worked... error messge is : manage.py: command not found On Apr 15, 10:43 am, Eximius wrote: > Try syncdb using manage.py command i.e. > # manage.py syncdb > > On Thu, Apr 15, 2010 at 12:47 AM, Alexis Selves > wrote:> try to insall package python-django using > apt-get install > > > On 14 dub, 20:47, "Tom X. Tobin" wrote: > > > On Wed, Apr 14, 2010 at 1:17 PM, Shawn Milochik > > wrote: > > > > The instructions on the site are incorrect. You only use > > django-admin.py to create the project. After that you use manage.py for > > everything else -- including syncdb. > > > > You *can* use django-admin.py as long as you make sure > > > DJANGO_SETTINGS_MODULE is defined in your environment to poing to your > > > settings module (e.g., "some_project.settings") -- which is exactly > > > what Jagdeep's traceback was complaining about. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Installing django
#apt-get install python-django After this what can i do.. On Apr 15, 12:17 am, Alexis Selves wrote: > try to insall package python-django using apt-get install > > On 14 dub, 20:47, "Tom X. Tobin" wrote:> On Wed, > Apr 14, 2010 at 1:17 PM, Shawn Milochik wrote: > > > The instructions on the site are incorrect. You only use django-admin.py > > > to create the project. After that you use manage.py for everything else > > > -- including syncdb. > > > You *can* use django-admin.py as long as you make sure > > DJANGO_SETTINGS_MODULE is defined in your environment to poing to your > > settings module (e.g., "some_project.settings") -- which is exactly > > what Jagdeep's traceback was complaining about. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
how to install django in ubuntu .........
how to install django in ubuntu ? Please Replywith full instruction -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Installing django
i am able to install django Its Works Thanks Very much ( Django users) On Apr 15, 10:43 am, Eximius wrote: > Try syncdb using manage.py command i.e. > # manage.py syncdb > > On Thu, Apr 15, 2010 at 12:47 AM, Alexis Selves > wrote:> try to insall package python-django using > apt-get install > > > On 14 dub, 20:47, "Tom X. Tobin" wrote: > > > On Wed, Apr 14, 2010 at 1:17 PM, Shawn Milochik > > wrote: > > > > The instructions on the site are incorrect. You only use > > django-admin.py to create the project. After that you use manage.py for > > everything else -- including syncdb. > > > > You *can* use django-admin.py as long as you make sure > > > DJANGO_SETTINGS_MODULE is defined in your environment to poing to your > > > settings module (e.g., "some_project.settings") -- which is exactly > > > what Jagdeep's traceback was complaining about. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
How to use Django with Apache and mod_wsgi
please Discuss in detail ... I am not able to understand ,how i can use Django with mod_wsgi I am using ubuntu 10.04 (LTS) please help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django with Apache and mod_python
MOD_PYTHON ERROR ProcessId: 3793 Interpreter:'127.0.1.1' ServerName: '127.0.1.1' DocumentRoot: '/var/www' URI:'/' Location: '/' Directory: None Filename: '/var/www/' PathInfo: '' Phase: 'PythonHandler' Handler:'django.core.handlers.modpython' Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 228, in handler return ModPythonHandler()(req) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 191, in __call__ self.load_middleware() File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py", line 33, in load_middleware for middleware_path in settings.MIDDLEWARE_CLASSES: File "/usr/local/lib/python2.6/dist-packages/django/utils/ functional.py", line 276, in __getattr__ self._setup() File "/usr/local/lib/python2.6/dist-packages/django/conf/ __init__.py", line 40, in _setup self._wrapped = Settings(settings_module) File "/usr/local/lib/python2.6/dist-packages/django/conf/ __init__.py", line 75, in __init__ raise ImportError("Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)) ImportError: Could not import settings 'mysite.settings' (Is it on sys.path? Does it have syntax errors?): No module named mysite.settings i am using these scose in file httpd.conf SetHandler python-program PythonPath "['/home/username/mysite'] + sys.path" PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonOption django.root mysite PythonDebug On please help... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django with Apache and mod_python
Thanks very much But Now the new are is come MOD_PYTHON ERROR ProcessId: 3219 Interpreter:'127.0.1.1' ServerName: '127.0.1.1' DocumentRoot: '/var/www' URI:'/' Location: '/' Directory: None Filename: '/var/www/' PathInfo: '' Phase: 'PythonHandler' Handler:'django.core.handlers.modpython' Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 228, in handler return ModPythonHandler()(req) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 201, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py", line 130, in get_response return self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py", line 181, in handle_uncaught_exception return callback(request, **param_dict) File "/usr/local/lib/python2.6/dist-packages/django/views/ defaults.py", line 23, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "/usr/local/lib/python2.6/dist-packages/django/template/ loader.py", line 157, in get_template template, origin = find_template(template_name) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader.py", line 138, in find_template raise TemplateDoesNotExist(name) TemplateDoesNotExist: 500.html On Jun 5, 4:06 pm, Kenneth Gonsalves wrote: > On Saturday 05 June 2010 16:30:46 Jagdeep Singh Malhi wrote: > > > PythonPath "['/home/username/mysite'] + sys.path" > > PythonPath "['/home/username/'] + sys.path" > -- > Regards > Kenneth Gonsalves > Senior Associate > NRC-FOSS at AU-KBC -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
error : Django with Apache and mod_python
MOD_PYTHON ERROR ProcessId: 3219 Interpreter:'127.0.1.1' ServerName: '127.0.1.1' DocumentRoot: '/var/www' URI:'/' Location: '/' Directory: None Filename: '/var/www/' PathInfo: '' Phase: 'PythonHandler' Handler:'django.core.handlers.modpython' Traceback (most recent call last): File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1229, in _process_target result = _execute_target(config, req, object, arg) File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line 1128, in _execute_target result = object(arg) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 228, in handler return ModPythonHandler()(req) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ modpython.py", line 201, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py", line 130, in get_response return self.handle_uncaught_exception(request, resolver, sys.exc_info()) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py", line 181, in handle_uncaught_exception return callback(request, **param_dict) File "/usr/local/lib/python2.6/dist-packages/django/views/ defaults.py", line 23, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "/usr/local/lib/python2.6/dist-packages/django/template/ loader.py", line 157, in get_template template, origin = find_template(template_name) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader.py", line 138, in find_template raise TemplateDoesNotExist(name) TemplateDoesNotExist: 500.html please help what I can do ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django with Apache and mod_python
Sir , i am not able to remove this error.. which of template or file name is wrong.. On Jun 5, 5:09 pm, Kenneth Gonsalves wrote: > On Saturday 05 June 2010 17:25:16 Jagdeep Singh Malhi wrote: > > > File "/usr/local/lib/python2.6/dist-packages/django/template/ > > loader.py", line 138, in find_template > > raise TemplateDoesNotExist(name) > > > TemplateDoesNotExist: 500.html > > you are calling a template with either the wrong path or wrong filename > -- > Regards > Kenneth Gonsalves > Senior Associate > NRC-FOSS at AU-KBC -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: error : Django with Apache and mod_python
i am not able to configure "Apache and mod_wsgi". http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi I am unable to understand this .. please help .. if possible... i also want to use this.. On Jun 5, 10:09 pm, Vasil Vangelovski wrote: > It seems that your application is trying to render a template that > doesn't exist. > > And why are you using mod_python anyway? > > On Sat, Jun 5, 2010 at 5:49 PM, Jagdeep Singh Malhi > > wrote: > > > MOD_PYTHON ERROR > > > ProcessId: 3219 > > Interpreter: '127.0.1.1' > > > ServerName: '127.0.1.1' > > DocumentRoot: '/var/www' > > > URI: '/' > > Location: '/' > > Directory: None > > Filename: '/var/www/' > > PathInfo: '' > > > Phase: 'PythonHandler' > > Handler: 'django.core.handlers.modpython' > > > Traceback (most recent call last): > > > File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line > > 1537, in HandlerDispatch > > default=default_handler, arg=req, silent=hlist.silent) > > > File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line > > 1229, in _process_target > > result = _execute_target(config, req, object, arg) > > > File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line > > 1128, in _execute_target > > result = object(arg) > > > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ > > modpython.py", line 228, in handler > > return ModPythonHandler()(req) > > > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ > > modpython.py", line 201, in __call__ > > response = self.get_response(request) > > > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ > > base.py", line 130, in get_response > > return self.handle_uncaught_exception(request, resolver, > > sys.exc_info()) > > > File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ > > base.py", line 181, in handle_uncaught_exception > > return callback(request, **param_dict) > > > File "/usr/local/lib/python2.6/dist-packages/django/views/ > > defaults.py", line 23, in server_error > > t = loader.get_template(template_name) # You need to create a > > 500.html template. > > > File "/usr/local/lib/python2.6/dist-packages/django/template/ > > loader.py", line 157, in get_template > > template, origin = find_template(template_name) > > > File "/usr/local/lib/python2.6/dist-packages/django/template/ > > loader.py", line 138, in find_template > > raise TemplateDoesNotExist(name) > > > TemplateDoesNotExist: 500.html > > > please help what I can do ??? > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django with Apache and mod_python
ok sir , thanks very much indeed i try my best.. On Jun 6, 8:52 am, Kenneth Gonsalves wrote: > On Sunday 06 June 2010 09:12:30 Jagdeep Singh Malhi wrote: > > > Sir , i am not able to remove this error.. > > which of template or file name is wrong.. > > how would I know? I know nothing about your directory structure, your models > and views. > -- > Regards > Kenneth Gonsalves > Senior Associate > NRC-FOSS at AU-KBC -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django is not work Error :Message
This the Error message : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmas...@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Please help -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
error : python manage.py shell
i am using Django Version: 1.2.1 I follow this Tutorial http://docs.djangoproject.com/en/1.2/intro/tutorial01/ and Edit the polls/models.py file so it looks like this: class Poll(models.Model): # ... def __unicode__(self): return self.question class Choice(models.Model): # ... def __unicode__(self): return self.choice After doing that i run this command : python manage.py shell this error is come Validating models... Unhandled exception in thread started by Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/core/management/ commands/runserver.py", line 48, in inner_run self.validate(display_num_errors=True) File "/usr/local/lib/python2.6/dist-packages/django/core/management/ base.py", line 245, in validate num_errors = get_validation_errors(s, app) File "/usr/local/lib/python2.6/dist-packages/django/core/management/ validation.py", line 28, in get_validation_errors for (app_name, error) in get_app_errors().items(): File "/usr/local/lib/python2.6/dist-packages/django/db/models/ loading.py", line 146, in get_app_errors self._populate() File "/usr/local/lib/python2.6/dist-packages/django/db/models/ loading.py", line 61, in _populate self.load_app(app_name, True) File "/usr/local/lib/python2.6/dist-packages/django/db/models/ loading.py", line 78, in load_app models = import_module('.models', app_name) File "/usr/local/lib/python2.6/dist-packages/django/utils/ importlib.py", line 35, in import_module __import__(name) File "/home/jagdeep/mysite/../mysite/polls/models.py", line 19 def __unicode__(self): ^ IndentationError: unindent does not match any outer indentation level please help -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: error : python manage.py shell
thanks very much Django usersits work On Jun 12, 1:16 pm, Alexander Jeliuc wrote: > I think like Kenneth... django is the same python but additional library. No > python - no django > My recommendation Python Essential Reference 4th edition > > On Sat, Jun 12, 2010 at 11:01 AM, Kenneth Gonsalves > wrote:> On Saturday 12 June 2010 10:39:36 Jagdeep Singh > Malhi wrote: > > > IndentationError: unindent does not match any outer indentation level > > > no one help you in this unless you are willing to do some homework - most > > IDEs > > have a button to press to compile the code - mine uses f8. Press that key > > and > > it will show the indentation error - indentation is part of python syntax. > > You > > should not waste the time of this list by bringing up basic python errors > > here > > - if necessary please take a short course in python. > > -- > > Regards > > Kenneth Gonsalves > > Senior Associate > > NRC-FOSS at AU-KBC > > > -- > > You received this message because you are subscribed to the Google Groups > > "Django users" group. > > To post to this group, send email to django-us...@googlegroups.com. > > To unsubscribe from this group, send email to > > django-users+unsubscr...@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
My http://localhost/admin/ display
My http://localhost/admin/ is display in pattern without grapic or image not like that which is shown in Tutorial http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02 MY admin page (http://localhost/admin/) Django administration Welcome, Jagdeep. Change password / Log out Site administration Auth Groups Add Change Users Add Change Polls Polls Add Change Sites Sites Add Change Recent Actions My Actions where is the problem .i am not able to find??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: My http://localhost/admin/ display
On Jun 13, 12:12 am, Rolando Espinoza La Fuente wrote: > On Sat, Jun 12, 2010 at 12:58 PM, Jagdeep Singh Malhi > > wrote: > > Myhttp://localhost/admin/ is display in pattern without grapic or > > image not like that which is shown in Tutorial > >http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02 > > > MY admin page (http://localhost/admin/) > > > Django administration > > Welcome, Jagdeep. Change password / Log out > > Site administration > > Auth > > Groups Add Change > > Users Add Change > > Polls > > Polls Add Change > > Sites > > Sites Add Change > > > Recent Actions > > My Actions > > > where is the problem .i am not able to find??? > > Using manage.py runserver you shouldn't have this problem. > runserver command takes care of admin styles. > > Are you using apache as webserver? > > ~Rolando yes i am using apache as the Web server... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: My http://localhost/admin/ display
i am use this commands many time , it does not make any effect . On Jun 13, 12:12 am, Rolando Espinoza La Fuente wrote: > On Sat, Jun 12, 2010 at 12:58 PM, Jagdeep Singh Malhi > > wrote: > > Myhttp://localhost/admin/ is display in pattern without grapic or > > image not like that which is shown in Tutorial > >http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02 > > > MY admin page (http://localhost/admin/) > > > Django administration > > Welcome, Jagdeep. Change password / Log out > > Site administration > > Auth > > Groups Add Change > > Users Add Change > > Polls > > Polls Add Change > > Sites > > Sites Add Change > > > Recent Actions > > My Actions > > > where is the problem .i am not able to find??? > > Using manage.py runserver you shouldn't have this problem. > runserver command takes care of admin styles. i am use this commands many time , it does not make any effect . > Are you using apache as webserver? > > ~Rolando -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Serving media files
i am using this link http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi In this link i am unable to under stand topic SERVING MEDIA FILES the lines(given below) which is used in this tutorial , i am able understand where we edit this line , if its edit in apache/ httpd.conf .so its ok but I am also not found this """/usr/local/wsgi/static/media/""" this path in my file system , and where i place "/media" directory which have""css,js,img" directory which is used in admin { Alias /robots.txt /usr/local/wsgi/static/robots.txt Alias /favicon.ico /usr/local/wsgi/static/favicon.ico AliasMatch /([^/]*\.css) /usr/local/wsgi/static/styles/$1 Alias /media/ /usr/local/wsgi/static/media/ Order deny,allow Allow from all WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi Order allow,deny Allow from all } i am used ubuntu10.04 with apache server and my my project is place in directory "/home/your_name/mysite/' -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
Sir Graham my actual problem is this :- Myhttp://localhost/admin/ is display in pattern without grapic or image not like that which is shown in Tutorial http://docs.djangoproject.com/en/1.2/intro/tutorial02/#intro-tutorial02 MY admin page (http://localhost/admin/) Django administration Welcome, Jagdeep. Change password / Log out Site administration Auth Groups Add Change Users Add Change Polls Polls Add Change Sites Sites Add Change Recent Actions My Actions where is the problem .i am not able to find??? On Jun 17, 5:03 pm, Graham Dumpleton wrote: > On Jun 17, 9:17 pm, Jagdeep Singh Malhi > wrote: > > > i am using this > > linkhttp://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-... > > > In this link i am unable to under stand topic SERVING MEDIA FILES > > the lines(given below) which is used in this tutorial , i am able > > understand where we edit this line , if its edit in apache/ > > httpd.conf .so its ok > > > but I am also not found this """/usr/local/wsgi/static/media/""" > > this path in my file system , > > and where i place "/media" directory which have""css,js,img" > > directory which is used in admin > > > { > > > Alias /robots.txt /usr/local/wsgi/static/robots.txt > > Alias /favicon.ico /usr/local/wsgi/static/favicon.ico > > > AliasMatch /([^/]*\.css) /usr/local/wsgi/static/styles/$1 > > > Alias /media/ /usr/local/wsgi/static/media/ > > > > > Order deny,allow > > Allow from all > > > > > WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi > > > > > Order allow,deny > > Allow from all > > > > > } > > > i am used ubuntu10.04 with apache server > > > and my my project is place in directory "/home/your_name/mysite/' > > All the directories are examples only, you would change them to be > what is appropriate for your system. > > In the case of the media files you would copy them from the contrib/ > admin/media directory under where Django is installed to some place > where your site is. > > Thus, run Python and go: > > >>> import django > >>> import os > >>> os.path.dirname(django.__file__) > > '/lib/python2.6/site-packages/django' > > Copy the directory called 'contrib/admin/media' from under that > directory and put that with your site. Then set up the Alias to refer > to it. > > You could set the Alias to refer to the directory in the installed > Django installation if you want and not copy it, but copying it will > allow you to modify the media files and not muck up your original > Django installation. > > Graham -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
On Jun 17, 5:03 pm, Graham Dumpleton wrote: i copy the media directory in my "/home/yourname/mysite" directory. > > Thus, run Python and go: > > >>> import django > >>> import os > >>> os.path.dirname(django.__file__) import django import os os./usr/local/lib/python2.6/dist-packeages/ django.media(django.__file__) File "", line 1 os./usr/local/lib/python2.6/dist-packeages/ django.media(django.__file__) ^ SyntaxError: invalid syntax this show the syntax error... where is the problem > > '/lib/python2.6/site-packages/django' > > Copy the directory called 'contrib/admin/media' from under that > directory and put that with your site. Then set up the Alias to refer > to it. > > You could set the Alias to refer to the directory in the installed > Django installation if you want and not copy it, but copying it will > allow you to modify the media files and not muck up your original > Django installation. > > Graham and httpd.conf file entiers Alias /robots.txt /usr/local/wsgi/static/robots.txt Alias /favicon.ico /usr/local/wsgi/static/favicon.ico AliasMatch /([^/]*\.css) /usr/local/lib/python2.6/dist-packeages/ django/media/css$1 Alias /media/ /usr/local/lib/python2.6/dist-packeages/django/media/ Order deny,allow Allow from all WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi Order allow,deny Allow from all Is this correct .??? my problem is not solve Sir , please help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
On Jun 19, 3:12 pm, Kenneth Gonsalves wrote: > On Saturday 19 June 2010 10:48:57 Jagdeep Singh Malhi wrote:> packeages/ > > packages change this "packages" , but problem is not solve > -- > Regards > Kenneth Gonsalves > Senior Associate > NRC-FOSS at AU-KBC -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
now my httpd.conf file is :- Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ admin/media/ Order deny,allow Allow from all WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi Order allow,deny Allow from all but my http://localhost/admin/ is not show in graphic format or not use css files its again show in this format MY admin page (http://localhost/admin/) Django administration Welcome, Jagdeep. Change password / Log out Site administration Auth Groups Add Change Users Add Change Polls Polls Add Change Sites Sites Add Change Recent Actions My Actions but i can do sir ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
On Jun 19, 10:36 pm, Justin Myers wrote: > Have you set your MEDIA_ROOT, MEDIA_URL and ADMIN_MEDIA_PREFIX > settings in settings.py? > setting is :- MEDIA_ROOT = '/home/your_name/mysite/media/' MEDIA_URL = 'http://localhost/media' ADMIN_MEDIA_PREFIX = '/media/' > On Jun 19, 12:06 pm, Jagdeep Singh Malhi > wrote: > > > now my httpd.conf file is :- > > > Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ > > admin/media/ > > > > media/> > > Order deny,allow > > Allow from all > > > > > WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi > > > > > Order allow,deny > > Allow from all > > > > > but myhttp://localhost/admin/is not show in graphic format or not > > use css files > > > its again show in this format > > > MY admin page (http://localhost/admin/) > > > Django administration > > Welcome, Jagdeep. Change password / Log out > > Site administration > > Auth > > Groups Add Change > > Users Add Change > > Polls > > Polls Add Change > > Sites > > Sites Add Change > > > Recent Actions > > My Actions > > > but i can do sir ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
in which file i see these lines . wrote: > On Jun 20, 3:06 am, Jagdeep Singh Malhi > wrote: > > > now my httpd.conf file is :- > > > Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ > > admin/media/ > > > > media/> > > Order deny,allow > > Allow from all > > > > Change this to: > > admin/media/> > Options Indexes > Order deny,allow > Allow from all > > > Then access the URL: > > /media/ > > on your web server via the browser. You should get a response > something like: > > Index of /media > > Name Last modified Size Description > Parent Directory - > css/ 09-Jun-2010 11:46 - > img/ 09-Jun-2010 11:46 - > js/ 09-Jun-2010 11:46 - > > If you aren't, then that isn't where the media files are or directory > is not accessible to Apache user for some reason. > > Then view the source of the response when access Django admin page. > You should see something like: > > > > > > If you don't see the href link starting with '/media', then you have > fiddled the default settings in your Django settings.py to something > incompatible. The defaults are: > > MEDIA_ROOT = '' > MEDIA_URL = '' > ADMIN_MEDIA_PREFIX = '/media/' > > And if left untouched everything should work where media mounted at / > media in Apache. > > Graham > > > WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi > > > > > Order allow,deny > > Allow from all > > > > > but myhttp://localhost/admin/is not show in graphic format or not > > use css files > > > its again show in this format > > > MY admin page (http://localhost/admin/) > > > Django administration > > Welcome, Jagdeep. Change password / Log out > > Site administration > > Auth > > Groups Add Change > > Users Add Change > > Polls > > Polls Add Change > > Sites > > Sites Add Change > > > Recent Actions > > My Actions > > > but i can do sir ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
Is these setting of my setting.py files are correct ? setting is :- MEDIA_ROOT = '/home/your_name/mysite/media/' MEDIA_URL = 'http://localhost/media' ADMIN_MEDIA_PREFIX = '/media/' On Jun 20, 2:08 pm, Jagdeep Singh Malhi wrote: > On Jun 19, 10:36 pm, Justin Myers wrote:> Have you set > your MEDIA_ROOT, MEDIA_URL and ADMIN_MEDIA_PREFIX > > settings in settings.py? > > setting is :- > MEDIA_ROOT = '/home/your_name/mysite/media/' > > MEDIA_URL = 'http://localhost/media' > > ADMIN_MEDIA_PREFIX = '/media/' > > > On Jun 19, 12:06 pm, Jagdeep Singh Malhi > > wrote: > > > > now my httpd.conf file is :- > > > > Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ > > > admin/media/ > > > > > > media/> > > > Order deny,allow > > > Allow from all > > > > > > > WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi > > > > > > > Order allow,deny > > > Allow from all > > > > > > > but myhttp://localhost/admin/is not show in graphic format or not > > > use css files > > > > its again show in this format > > > > MY admin page (http://localhost/admin/) > > > > Django administration > > > Welcome, Jagdeep. Change password / Log out > > > Site administration > > > Auth > > > Groups Add Change > > > Users Add Change > > > Polls > > > Polls Add Change > > > Sites > > > Sites Add Change > > > > Recent Actions > > > My Actions > > > > but i can do sir ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
On Jun 20, 3:08 pm, Graham Dumpleton wrote: > On Jun 20, 7:34 pm, Jagdeep Singh Malhi > wrote: > > > in which file i see these lines . > > > > > > In your browser, when you request the admin page which isn't showing > the styling, use your browser to view the source code for that page as > the browser received it. This may be under view menu or you can right > click on page to get context menu and it will show option for viewing > source code. > > Did you validate that the /media/ URL shows those directories? > /media is not show those directories its display the files of my operating systems files under media directriy me using ubuntu 10.04 > Did you set those values in settings file back to their default? setting is :- MEDIA_ROOT = '/home/your_name/mysite/media/' MEDIA_URL = 'http://localhost/media' ADMIN_MEDIA_PREFIX = '/media/' is this correct or not ??? > > Graham > > > On Jun 20, 5:25 am, Graham Dumpleton > > wrote: > > > > On Jun 20, 3:06 am, Jagdeep Singh Malhi > > > wrote: > > > > > now my httpd.conf file is :- > > > > > Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ > > > > admin/media/ > > > > > > > > media/> > > > > Order deny,allow > > > > Allow from all > > > > > > > > Change this to: > > > > > > admin/media/> > > > Options Indexes > > > Order deny,allow > > > Allow from all > > > > > > > Then access the URL: > > > > /media/ > > > > on your web server via the browser. You should get a response > > > something like: > > > > Index of /media > > > > Name Last modified Size Description > > > Parent Directory - > > > css/ 09-Jun-2010 11:46 - > > > img/ 09-Jun-2010 11:46 - > > > js/ 09-Jun-2010 11:46 - > > > > If you aren't, then that isn't where the media files are or directory > > > is not accessible to Apache user for some reason. > > > > Then view the source of the response when access Django admin page. > > > You should see something like: > > > > > > > > > > If you don't see the href link starting with '/media', then you have > > > fiddled the default settings in your Django settings.py to something > > > incompatible. The defaults are: > > > > MEDIA_ROOT = '' > > > MEDIA_URL = '' > > > ADMIN_MEDIA_PREFIX = '/media/' > > > > And if left untouched everything should work where media mounted at / > > > media in Apache. > > > > Graham > > > > > WSGIScriptAlias / /home/jagdeep/mysite/apache/django.wsgi > > > > > > > > > Order allow,deny > > > > Allow from all > > > > > > > > > but myhttp://localhost/admin/is not show in graphic format or not > > > > use css files > > > > > its again show in this format > > > > > MY admin page (http://localhost/admin/) > > > > > Django administration > > > > Welcome, Jagdeep. Change password / Log out > > > > Site administration > > > > Auth > > > > Groups Add Change > > > > Users Add Change > > > > Polls > > > > Polls Add Change > > > > Sites > > > > Sites Add Change > > > > > Recent Actions > > > > My Actions > > > > > but i can do sir ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Serving media files
On Jun 20, 5:00 pm, Graham Dumpleton wrote: > On Jun 20, 9:17 pm, Jagdeep Singh Malhi > wrote: > > > > > On Jun 20, 3:08 pm, Graham Dumpleton > > wrote: > > > > On Jun 20, 7:34 pm, Jagdeep Singh Malhi > > > wrote: > > > > > in which file i see these lines . > > > > > > > > > > > yes these links are shown in source file > > > > In your browser, when you request the admin page which isn't showing > > > the styling, use your browser to view the source code for that page as > > > the browser received it. This may be under view menu or you can right > > > click on page to get context menu and it will show option for viewing > > > source code. > > > > Did you validate that the /media/ URL shows those directories? > > > /media is not show those directories > > its display the files of my operating systems files under media > > directriy me using ubuntu 10.04 > > What do you mean by that? Post what the browser shows when you access: > > /media/ > > on your site from your browser. Eg. access: > > http://localhost/media/ > > if access it via localhost. > output on browser:- Index of /media NameLast modified SizeDescription Parent Directory- css/08-Jun-2010 22:18 - img/08-Jun-2010 22:18 - js/ 08-Jun-2010 22:18 - Apache/2.2.14 (Ubuntu) Server at localhost Port 80 > Note that the trailing slash is important. > > There is no point just saying that it doesn't show what I suggest > should be seen, post what it does show instead. > > Also post the output of running: > > ls -las /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ > media/ > output of this :- drwxr-sr-x 5 root staff 4096 2010-06-08 22:18 . 4 drwxr-sr-x 6 root staff 4096 2010-06-08 22:18 .. 4 drwxr-sr-x 2 root staff 4096 2010-06-08 22:18 css 4 drwxr-sr-x 4 root staff 4096 2010-06-08 22:18 img 4 drwxr-sr-x 3 root staff 4096 2010-06-08 22:18 js > Please supply these bits of information, otherwise it is just getting > too hard to help you. May as well consult a tarot reader if you aren't > going to provide what is asked or offer up any other information which > may be relevant to working out what you have done wrong. > > > > Did you set those values in settings file back to their default? > > > setting is :- > > MEDIA_ROOT = '/home/your_name/mysite/media/' > > > MEDIA_URL = 'http://localhost/media' > > > ADMIN_MEDIA_PREFIX = '/media/' > > > is this correct or not ??? > > As I pointed out before, the defaults should work without you having > changed them. What you have there isn't the defaults I get in settings > file when I generate a fresh Django site so you must have changed > them. > > Set them back to what I said in other email for now. Ie., > > MEDIA_ROOT = '' > MEDIA_URL = '' > ADMIN_MEDIA_PREFIX = '/media/' > > Graham > Now , I set default value . > > > > > Graham > > > > > On Jun 20, 5:25 am, Graham Dumpleton > > > > wrote: > > > > > > On Jun 20, 3:06 am, Jagdeep Singh Malhi > > > > > wrote: > > > > > > > now my httpd.conf file is :- > > > > > > > Alias /media/ /usr/local/lib/python2.6/dist-packages/django/contrib/ > > > > > > admin/media/ > > > > > > > > > > > > /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ > > > > > > media/> > > > > > > Order deny,allow > > > > > > Allow from all > > > > > > > > > > > > Change this to: > > > > > > > > > > admin/media/> > > > > > Options Indexes > > > > > Order deny,allow > > > > > Allow from all > > > > > > > > > > > Then access the URL: > > > > > > /media/ > > > > > > on your web server via the browser. You should get a response > > > > > something like: > > > > > > Index of /media > > > > > > Name Last modified Size Description > > > > > Parent Directory - > > > > > css/ 09-Jun-2010 11:46 - > > > > > img/ 09-Jun-2010 11:46 - > > > > > js/ 09-Jun-2010 11:46 - > > > > > > If you aren't, then that
Re: Serving media files
Sir thanks very much indeed , now its works. thanks. On Jun 20, 11:37 pm, Jagdeep Singh Malhi wrote: > On Jun 20, 5:00 pm, Graham Dumpleton > wrote: > > > On Jun 20, 9:17 pm, Jagdeep Singh Malhi > > wrote: > > > > On Jun 20, 3:08 pm, Graham Dumpleton > > > wrote: > > > > > On Jun 20, 7:34 pm, Jagdeep Singh Malhi > > > > wrote: > > > > > > in which file i see these lines . > > > > > > > > > > > > > > yes these links are shown in source file > > > > > In your browser, when you request the admin page which isn't showing > > > > the styling, use your browser to view the source code for that page as > > > > the browser received it. This may be under view menu or you can right > > > > click on page to get context menu and it will show option for viewing > > > > source code. > > > > > Did you validate that the /media/ URL shows those directories? > > > > /media is not show those directories > > > its display the files of my operating systems files under media > > > directriy me using ubuntu 10.04 > > > What do you mean by that? Post what the browser shows when you access: > > > /media/ > > > on your site from your browser. Eg. access: > > > http://localhost/media/ > > > if access it via localhost. > > output on browser:- > Index of /media > Name Last modified Size Description > Parent Directory - > css/ 08-Jun-2010 22:18 - > img/ 08-Jun-2010 22:18 - > js/ 08-Jun-2010 22:18 - > Apache/2.2.14 (Ubuntu) Server at localhost Port 80 > > > Note that the trailing slash is important. > > > There is no point just saying that it doesn't show what I suggest > > should be seen, post what it does show instead. > > > Also post the output of running: > > > ls -las /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ > > media/ > > output of this :- > drwxr-sr-x 5 root staff 4096 2010-06-08 22:18 . > 4 drwxr-sr-x 6 root staff 4096 2010-06-08 22:18 .. > 4 drwxr-sr-x 2 root staff 4096 2010-06-08 22:18 css > 4 drwxr-sr-x 4 root staff 4096 2010-06-08 22:18 img > 4 drwxr-sr-x 3 root staff 4096 2010-06-08 22:18 js > > > > > Please supply these bits of information, otherwise it is just getting > > too hard to help you. May as well consult a tarot reader if you aren't > > going to provide what is asked or offer up any other information which > > may be relevant to working out what you have done wrong. > > > > > Did you set those values in settings file back to their default? > > > > setting is :- > > > MEDIA_ROOT = '/home/your_name/mysite/media/' > > > > MEDIA_URL = 'http://localhost/media' > > > > ADMIN_MEDIA_PREFIX = '/media/' > > > > is this correct or not ??? > > > As I pointed out before, the defaults should work without you having > > changed them. What you have there isn't the defaults I get in settings > > file when I generate a fresh Django site so you must have changed > > them. > > > Set them back to what I said in other email for now. Ie., > > > MEDIA_ROOT = '' > > MEDIA_URL = '' > > ADMIN_MEDIA_PREFIX = '/media/' > > > Graham > > Now , I set default value . > > > > > > > Graham > > > > > > On Jun 20, 5:25 am, Graham Dumpleton > > > > > wrote: > > > > > > > On Jun 20, 3:06 am, Jagdeep Singh Malhi > > > > > > wrote: > > > > > > > > now my httpd.conf file is :- > > > > > > > > Alias /media/ > > > > > > > /usr/local/lib/python2.6/dist-packages/django/contrib/ > > > > > > > admin/media/ > > > > > > > > > > > > > > /usr/local/lib/python2.6/dist-packages/django/contrib/admin/ > > > > > > > media/> > > > > > > > Order deny,allow > > > > > > > Allow from all > > > > > > > > > > > > > > Change this to: > > > > > > > > > > > > admin/media/> > > > > > > Options Indexes > > > > > > Order deny,allow > > > > > > Allow from all > > > > > > > > > > > > > Then access the URL: > > > > >
import django : error
$import django error : import: unable to open X server `' @ import.c/ImportImageCommand/361. i am working on ubuntu 10.04 server version -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: import django : error
On Jun 23, 11:00 pm, Jagdeep Singh Malhi wrote: > $import django > error : > import: unable to open X server `' @ import.c/ImportImageCommand/361. > > i am working on ubuntu 10.04 server version And ./manage.py runserver Error: No module named messages how handle this error ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: import django : error
On Jun 24, 12:26 am, Karen Tracey wrote: > On Wed, Jun 23, 2010 at 2:26 PM, Jagdeep Singh Malhi < > > > > singh.malh...@gmail.com> wrote: > > > On Jun 23, 11:00 pm, Jagdeep Singh Malhi > > wrote: > > > $import django > > > error : > > > import: unable to open X server `' @ import.c/ImportImageCommand/361. > > > > i am working on ubuntu 10.04 server version > > > And > > ./manage.py runserver > > > Error: No module named messages > > > how handle this error ??? > > For the first I have no idea, never seen it. > > The "No module named messages" error happens when you have a Django project > settings file that was created with Django 1.2 but the Django your > PYTHONPATH is pointing to is 1.1.X or lower. Fix is to fix up your > PYTHONPATH to point to a 1.2 level of Django. > where i check my PYTHONPATH is pointing to 1.2.or lower ?? And i never use Django 1.1 version , i only install 1.2 version with python 2.6 > Karen > --http://tracey.org/kmt/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Error :python manage.py runserver
./manage.py runserver Error: No module named messages OR python manage.py syncdb Error: No module named messages where is problem ??? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
problem models.py code
I try this code to create database in using django. file :models.py class amount(models.Model): jono = models.PositiveIntegerField(unique=True) name = models.CharField(max_length=750) receipt = models.CharField(max_length=200) phno = models.CharField(max_length=25) type = models.CharField(max_length=50) rdate = models.DateField('date published') site = models.CharField(max_length=200) after run #python manage.py sql tcc command i get BEGIN; CREATE TABLE `tcc_amount` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `jono` integer UNSIGNED NOT NULL UNIQUE, `name` varchar(750) NOT NULL, `receipt` varchar(200) NOT NULL, `phno` varchar(25) NOT NULL, `type` varchar(50) NOT NULL, `rdate` date NOT NULL, `site` varchar(200) NOT NULL ) ; COMMIT; But i want 'jono' is also AUTO_INCREMENT with 'id' or only jono not include the 'id '. Which code is used to make 'jono ' to auto increment.?? Pleases help ,if possible. thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problem models.py code
Problem solve Thanks Django users - jagdeep singh -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
convert mysql database tables into classes of model.py file
I have the backup of mysql database with tables and fields data. I want to use these tables and fields to create the classes in model.py file for django. Is it possible? Is any tool and script for convert the database tables with fields into a modey.py to create class? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
problem : create form
i follow these documentation for create form http://docs.djangoproject.com/en/dev/topics/forms/ i use command for create application #python manage.py startapp form after this a use this code in model.py file from django import forms class ContactForm(forms.Form): subject = forms.CharField(max_length=100) message = forms.CharField() sender = forms.EmailField() cc_myself = forms.BooleanField(required=False) but nothing can be show in when a run this command #python manage.py sql form. where is problem ? please help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: convert mysql database tables into classes of model.py file
Problem solve @Steve Holden Thanks sir -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problem : create form
> > Why do you think you would get any SQL with that? You're creating a > form, not a model. ok I also want to store the value in database using form. Now what i can do? any tutorial of that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
forms tutorials
Hi... I done the tutorials http://docs.djangoproject.com/en/dev/intro/tutorial04/#intro-tutorial04 for create the form using database. Now i want to study more tutorials/examples which is helpful for me to create the forms using database. if anybody know about the links/websites/other sources related Django forms. Please post. Thanks Regards, Jagdeep Singh -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Convert php project into django
I make a project in php5, but now i want shift my project into Django. I am able to shift my database into model.py file using this command #django-admin.py inspectdb and also complete the 4 Tutorial http://docs.djangoproject.com but now want to my shift the other php5 work into django. Is it possible and how? Is it any tool or help tutorials, which make my work easier? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Convert php project into django
> since python and php radically differ on the way things are done, it > would be much quicker to rewrite the code afresh rather than attempt to > translate it. ok sir, thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django-Cms Installation Error
I try to Install the Django-Cms using this link http://www.django-cms.org/en/documentation/2.0/installation/ I face this error. I am able understand this error ERROR is : - { ImproperlyConfigured at / 'PageAdmin.exclude' refers to field 'created_by' that is missing from the form. Request Method: GET Request URL:http://localhost/django/ Django Version: 1.2.1 Exception Type: ImproperlyConfigured Exception Value: 'PageAdmin.exclude' refers to field 'created_by' that is missing from the form. Exception Location: /usr/local/lib/python2.6/dist-packages/django/ contrib/admin/validation.py in check_formfield, line 361 Python Executable: /usr/bin/python Python Version: 2.6.5 Python Path:['/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/ python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', '/usr/lib/ python2.6/dist-packages/PIL', '/usr/lib/python2.6/dist-packages/ gst-0.10', '/usr/lib/pymodules/python2.6', '/usr/lib/python2.6/dist- packages/gtk-2.0', '/usr/lib/pymodules/python2.6/gtk-2.0', '/usr/lib/ python2.6/dist-packages/wx-2.6-gtk2-unicode', '/usr/local/lib/ python2.6/dist-packages', '/home/jagdeep/'] Server time:Sat, 21 Aug 2010 06:01:24 -0500 } Please Help -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django-Cms Installation Error
sorry, I am not able understand this error. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django-Cms Installation Error
On Aug 21, 10:17 pm, Marek Dudek wrote: > You have django 1.2.1, now I noticed > I wasn't able to install any version of django-cms with django 1.2.1 and > I tried 2.0.0, 2.0.1, 2.0.2 and 2.1.0-beta3 > Most up-to-date combination that I successfully installed is django > 1.1.1 with django-cms 2.0.2. > Hope this helps Thanks Is any version of Django -Cms is working with Django 1.2.1 ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Problem with ModelForm
I try to Create forms from models I am facing error message with 'is_valid()' error is : { AttributeError at /add_db/ 'Input' object has no attribute 'is_valid' Request Method: POST Request URL:http://localhost/django/add_db/ Django Version: 1.2.1 Exception Type: AttributeError Exception Value: 'Input' object has no attribute 'is_valid' Exception Location: /home/jagdeep/mysite/add_db/views.py in add_db, line 11 Python Executable: /usr/bin/python Python Version: 2.6.5 } Coded file are given below: model.py : from django.db import models from django.forms import ModelForm class Input(models.Model): input1 = models.FloatField() input2 = models.FloatField() class Output(models.Model): out = models.ForeignKey(Input) output = models.FloatField() class InputForm(ModelForm): class Meta : model = Input class OutputForm(ModelForm): class Meta : model = Output View.py : from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from mysite.add_db.models import * from django.template import RequestContext from django.core.urlresolvers import reverse def add_db(request): if request.method == 'POST': form = Input(request.POST) if form.is_valid(): cd = form.cleaned_data input1 = cd['input1'] input2 = cd['input2'] form.save() output = input1 + input2 return render_to_response('add_db/output.html', {'form': form, 'input1':input1, 'input2':input2, 'output':output}, context_instance=RequestContext(request)) else: form = Input() return render_to_response('add_db/add.html', {'form': form}, context_instance=RequestContext(request)) Please help. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problem with ModelForm
> Fairly obviously, you've instantiated the model - Input() - rather > than the form - InputForm() - in both branches of the if statement of > your view. it works. Thanks Sir. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Getting last or max "id" value from database
I try to get the max value of id from database using max() function but a face this error. { TypeError at /add_db/ 'builtin_function_or_method' object is not iterable Request Method: POST Request URL:http://localhost/django/add_db/ Django Version: 1.2.1 Exception Type: TypeError Exception Value:'builtin_function_or_method' object is not iterable Exception Location: /home/jagdeep/mysite/add_db/views.py in add_db, line 19 Python Executable: /usr/bin/python } model.py from django.db import models from django.forms import ModelForm class Input(models.Model): input1 = models.FloatField() input2 = models.FloatField() class Output(models.Model): out = models.ForeignKey(Input) output = models.FloatField() class InputForm(ModelForm): class Meta : model = Input class OutputForm(ModelForm): class Meta : model = Output View.py from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from mysite.add_db.models import * from django.template import RequestContext from django.core.urlresolvers import reverse def add_db(request): if request.method == 'POST': form = InputForm(request.POST) if form.is_valid(): cd = form.cleaned_data input1 = cd['input1'] input2 = cd['input2'] form.save() form_output = OutputForm() output = input1 + input2 p = get_object_or_404(Input, pk=max(id)) form_output_final = p.output_set.create(output=output) return render_to_response('add_db/output.html', {'form': form, 'input1':input1, 'input2':input2, 'output':output}, context_instance=RequestContext(request)) else: form = InputForm() return render_to_response('add_db/add.html', {'form': form}, context_instance=RequestContext(request)) I want to get the latest or maximum "Id" value of INPUT table from database. please help Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Getting last or max "id" value from database
> Given that the ModelForm save() method actually returns the Input object > it has just created, wouldn't you be better simply saying > > p = form.save() > Problem solved Thanks Sir. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django template : For Loop
I have question about "for loop" used in Templates the correct Syntax of using For Loop in template is : {% for X in VALUE %} but I want to use For loop with two value Is it possible to use two value in one loop? For example : {% for X, Y in VALUE1, VALUE2 %} Or {% for X in VALUE1 && Y in VALUE2 %} These syntaxes are wrong, just for example. Is it possible to use for loop with two value in django templates? if yes, How? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django template : For Loop
> If these objects are lists, say list1 and list2, in your view just > create a single object made up of pairs of elements from the original lists: > > values = zip(list1, list2) > > Then you can pass that item to your template and iterate over it. I tried this, its not working. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django template : For Loop
> > I tried this, its not working. > > Sorry, but "not working" does not constitute useful information. > > My car isn't working. Can you fix it? ;-) model.py from django.db import models from django.forms import ModelForm class Input(models.Model): input1 = models.FloatField() input2 = models.FloatField() class Output(models.Model): out = models.ForeignKey(Input) output = models.FloatField() class InputForm(ModelForm): class Meta : model = Input class OutputForm(ModelForm): class Meta : model = Output view.py from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from mysite.add_db.models import * from django.template import RequestContext from django.core.urlresolvers import reverse def add_db(request): if request.method == 'POST': form = InputForm(request.POST) if form.is_valid(): cd = form.cleaned_data input1 = cd['input1'] input2 = cd['input2'] p = form.save() form_output = OutputForm() output = input1 + input2 form_output_final = p.output_set.create(output=output) return render_to_response('add_db/output.html', {'form': form, 'input1':input1, 'input2':input2, 'output':output}, context_instance=RequestContext(request)) else: form = InputForm() return render_to_response('add_db/add.html', {'form': form}, context_instance=RequestContext(request)) def result(request): input_list = Input.objects.all().order_by('-id') output_list = Output.objects.all() return render_to_response('add_db/result.html', {'input_list': input_list, 'output_list': output_list}) Templates result.html All Data {% if input_list %} {% for input in input_list %} {% for output in output_list %} {% if input.id == output.id %} {{ input.id}} : {{ input.input1 }} + {{ input.input2 }} = {{output.output}} {% endif %} {% endfor %} {% endfor %} {% else %} No data are available. {% endif %} now i try this code {% for input in input_list %} {% for output in output_list %} {% if input.id == output.id %} my problem is solved but is this correct way to get values from two tables and use in templates? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django template : For Loop
> but is this correct way to get values from two tables and use in > templates? Me actually want to combine to tables and use there values in template Is the above post code is correct way to do this? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django-Cms Installation Error with stable Version
I am use Install the Django-Cms using this link http://www.django-cms.org/en/documentation/2.0/installation/ I face this error. I am able understand this error I am using Django Version is 1.1.2 and Django -cms is 2.0.2 Version is matching with Documentation of Django-Cms ERROR is : - { ImproperlyConfigured at / 'PageAdmin.exclude' refers to field 'created_by' that is missing from the form. Request Method: GET Request URL:http://localhost/djangocms/ Exception Type: ImproperlyConfigured Exception Value: 'PageAdmin.exclude' refers to field 'created_by' that is missing from the form. Exception Location: /usr/local/lib/python2.6/dist-packages/django/ contrib/admin/validation.py in check_formfield, line 310 Python Executable: /usr/bin/python Python Version: 2.6.5 } -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
virtualenv used with mod_wsgi
I am try to use Multiple version of Django on same machine. I am using the Virtual Python Environment builder (virtualenv 1.5). I am able to install this using documentation. http://pypi.python.org/pypi/virtualenv#downloads but now i am facing problem with mod-wsgi. i am not able to understand how mod-wsgi work with virtualenv. when i try this, it use the same python , not created by virtualenv file used for virtualenv is:- django.wsgi { import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'djangocms.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() sys.path.append('/home/jagdeep/') } Actually, I want mod-wsgi is working with different version of Django. Now, what i can do? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: virtualenv used with mod_wsgi
On Sep 15, 11:15 am, Colin Bean wrote: > Have you tried the steps described > here:http://code.google.com/p/modwsgi/wiki/VirtualEnvironments? > now i try this i found error : raise ImproperlyConfigured, "Error loading MySQLdb module: %s" % e django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb But its MySQLdb installed. but its not on python path. i read this post http://groups.google.com/group/django-users/browse_thread/thread/5c9028b293144f92/3b923c3f1abf5ebe In this post i found the solution, but not understand this { export PYTHONPATH=/dir/where/mysqldb/lives:$PYTHONPATH Placing that in the file '.bashrc' in your home directory will cause it to be set automatically for you any time you open up a shell. } me add this line in .bashrc file like export PYTHONPATH=/dir/where/mysqldb/lives:$/home/jagdeep/CMS/ENV/bin/ python Is this correct? my python path :/home/jagdeep/CMS/ENV/bin/python -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: virtualenv used with mod_wsgi
On Sep 16, 2:25 am, Graham Dumpleton wrote: > You need to add it to sys.path in WSGI script file. The PYTHONPATH > in .bashrc of your personal account isn't used by Apache/mod_wsgi. > > Graham i already use sys.path my WSGI script file is { import site site.addsitedir('/home/jagdeep/CMS/bin/lib/python2.6/site-packages') import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'djangocms.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() sys.path.append('/home/jagdeep/') } my django project is placed in /home/jagdeep/djangocms directory -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: virtualenv used with mod_wsgi
On Sep 16, 1:51 pm, Graham Dumpleton wrote: > Then that directory isn't where it is installed, or the permissions on > your directories are such that user that Apache runs as can't read > that directory. Post a 'ls -las' directory listing of your site- > packages directory and check that from that directory up to your home > directory is readable to others. my site-packages and /home/jagdeep/djangocms are readable by other. my Django is works fine but, me face problem with MySQLdb error is : Error loading MySQLdb module: No module named MySQLdb but its MySQLdb is already installed in my PC i face this problem, when i use Virtual Python Environment builder(virtualenv 1.5) Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Error loading MySQLdb module with virtualenv (Virtual Python Environment builder)
I am using virtualenv 1.5 to install multiple version of django in same PC. My Django is works fine with virtualenv, follow this link http://pypi.python.org/pypi/virtualenv#downloads but me face problem with MySQLdb when i configure the database in setting.py file. Error is : ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb but MySQLdb is already installed in my PC and work fine without using virtualenv. I face this problem, when i use Virtual Python Environment builder(virtualenv 1.5) for multiple pythons. My django mod_wsgi file is :- { import site site.addsitedir('/home/jagdeep/CMS/ENV/lib/python2.6/site-packages') import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'djangocms.settings' sys.path.append('/home/jagdeep/') import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() } Please help. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Error loading MySQLdb module with virtualenv (Virtual Python Environment builder)
> Have you created the virtual environment by using the --no-site-packages > command line switch to virtualenv? yes , me using -no-site-packages command > If so, no globally installed module/packages > (among them MySQLdb) will be inherited by the environment. > If you are starting, I'd suggest to not mix two somewhat complex > tools like virtualenv and wsgi, specially if you are experiencing problems > with one of them. ok, sir me try best. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Problem with Mysql Quires in django
hi I want to use this mysql Query " SELECT count(*) as class_roll_no FROM student_profile where class_roll_no !='00 ' "; in my view file Is it possible? I try this code view.py file is : from django.shortcuts import render_to_response from mysite.student.models import Profile from django.db.models import Count def fulldetail(request): fulldetail = Profile.objects.all().order_by('class_roll_no') total_count = Profile.objects.filter( class_roll_no !='00') total = total_count.count() return render_to_response("userprofile/profile/fulldetail.html", {"fulldetail" : fulldetail, "total":total} ) Is this correct way to use this? if not please help or give any tutorials how to use mysql quires with some conditions. template file code is: Total = {{ total }} PHOTONAMEROLL NOBRANCH {% if fulldetail %} {% for part in fulldetail %} {% if part.firstname %} {% if part.photo %} {% endif %}{{ part.firstname }} {{ part.middlename }} {{ part.lastname }}{{ part.class_roll_no}} {{ part.branch }} {% endif %} {% endfor %} {% else %} Data is Not available. {% endif %} I only count number of entry with condition. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Mysql Quires using raw()
hi I am facing problem with raw() mysql quiers for example : maxid = Client.objects.raw('SELECT Max(id) FROM client') print maxid output is :- I am using Django 1.2 version. where I am wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Mysql Quires using raw()
> Nowhere. Output is correct and as documented - you get back *RawQuerySet*. Not > a single value. > > So you have to do something like: > > maxid = Client.objects.raw('SELECT MAX(job_no) as max_job_no FROM > CLIENT').values_list('max_job_no', flat=True)[0] facing this error AttributeError: 'RawQuerySet' object has no attribute 'values_list' -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Mysql Quires using raw()
now I also try another method to get max(id) from django.db import connection cursor = connection.cursor() cursor.execute('SELECT max(id) FROM automation_client') maxid = cursor.fetchone() output is : (2L,) but i want only 2 not any other character. Is any other method to get max(id) from database tables? Please help. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Mysql Quires using raw()
> >>> from django.db.models import Max > >>> Client.objects.aggregate(maxid=Max('id')) > > {'maxid': 2L} > > And you'll get a dictionary with the value you want as a result. > > [1]:http://docs.djangoproject.com/en/1.1/topics/db/aggregation/ Thanks for link, problem solve. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Problem with Mysql Queries in django
Hi I have two Problems with Mysql Query First problem : for example :- >>>client = ClientJob.objects.filter(date__contains = '2010-11- ') >>> client Warning Message is :- Warning: Incorrect date value: '%2010-11-%' for column 'date' at row 1 its doesn't work I want use Mysql Query like :- SELECT ... WHERE date LIKE '2010-11-%'; Second Problem: I declayer two varables and want use in MySql Query for example :- def function(request): if request.method == 'POST': form = MonthlyReport(request.POST) if form.is_valid(): cd = form.cleaned_data month = cd['month'] year = cd['year'] client = ClientJob.objects.filter(date__contains = year-month-__) I am using two Variables year and month in query and got Syntax error or error: unsupported operand type(s) for -: 'unicode' and 'unicode' I want to use variables in Query. Please help Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problem with Mysql Queries in django
On Nov 22, 11:28 pm, Rogério Carrasqueira wrote: > Hi Jagdeep, > > Consider to use a query like this example: > > sales = > Sale.objects.extra(select={'month':'month(date_created)','year':'year(date_created)'}).values('year','month').annotate(month=11,year=2010) > Not working Error : File "", line 1, in File "/usr/local/lib/python2.6/dist-packages/django/db/models/ query.py", line 632, in annotate is_summary=False) File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/ query.py", line 911, in add_aggregate field_list = aggregate.lookup.split(LOOKUP_SEP) AttributeError: 'int' object has no attribute 'lookup' > It works on mysql. > > More informationhttp://docs.djangoproject.com/en/dev/ref/models/querysets/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Problem with Mysql Queries in django
On Nov 22, 11:28 pm, Rogério Carrasqueira wrote: > Hi Jagdeep, > > Consider to use a query like this example: > > sales = > Sale.objects.extra(select={'month':'month(date_created)','year':'year(date_created)'}).values('year','month').annotate(month=11,year=2010) > > It works on mysql. > > More informationhttp://docs.djangoproject.com/en/dev/ref/models/querysets/ Thanks for this link problem solve, using this simple query client = ClientJob.objects.filter(date__year=2010).filter(date__month=11) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django Graphics
Can we handle graphics in Django? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django Graphics
On Dec 2, 1:18 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > Please define 'handle graphics'. > > Do you mean serving graphics media? Creating graphics on the fly? > Resizing? Overlaying? Give us some clues ;) CAD. Making circle, triangle etc like in AutoCAD / QCAD, or paint brush Making sketches / figures. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
sum() of Model field or DB field
hi I want to use mysql Query : Select sum(field_name) FROM table_name WHERE some condition. Is it possible without using raw queries in Django ? if yes, please help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: sum() of Model field or DB field
On Dec 7, 10:16 pm, Wayne Smith wrote: > You want to use an aggregation > function:http://docs.djangoproject.com/en/dev/ref/models/querysets/#aggregatio... > Thanks, Problem solve. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Installing django
I try to install Django in Ubuntu 9.10 ... using this link http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-server but i face problem with this command #django-admin.py syncdb it not works error message is { Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in management.execute_from_command_line() File "/usr/lib/python2.6/dist-packages/django/core/management/ __init__.py", line 429, in execute_from_command_line utility.execute() File "/usr/lib/python2.6/dist-packages/django/core/management/ __init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.6/dist-packages/django/core/management/ __init__.py", line 257, in fetch_command klass = load_command_class(app_name, subcommand) File "/usr/lib/python2.6/dist-packages/django/core/management/ __init__.py", line 67, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/usr/lib/python2.6/dist-packages/django/utils/importlib.py", line 35, in import_module __import__(name) File "/usr/lib/python2.6/dist-packages/django/core/management/ commands/syncdb.py", line 7, in from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal File "/usr/lib/python2.6/dist-packages/django/core/management/ sql.py", line 5, in from django.contrib.contenttypes import generic File "/usr/lib/python2.6/dist-packages/django/contrib/contenttypes/ generic.py", line 6, in from django.db import connection File "/usr/lib/python2.6/dist-packages/django/db/__init__.py", line 14, in if not settings.DATABASES: File "/usr/lib/python2.6/dist-packages/django/utils/functional.py", line 281, in __getattr__ self._setup() File "/usr/lib/python2.6/dist-packages/django/conf/__init__.py", line 38, in _setup raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined. } what can i do please help.. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django default templates
> Im having problems figuring out how to work my way through part 2 of > the tutorial, where I have to copy some default django templates to my > own template directory. Where are the default django templates, Default Django Templates for admin : /your_system_python_path/django/ contrib/admin/templates > where are my own templates? Or do I just create a new folder for > templates and copy some default django ones there? Create a new folder and give path of new folder in setting.py file Example : TEMPLATE_DIRS = ( '/home/my_username/mytemplates', # Change this to your own directory. ) > Please help For more help Read Tutorial-02 carefully under sub-heading : Customize the admin look and feel -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: VERY cheap django hosting?
Webfraction.com very cheap for hosting django For more plan : http://www.webfaction.com/services/hosting -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Django views
On Jun 28, 1:17 pm, sandeep kaur wrote: > Hello all, > I want to include background images and gallery images to my django project > and I am unable to do so.Images do not get displayed. please help me out You mean use image in Django templates ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: let the users download files
On Jun 29, 10:34 am, pankaj sharma wrote: > hello friends , > i have a database in which i have some files say photos... Why you store you files in database? You need to store the path of file in database and files area stored in that path or folder. > {i am uploading photos from django admin.} > i want to make a template so that the users of my website can download > these photos .. > so can anyone provide me some useful information or any link Code for retrieve file in django template, if file path is store in database and file store in that path or folder. {% if variable1 %} {% for variable2 in variable1 %} {% if variable2.database_field_name %} {% endif %} {% endfor %} {% endif %} -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Database Table Locks/unlocks (for reading, writing or both)
Hi.. Is Django automatically done the table locking /unlocking concept in case of Mysql/PostGreSQL? if not how I done this manually? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Database Table Locks/unlocks (for reading, writing or both)
> > Is Django automatically done the table locking /unlocking concept in > > case of Mysql/PostGreSQL? > > Depends how backend handles database sessions. > > > if not how I done this manually? > > Thing you described is called pessimistic locking. What are you trying to > accomplish with that? I only want to know is Django is able Lock/Unlock the Database tables, If yes. How its possible? how its works -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Browsing through media files on remote machine
On Feb 27, 1:01 am, Borislav Petrović wrote: > Hello, > > Is there an app, or a suggestion on how to browse through media > files on a remote machine? > > I have a setup that would include two separate machines one from a web > hosting for my django site and another that would host media files. I need > to be able to browse and select files from django admin and save their paths > to a database field so they can be served on the web page. No uploading > needed. You need to set MEDIA_PATH =" (IP address or URL) " in setting.py file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.