Re: Django external access [Windows]
Does it work from another machine on the same local network? This is definitely possible though; I've done it before. On 6 June 2010 14:35, John Yeukhon Wongwrote: > I just disabled the FW, but no luck with any trials. > > Yeah. Security isn't my concern because only a few people (including > myself) will learn about this project. They will only see the > interfaces at certain stages when I give out notifications. > I am sure in Linux there isn't any problem with overriding the > restriction. > It's so weird with XP. > > Hahaha > > Thanks > > On Jun 5, 11:55 pm, Sam Lai wrote: >> Oops. Seems like you've tried that already. >> >> Have you checked your Windows firewall settings? >> >> On 6 June 2010 13:53, Sam Lai wrote: >> >> > By default, the Django development server does not allow hosts to >> > connect unless it is localhost (127.0.0.1) or a local IP >> > (192.168.1.101 in your case). >> >> > Doing this is a *bad idea*, as indicated by the docs - >> >http://docs.djangoproject.com/en/1.2/ref/django-admin/#djadmin-runserver >> >> > If you really do want to override it, start the server like this - >> >> > python manage.py runserver 0.0.0.0:8000 >> >> > That tells the dev server to accept any IP. >> >> > If I were you, I'd just set up IIS/Apache. There's no advantage of >> > accessing your dev server from elsewhere anyway, because you can't see >> > the debug messages. >> >> > On 6 June 2010 10:32, John Yeukhon Wong wrote: >> >> For my home purpose, currently I am running Windows XP. >> >> >> I have everything ready. Django, Python are all good. >> >> >> If I let the runserver (I am using the django-development server) to >> >> be 127.0.0.1:8000 or 192.168.1.101:8000 they all worked. >> >> >> Let say abc.no-ip.org is a FREE DNS service I use to access >> >> externally. >> >> >> In the past when I did this in debian or ubuntu, there was no access >> >> issue except the fact that I enabled either multi-cast or NET >> >> Redirection in my router firewall setting. >> >> >> I checked my router setting so many times and nothing suspicious. >> >> >> I even tried like 192.168.1.101:8080 0.0.0.0:8080 in the runserver >> >> command and no luck. >> >> >> I still cannot access to abc.no-ip.org >> >> >> How come? >> >> >> 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 >> >> 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. > > -- 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 Gonsalveswrote: > 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.
Re: Django external access [Windows]
I just disabled the FW, but no luck with any trials. Yeah. Security isn't my concern because only a few people (including myself) will learn about this project. They will only see the interfaces at certain stages when I give out notifications. I am sure in Linux there isn't any problem with overriding the restriction. It's so weird with XP. Hahaha Thanks On Jun 5, 11:55 pm, Sam Laiwrote: > Oops. Seems like you've tried that already. > > Have you checked your Windows firewall settings? > > On 6 June 2010 13:53, Sam Lai wrote: > > > By default, the Django development server does not allow hosts to > > connect unless it is localhost (127.0.0.1) or a local IP > > (192.168.1.101 in your case). > > > Doing this is a *bad idea*, as indicated by the docs - > >http://docs.djangoproject.com/en/1.2/ref/django-admin/#djadmin-runserver > > > If you really do want to override it, start the server like this - > > > python manage.py runserver 0.0.0.0:8000 > > > That tells the dev server to accept any IP. > > > If I were you, I'd just set up IIS/Apache. There's no advantage of > > accessing your dev server from elsewhere anyway, because you can't see > > the debug messages. > > > On 6 June 2010 10:32, John Yeukhon Wong wrote: > >> For my home purpose, currently I am running Windows XP. > > >> I have everything ready. Django, Python are all good. > > >> If I let the runserver (I am using the django-development server) to > >> be 127.0.0.1:8000 or 192.168.1.101:8000 they all worked. > > >> Let say abc.no-ip.org is a FREE DNS service I use to access > >> externally. > > >> In the past when I did this in debian or ubuntu, there was no access > >> issue except the fact that I enabled either multi-cast or NET > >> Redirection in my router firewall setting. > > >> I checked my router setting so many times and nothing suspicious. > > >> I even tried like 192.168.1.101:8080 0.0.0.0:8080 in the runserver > >> command and no luck. > > >> I still cannot access to abc.no-ip.org > > >> How come? > > >> 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 > >> 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: design question - forms as meta-data to a model
On Fri, Jun 4, 2010 at 2:42 AM, Russell Keith-Mageewrote: > On Fri, Jun 4, 2010 at 12:03 PM, Jason Beaudoin > wrote: >> Silence usually implies some key piece of documentation was missed, or >> was this just lost amongst more interesting posts? :) > > You've missed two important alternatives: > * The people who can answer your question are busy > * Nobody can understand your question. > > Personally, I fall into both these categories. I'm still trying to dig > myself out from tasks stemming from DjangoCon; and I really can't work > out what it is you're trying to do. You are fantastic :) My apologies, let me try to clarify: - I've got a model that defines "submissions", which are incoming messages from HTML forms on various websites and are fielded by admins - each submission has a bunch of basic information related to the submission (where, when, etc), as well as the data submitted by the user (form input field) - each form on each website is different, and will be different in the future - allowing non-developers the ability to manage these forms would be really nice, so creating them through a frontend interface (as opposed to developers hardcoding forms) is a desirable goal - the idea is that users would submit information from various source websites to a central repository via a number of forms all with different fields and varying in # of fields, field names, etc. the central repository is a place where everything is reviewed, where submissions are displayed in a "this is when it came in, from here, and this is what the user gave us" type of way. I'm not sure how to save the form information with each submission, given that each form will be different.. I'm used to defining specific forms and only accepting specific information. > So - perhaps if you explain your problem in more detail, you might > have more luck getting a response. Indeed, this is sometimes a bit difficult to communicate with clarity. Regards, ~Jason -- 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 external access [Windows]
Oops. Seems like you've tried that already. Have you checked your Windows firewall settings? On 6 June 2010 13:53, Sam Laiwrote: > By default, the Django development server does not allow hosts to > connect unless it is localhost (127.0.0.1) or a local IP > (192.168.1.101 in your case). > > Doing this is a *bad idea*, as indicated by the docs - > http://docs.djangoproject.com/en/1.2/ref/django-admin/#djadmin-runserver > > If you really do want to override it, start the server like this - > > python manage.py runserver 0.0.0.0:8000 > > That tells the dev server to accept any IP. > > If I were you, I'd just set up IIS/Apache. There's no advantage of > accessing your dev server from elsewhere anyway, because you can't see > the debug messages. > > On 6 June 2010 10:32, John Yeukhon Wong wrote: >> For my home purpose, currently I am running Windows XP. >> >> I have everything ready. Django, Python are all good. >> >> If I let the runserver (I am using the django-development server) to >> be 127.0.0.1:8000 or 192.168.1.101:8000 they all worked. >> >> Let say abc.no-ip.org is a FREE DNS service I use to access >> externally. >> >> In the past when I did this in debian or ubuntu, there was no access >> issue except the fact that I enabled either multi-cast or NET >> Redirection in my router firewall setting. >> >> I checked my router setting so many times and nothing suspicious. >> >> I even tried like 192.168.1.101:8080 0.0.0.0:8080 in the runserver >> command and no luck. >> >> I still cannot access to abc.no-ip.org >> >> How come? >> >> 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. >> >> > -- 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 external access [Windows]
By default, the Django development server does not allow hosts to connect unless it is localhost (127.0.0.1) or a local IP (192.168.1.101 in your case). Doing this is a *bad idea*, as indicated by the docs - http://docs.djangoproject.com/en/1.2/ref/django-admin/#djadmin-runserver If you really do want to override it, start the server like this - python manage.py runserver 0.0.0.0:8000 That tells the dev server to accept any IP. If I were you, I'd just set up IIS/Apache. There's no advantage of accessing your dev server from elsewhere anyway, because you can't see the debug messages. On 6 June 2010 10:32, John Yeukhon Wongwrote: > For my home purpose, currently I am running Windows XP. > > I have everything ready. Django, Python are all good. > > If I let the runserver (I am using the django-development server) to > be 127.0.0.1:8000 or 192.168.1.101:8000 they all worked. > > Let say abc.no-ip.org is a FREE DNS service I use to access > externally. > > In the past when I did this in debian or ubuntu, there was no access > issue except the fact that I enabled either multi-cast or NET > Redirection in my router firewall setting. > > I checked my router setting so many times and nothing suspicious. > > I even tried like 192.168.1.101:8080 0.0.0.0:8080 in the runserver > command and no luck. > > I still cannot access to abc.no-ip.org > > How come? > > 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. > > -- 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
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.
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 Vangelovskiwrote: > 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
Sir , i am not able to remove this error.. which of template or file name is wrong.. On Jun 5, 5:09 pm, Kenneth Gonsalveswrote: > 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.
Model question on subclass and parent class.
I have a question on django model. I want to create a magazine model that allow admin to add gadget, sport articles. And there are classes for gadget, sport and food for adding only that specific article. How to model this? I read through one to one field and many to many field. I just could not get the magazine model right. Please guide. Magazine - sport (tennis) - food (fast food) - sport (swimming) - food (sushi) Sport - tennis (sportA, sportC) - swimming (sportB, sportC) Food - fast food (foodA, foodB) - sushi (foodB, foodC) class Food(models.Model): name = models.CharField(max_length=100) class FoodList(models.Model): title = models.CharField(max_length=30) foods = models.ManyToManyField(Food, blank=True) class Sport(models.Model): name = models.CharField(max_length=100) class SportList(models.Model): title = models.CharField(max_length=30) sports = models.ManyToManyField(Sport, blank=True) class Magazine(models.Model): sportList = models.OneToOneField(SportList) sportList = models.OneToOneField(SportList) -- 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 external access [Windows]
For my home purpose, currently I am running Windows XP. I have everything ready. Django, Python are all good. If I let the runserver (I am using the django-development server) to be 127.0.0.1:8000 or 192.168.1.101:8000 they all worked. Let say abc.no-ip.org is a FREE DNS service I use to access externally. In the past when I did this in debian or ubuntu, there was no access issue except the fact that I enabled either multi-cast or NET Redirection in my router firewall setting. I checked my router setting so many times and nothing suspicious. I even tried like 192.168.1.101:8080 0.0.0.0:8080 in the runserver command and no luck. I still cannot access to abc.no-ip.org How come? 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.
Cycle tag since 1.2
Hi all, I've decided to upgrade to 1.2 but have hit a stumbling block with the cycle tag. The release notes here http://docs.djangoproject.com/en/dev/releases/1.2/#stateful-template-tags say that because of the new thread safe template renderer that including another template whilst inside a loop means the included template doesn't know the state of the cycle tag. So I understand why this was done but I'm also trying to find a way to now make my templates work. I always put the HTML for table rows in their own template and then include them in the page template inside loops. This is because if I then need to create just a single table row then I have the template that does that. However I can't figure out now how to inform the included template which row class names to use as I've always used the cycle tag in the past. Has anyone else come up with a pattern to solve this? - Tom -- 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: TemplateDoesNotExist - even though the template is in the correct folder
I'm talking to myself here, but in case someone else runs into the same problem, I'll summarize the cause & solution I used (although it's only a hack, I don't know if it will work consistently): Cause: If you have Python installed through Cygwin on Windows, Django is using the Cygwin path, which messes up the templates directory path. Example: instead of "D:/django-projects/localsite/templates/ polls/index.htm", the path reads "/cygdrive/d/django-projects/ localsite/D:/django-projects/localsite/templates/polls/index.htm". Solution: Edit the following file: path\to\Cygwin\lib\python2.5\site-packages \django\template\loaders\filesystem.py 1) At the top of the file, add the line: import os.path 2) In function get_template_sources, change the following line: yield safe_join(template_dir, template_name) to the following: yield os.path.join(template_dir, template_name) This solved the issue for me. A better fix would be to make Django use Python directly through Windows, not through Cygwin, but I'm not sure how to set it up now that it's already installed. Cheers. On Jun 5, 5:40 pm, elysianfieldswrote: > Well, after inserting a number of debugging statements in loader.py > and filesystem.py, I found the cause of this; here's what the > filesystem.py Loader's load_template_source attempts to access: > > filepath=u'/cygdrive/d/django-projects/localsite/D:/django-projects/ > localsite/templates/polls/index.htm' > > So if you're using windows and have python installed through cygwin, > you have to edit the loader files a bit. By the way, I also have > python installed outside of cygwin and never realized that django > decided to use the cygwin python directory... I'm not sure if that can > be changed and how. Thoughts? > > On Jun 5, 4:16 pm, elysianfields wrote: > > > I did see a very similar post in this group, but it did not help me > > with my problem. I'm probably overlooking something simple, this is > > what I have: > > > # SETTINGS.PY: > > TEMPLATE_DIRS = ( > > "D:/django-projects/localsite/templates", > > ) > > > # POLLS/VIEWS.PY: > > from django.http import HttpResponse > > from localsite.polls.models import Poll > > from django.template import Context, loader > > > def index(request): > > latest_polls = Poll.objects.all().order_by('-pub_date')[:5] > > t = loader.get_template('polls/index.htm') > > c = Context({ > > 'latest_polls': latest_polls, > > }) > > return HttpResponse(t.render(c)) > > > THE FOLDER STRUCTURE: > > D:\django-projects\localsite\templates\polls\index.htm > > > Notes: > > - I also tried editing the admin template by creating D:\django- > > projects\localsite\templates\admin\base_site.html but changing that > > template did not affect the admin interface either. > > - I am running this on the django development server. The > > TemplateDoesNotExist error page is a result of trying to > > accesshttp://localhost:8000/polls/ > > - More info from the error page: > > > Request Method: GET > > Request URL: http://localhost:8000/polls/ > > Django Version: 1.2.1 > > Exception Type: TemplateDoesNotExist > > Exception Value: polls/index.htm > > Exception Location: /usr/lib/python2.5/site-packages/django/template/ > > loader.py in find_template, line 138 > > > Template-loader postmortem > > Django tried loading these templates, in this order: > > * Using loader django.template.loaders.filesystem.Loader: > > * Using loader django.template.loaders.app_directories.Loader: > > > Any suggestions would be appreciated. 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.
bigint + postgre (+ south) lacks sequence for primary keys
Hi, I have just migrated my project to Django 1.2.1 and changed some of primary keys to big integers (id = models.BigIntegerField(primary_key = True)). South migration (from scratch) went without any problems and I have also bigint id fields created on my database. The problem is that all my tests (related with models) crashed very loudly, After some investigation I figured out that there are no sequences created for my new id fields. Is this a bug in Django? South? Or maybe I did something wrong in this process? My setup is: Django 1.2.1 South 0.7.1 Postgre 8.3 -- 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 and android application
I would think that you need to be calling the Django url from an Android app that can handle the protocol used (e.g. http protocol). Django should talk to an Android, PHP, JSP, RoR, ASP.NET etc web app using urls and so on - and vice versa - as long as your Android app can make sense of and handle the response sent back from your Django app. > Firstlty, how to hit my Django server from android application If a user clicks a link in your Android app, the web server on your Django server will forward the request to your Django app. > Secondly, how to send back the results. The Django app will then do something with the data and send back a response object (for example, using http protocol) via the web server, to your Android app. Your Android app must then have the logic to handle the response and proceed. The web server is your middle man and takes care of sending requests and responses between your Android and Django apps. You will need to write the logic to handle the data shared between the apps. On Sat, Jun 5, 2010 at 10:24 PM, Jeliuc Alexandrwrote: > Hello, I've to do something similar... but application django connects > written for iphone... > I know nothing about android... > ideas xml or json... does it support these formats? > > On Jun 5, 11:18 pm, rahul jain wrote: > > Hi Django, > > > > I would like to create an android application which talks to Django. > > If I hit a url on my phone, it hits one of my views (urlconf), that > > view > > processes the request and give the result back to the android app. > > > > Anybody in the community have any knowledge how to proceed with it > > > > Firstlty, how to hit my Django server from android application > > > > Secondly, how to send back the results. > > > > Any tips, suggestions and design help will be appreciated. > > > > --RJ > > -- > 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. > > -- Regards, Sithembewena Lloyd Dube http://www.lloyddube.com -- 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: TemplateDoesNotExist - even though the template is in the correct folder
Well, after inserting a number of debugging statements in loader.py and filesystem.py, I found the cause of this; here's what the filesystem.py Loader's load_template_source attempts to access: filepath=u'/cygdrive/d/django-projects/localsite/D:/django-projects/ localsite/templates/polls/index.htm' So if you're using windows and have python installed through cygwin, you have to edit the loader files a bit. By the way, I also have python installed outside of cygwin and never realized that django decided to use the cygwin python directory... I'm not sure if that can be changed and how. Thoughts? On Jun 5, 4:16 pm, elysianfieldswrote: > I did see a very similar post in this group, but it did not help me > with my problem. I'm probably overlooking something simple, this is > what I have: > > # SETTINGS.PY: > TEMPLATE_DIRS = ( > "D:/django-projects/localsite/templates", > ) > > # POLLS/VIEWS.PY: > from django.http import HttpResponse > from localsite.polls.models import Poll > from django.template import Context, loader > > def index(request): > latest_polls = Poll.objects.all().order_by('-pub_date')[:5] > t = loader.get_template('polls/index.htm') > c = Context({ > 'latest_polls': latest_polls, > }) > return HttpResponse(t.render(c)) > > THE FOLDER STRUCTURE: > D:\django-projects\localsite\templates\polls\index.htm > > Notes: > - I also tried editing the admin template by creating D:\django- > projects\localsite\templates\admin\base_site.html but changing that > template did not affect the admin interface either. > - I am running this on the django development server. The > TemplateDoesNotExist error page is a result of trying to > accesshttp://localhost:8000/polls/ > - More info from the error page: > > Request Method: GET > Request URL: http://localhost:8000/polls/ > Django Version: 1.2.1 > Exception Type: TemplateDoesNotExist > Exception Value: polls/index.htm > Exception Location: /usr/lib/python2.5/site-packages/django/template/ > loader.py in find_template, line 138 > > Template-loader postmortem > Django tried loading these templates, in this order: > * Using loader django.template.loaders.filesystem.Loader: > * Using loader django.template.loaders.app_directories.Loader: > > Any suggestions would be appreciated. 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: Queryset filtering based on user supplied callable??
Thank you very much :-) Joakim On Jun 5, 4:42 pm, johan de taeyewrote: > Typo... > The correct syntax is : > obj_list = [ i for i in MyObject.objects.all() if my_filter(i) ] > > On Jun 5, 4:29 pm, johan de taeye wrote: > > > Possible through basic Python: > > > obj_list = [ i for i in MyObject.objects.all() where my_filter(i) ] > > > Note that this filtering is happening on the Python side of things, > > whereas a queryset filter is executed in SQL on the database. The > > filtering on the database is normally much, much faster, so be careful > > with the python-style filtering... > > > Johan > > > On Jun 5, 12:32 pm, Joakim Hove wrote: > > > > Hello, > > > > I have a query list which I want to filter based on a computation > > > which I supply: > > > > # Create a query set containing everything: > > > obj_list = MyObject.objects.all() > > > > # Now - select only the element which pass some test: > > > obj_list = obj_list.filter( my_filter ) > > > > def my_filter( obj ): > > > # Does a computation based on obj values, and returns true or > > > false > > > > > > return true|false > > > > Is something like this doable? > > > > Joakim- Hide quoted text - > > > - Show quoted text - -- 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.
searching by slug not working in cases with spaces (that really rolls off the tongue)
I am trying to capture the slug from a URL to search and find the object with that slug. Here is my URLconf: (r'^brewery/(\w+)', breweryDetail), It works when there are no spaces in the slug, but nothing comes up when there are. There are no errors just no results showing up. Here is my view code: def breweryDetail(request, brewerySlug): brews = Brew.objects.filter(brewerySlug__exact=brewerySlug) return render_to_response('brewery_detail.html', {'brews': brews}) Anyone have any ideas? -- 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 and android application
Hello, I've to do something similar... but application django connects written for iphone... I know nothing about android... ideas xml or json... does it support these formats? On Jun 5, 11:18 pm, rahul jainwrote: > Hi Django, > > I would like to create an android application which talks to Django. > If I hit a url on my phone, it hits one of my views (urlconf), that > view > processes the request and give the result back to the android app. > > Anybody in the community have any knowledge how to proceed with it > > Firstlty, how to hit my Django server from android application > > Secondly, how to send back the results. > > Any tips, suggestions and design help will be appreciated. > > --RJ -- 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 and android application
On Sat, Jun 5, 2010 at 10:18 PM, rahul jainwrote: > Hi Django, > > I would like to create an android application which talks to Django. > If I hit a url on my phone, it hits one of my views (urlconf), that > view > processes the request and give the result back to the android app. > > Anybody in the community have any knowledge how to proceed with it > > Firstlty, how to hit my Django server from android application > > Secondly, how to send back the results. > > Any tips, suggestions and design help will be appreciated. > yep - hit android SDK :) All your questions concern programming android, not 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.
django and android application
Hi Django, I would like to create an android application which talks to Django. If I hit a url on my phone, it hits one of my views (urlconf), that view processes the request and give the result back to the android app. Anybody in the community have any knowledge how to proceed with it Firstlty, how to hit my Django server from android application Secondly, how to send back the results. Any tips, suggestions and design help will be appreciated. --RJ -- 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.
TemplateDoesNotExist - even though the template is in the correct folder
I did see a very similar post in this group, but it did not help me with my problem. I'm probably overlooking something simple, this is what I have: # SETTINGS.PY: TEMPLATE_DIRS = ( "D:/django-projects/localsite/templates", ) # POLLS/VIEWS.PY: from django.http import HttpResponse from localsite.polls.models import Poll from django.template import Context, loader def index(request): latest_polls = Poll.objects.all().order_by('-pub_date')[:5] t = loader.get_template('polls/index.htm') c = Context({ 'latest_polls': latest_polls, }) return HttpResponse(t.render(c)) THE FOLDER STRUCTURE: D:\django-projects\localsite\templates\polls\index.htm Notes: - I also tried editing the admin template by creating D:\django- projects\localsite\templates\admin\base_site.html but changing that template did not affect the admin interface either. - I am running this on the django development server. The TemplateDoesNotExist error page is a result of trying to access http://localhost:8000/polls/ - More info from the error page: Request Method: GET Request URL:http://localhost:8000/polls/ Django Version: 1.2.1 Exception Type: TemplateDoesNotExist Exception Value:polls/index.htm Exception Location: /usr/lib/python2.5/site-packages/django/template/ loader.py in find_template, line 138 Template-loader postmortem Django tried loading these templates, in this order: * Using loader django.template.loaders.filesystem.Loader: * Using loader django.template.loaders.app_directories.Loader: Any suggestions would be appreciated. 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 with Apache and mod_python
Jagdeep Singh Malhi wrote: > MOD_PYTHON ERROR > please help... use mod_wsgi, mod_python is old and not more mantained http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi -- ()_() | That said, I didn't actually _test_ my patch. | + (o.o) | That's what users are for! | +---+ 'm m' | (Linus Torvalds) | O | (___) | raffaele dot salmaso at gmail dot com | -- 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
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: Latest wisdom on 'small migrations'
ah. forgot about the plain text in Google Groups... apologies. Again, in English: Given that Syncdb won't ever issue an alter table command ('no such column'), that Schema Evolution is still in debate, that South is a bit of an overhead if all you want to do is add a field to an existing model - one column to a table, and that manually adding this to an existing database (e.g. sqlite which will add a column but not rename one) is a fiddle, how would you suggest the easiest way of adding one (overlooked) column to an existing table to enable a new field in an existing model when the database is already full of data? Given that gui database browsers are also in the picture (e.g. SQLite Manager for Firefox). -- 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.
Latest wisdom on 'small migrations'
Given that Syncdb won't ever issue an alter table command ('no such column'), that http://code.djangoproject.com/wiki/ SchemaEvolution">Schema Evolution is still in debate, that http://south.aeracode.org/;>South is a bit of an overhead if all you want to do is add a field to an existing model - one column to a table, and that manually adding this to an existing database (e.g. sqlite which will add a column but not rename one) is a fiddle, how would you suggest the easiest way of adding one (overlooked) column to an existing table to enable a new field in an existing model when the database is already full of data? Given that gui database browsers are also in the picture (e.g. http://www.google.co.uk/url? sa=t=web=1=0CB0QFjAA=https%3A%2F%2Faddons.mozilla.org %2Fen-US%2Ffirefox%2Faddon %2F5817%2F=7qkKTLUcof7SBJbYlWM=AFQjCNEZtAsOR_YRbiExOgyBLR2vMS9bLw=6xf9OD42BXoV89b_tsqAPw">SQLite Manager for Firefox). -- 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.
Misbehaving queryset override in admin
Hello everyone, I have two models: PublicAccount and Order. I need to provide a link to filter Orders by PublicAccount. So, I added a field to the list display of my PublicAccount: def orders(self): return 'View' % \ (reverse('admin:orders_order_changelist'), self.pk) orders.allow_tags = True Here's my override for the Order queryset: def queryset(self, request): qs = super(OrderAdmin, self).queryset(request) public_account_id = request.GET.get('public_account_id', None) if public_account_id: qs.filter(public_account__id=str(public_account_id)) return qs What's happening is that the admin view is reloading. When I pass in the public_account_id= through the querystring, the queryset will get filtered as expected, but then the page immediately reloads and I end up with a parameter: ?e=1 in the querystring. If I print the qs variable, I get the result I expect, but then I get another unfiltered list. I have no other overrides in my OrderAdmin class. Does anyone know what's going on? TIA, Brandon -- 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 pass List to Form Meta Class
Hello All, I am newbie in django and I will very thankful to you if you help me in this regard. I want to pass list of fields from view to Meta class of FormModel. Please check this example. view.py: fields = [name, email, phone] individual_form = IndividualForm(fields) forms.py class IndForm(forms.ModelForm): class Meta: model = Ind fields = ( 'name', 'email', 'phone', ) I want to access view fields array into forms Meta class. I am not sure I can do this or not. Any idea! how can I do this? Regards, -- 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: How to share a session with a php application.
I want to add cometchat ( written in PHP ) in my djangoproject and I need to edit this function to get it work ( a function that return the userid of the user logged in ): function getUserID() { // I could use SESSION or other to get the user id fo the user logged in: if (!empty($_SESSION['userid'])) { $userid = $_SESSION['userid']; } return $userid; } How could I do that ? -- On Jun 5, 7:28 pm, Vasil Vangelovskiwrote: > Not directly. > > The session cookie stores the session id (session key). The session id > references data stored for the session in the django session backend. > The user for that session is contained in that data. So it really > depends on what the session backend is. So I'll assume it's the > default which is the database backend which keeps this data in the > django_session table, which has a column session_data which holds an > encoded (pickled) python dict with the session data, which I'm 99.99% > sure you can't decode directly from PHP, because it's a serialize > Python object. So if you can't access it directly from PHP you need to > open a service of some sort on your django application or anything > that's written in python that would give this data to the PHP > application, this service should be only accessed from the PHP app on > the serverside for good security. So it requires punching holes for no > special reason. Or is there something very special about this PHP > script that you can't do with 10-200 times less code in your django > application? > > On Sat, Jun 5, 2010 at 5:18 PM, nameless wrote: > > > Someone has telled me that I could share the user id ( from Django and > > PHP ) > > also throught a cookie. > > In your opinion what is the best way ? > > > Thanks ^_^ > > > - > > > On Jun 5, 4:01 pm, Vasil Vangelovski wrote: > >> set > > >> SESSION_COOKIE_DOMAIN=".mychatapp.com" > > >> this will make the django cookie valid both forwww.mychat.comand > >> chat.mychat.com > > >> On Sat, Jun 5, 2010 at 2:34 PM, nameless wrote: > >> > If the chat is in a subdomain ? > > >> > > > >> > On Jun 5, 2:05 pm, Vasil Vangelovski wrote: > >> >> It's possible if both of your applications are under the same domain. > >> >> see the SESSION_COOKIE_* settings variables > > >> >>http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-age > > >> >> You can then find the current user by the sessionid from the django_* > >> >> tables. > > >> >> On Sat, Jun 5, 2010 at 1:40 PM, nameless wrote: > > >> >> > I have a django blog project and a chat in PHP. > > >> >> > I need to share the id of the user logged in django > >> >> > ( request.user.id ) with the chat in PHP. > > >> >> > Is this possible ? > > >> >> > -- > >> >> > 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 > >> > 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 > > 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: How to share a session with a php application.
Not directly. The session cookie stores the session id (session key). The session id references data stored for the session in the django session backend. The user for that session is contained in that data. So it really depends on what the session backend is. So I'll assume it's the default which is the database backend which keeps this data in the django_session table, which has a column session_data which holds an encoded (pickled) python dict with the session data, which I'm 99.99% sure you can't decode directly from PHP, because it's a serialize Python object. So if you can't access it directly from PHP you need to open a service of some sort on your django application or anything that's written in python that would give this data to the PHP application, this service should be only accessed from the PHP app on the serverside for good security. So it requires punching holes for no special reason. Or is there something very special about this PHP script that you can't do with 10-200 times less code in your django application? On Sat, Jun 5, 2010 at 5:18 PM, namelesswrote: > > Someone has telled me that I could share the user id ( from Django and > PHP ) > also throught a cookie. > In your opinion what is the best way ? > > Thanks ^_^ > > - > > On Jun 5, 4:01 pm, Vasil Vangelovski wrote: >> set >> >> SESSION_COOKIE_DOMAIN=".mychatapp.com" >> >> this will make the django cookie valid both forwww.mychat.comand >> chat.mychat.com >> >> On Sat, Jun 5, 2010 at 2:34 PM, nameless wrote: >> > If the chat is in a subdomain ? >> >> > >> >> > On Jun 5, 2:05 pm, Vasil Vangelovski wrote: >> >> It's possible if both of your applications are under the same domain. >> >> see the SESSION_COOKIE_* settings variables >> >> >>http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-age >> >> >> You can then find the current user by the sessionid from the django_* >> >> tables. >> >> >> On Sat, Jun 5, 2010 at 1:40 PM, nameless wrote: >> >> >> > I have a django blog project and a chat in PHP. >> >> >> > I need to share the id of the user logged in django >> >> > ( request.user.id ) with the chat in PHP. >> >> >> > Is this possible ? >> >> >> > -- >> >> > 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 >> > 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. > > -- 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
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 Malhiwrote: > > 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. > > -- 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: How to share a session with a php application.
Someone has telled me that I could share the user id ( from Django and PHP ) also throught a cookie. In your opinion what is the best way ? Thanks ^_^ - On Jun 5, 4:01 pm, Vasil Vangelovskiwrote: > set > > SESSION_COOKIE_DOMAIN=".mychatapp.com" > > this will make the django cookie valid both forwww.mychat.comand > chat.mychat.com > > On Sat, Jun 5, 2010 at 2:34 PM, nameless wrote: > > If the chat is in a subdomain ? > > > > > > On Jun 5, 2:05 pm, Vasil Vangelovski wrote: > >> It's possible if both of your applications are under the same domain. > >> see the SESSION_COOKIE_* settings variables > > >>http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-age > > >> You can then find the current user by the sessionid from the django_* > >> tables. > > >> On Sat, Jun 5, 2010 at 1:40 PM, nameless wrote: > > >> > I have a django blog project and a chat in PHP. > > >> > I need to share the id of the user logged in django > >> > ( request.user.id ) with the chat in PHP. > > >> > Is this possible ? > > >> > -- > >> > 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 > > 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: Queryset filtering based on user supplied callable??
Possible through basic Python: obj_list = [ i for i in MyObject.objects.all() where my_filter(i) ] Note that this filtering is happening on the Python side of things, whereas a queryset filter is executed in SQL on the database. The filtering on the database is normally much, much faster, so be careful with the python-style filtering... Johan On Jun 5, 12:32 pm, Joakim Hovewrote: > Hello, > > I have a query list which I want to filter based on a computation > which I supply: > > # Create a query set containing everything: > obj_list = MyObject.objects.all() > > # Now - select only the element which pass some test: > obj_list = obj_list.filter( my_filter ) > > def my_filter( obj ): > # Does a computation based on obj values, and returns true or > false > > return true|false > > Is something like this doable? > > Joakim -- 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: How to share a session with a php application.
It's possible if both of your applications are under the same domain. see the SESSION_COOKIE_* settings variables http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-age You can then find the current user by the sessionid from the django_* tables. On Sat, Jun 5, 2010 at 1:40 PM, namelesswrote: > > I have a django blog project and a chat in PHP. > > I need to share the id of the user logged in django > ( request.user.id ) with the chat in PHP. > > Is this possible ? > > -- > 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: 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 Gonsalveswrote: > 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.
Re: Django with Apache and mod_python
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.
ModelAdmin save_model method not saving many to many relationship value
I have a Page model that uses the sites framework and I've added a save_model method on its admin class to check if the template or sites collections are empty. If they are, I want to populate them with default values. Why not do this in the model declaration? - I can't seem to populate a default for the template field in my model as it uses choices - I can't seem to populate a default for a many to many field as I have no idea how to :) For some reason, if sites are empty, saving obj does not save the value for sites? def save_model(self, request, obj, form, change): obj.save() changed = False if obj.template == '': changed = True obj.template = Page.TEMPLATE_CHOICES[0][0] if obj.sites.all().count() == 0: changed = True obj.sites.add(Site.objects.get(pk=settings.SITE_ID)) if changed: obj.save() -- 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 ORM memory leaks in standalone script
hello yakovenko sir, I think your databse_user and database_password are incorrect. I had affected by this problem. You will give correct username and password of mysql. On Sat, Jun 5, 2010 at 1:02 AM, tmitchellwrote: > Holy reading comprehension, Batman. Just saw you have DEBUG off, > ignore previous comment. > > On Jun 4, 10:34 am, Кирилл Яковенко > wrote: >> I have tried this method, but it didn't give any results. >> I suspect that this is due to incorrect settings of the database or connect >> to it. >> >> 2010/6/4 Dj Gilcrease >> >> >> >> > On Fri, Jun 4, 2010 at 6:44 AM, yakovenko wrote: >> > > import os >> > > import sys >> > > os.environ['DJANGO_SETTINGS_MODULE'] = 'md.settings' >> > > sys.path.append('/md/lib') >> > > from django.db import close_connection, reset_queries >> > > from md.mddata.models import Info >> > > def test(): >> > > for i in Info.objects.all(): >> > > pass >> >> > do >> >> > for i in Info.objects.all().iterator(): #or just .iterator() forget which >> >> > and you wont leak >> >> > -- >> > 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 > > groups.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. > > -- 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: hello django users, I have one doubt. I am doing one django project. It shows one SyntaxError in the line(if not created:) in views.py file.I attached the particular in that. I want the reason o
hello Karen Tracey sir, Thank you for your acknowledgement.I was corrected the problem. On Fri, Jun 4, 2010 at 6:31 PM, Karen Traceywrote: > On Fri, Jun 4, 2010 at 7:54 AM, kanniga sivasubramanian > wrote: >> >> If not created: > > Don't uppercase the I in if. > > 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. > -- 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.