Re: no such table ERROR
On Mon, Sep 14, 2009 at 12:11 AM, AIM wrote: > > HI, > > When I browse to > http://127.0.0.1:8000/mysite/Start/ > > I get the following error: > > OperationalError at /mysite/Start/ > > no such table: wiki_page > > Request Method: GET > Request URL:http://127.0.0.1:8000/mysite/Start/ > Exception Type: OperationalError > Exception Value: > > no such table: wiki_page (ERROR HERE) > > My traceback is located at the following. > http://dpaste.com/93287/ > > I have ALREADY done the following in the EXACT order. > > [snip} > > --mysite/settings.py > > DATABASE_ENGINE = 'sqlite3' > DATABASE_NAME = 'wiki.db' > > [snip] > mysite>python manage.py syncdb > Creating table wiki_page > > [snip] > Then, I reboot my wsgi web server. > > What is your wsgi web server? Specifically, what current directory does it have when running? If it is not the same as your project directory where you are running the syncdb command, the web server won't be able to find the database file since you have not specified a fully-qualified path to it in settings.py. Karen --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Capturing Web Page data to a File
Hi, In my application I've opened a file and displayed its contents on the web page. Then I edit the same file on the web page. I have completed till this. Now I want to store the entire new contents which are currently on the web page back to some file. In short I need to capture the entire data contents on the web page into some file. So can anyone please tell me how this can be done?? Thank you in advance. Regards, Hrishikesh Dhayagude --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
no such table ERROR
HI, When I browse to http://127.0.0.1:8000/mysite/Start/ I get the following error: OperationalError at /mysite/Start/ no such table: wiki_page Request Method: GET Request URL:http://127.0.0.1:8000/mysite/Start/ Exception Type: OperationalError Exception Value: no such table: wiki_page (ERROR HERE) My traceback is located at the following. http://dpaste.com/93287/ I have ALREADY done the following in the EXACT order. --mysite/urls.py (r'^mysite/(?P)','mysite.wiki.views.view_page' ), --mysite/settings.py DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'wiki.db' INSTALLED_APPS = ( #'django.contrib.auth', DELETED 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django_extensions', 'mysite.wiki', ) --created these three tables in wiki.db mysite>python manage.py syncdb Creating table django_content_type Creating table django_session Creating table django_site --creates a wiki folder containing models.py and views.py mysite>python manage.py startapp wiki --mysite/wiki/models.py created a model from django.db import models class Page(models.Model): name = models.CharField(max_length="20",primary_key=True) content = models.TextField(blank=True) mysite>python manage.py syncdb Creating table wiki_page --wiki/views.py from mysite.wiki.models import Page from django.shortcuts import render_to_response def view_page(request, page_name): try: page = Page.objects.get(pk=page_name) except Page.DoesNotExist: return render_to_response("create.html",{"page_name" : page_name}) --mysite/create.html (NEVER MADE IT THIS FAR) {{page_name}} - Create {{page_name}} Then, I reboot my wsgi web server. Last I browse to http://127.0.0.1:8000/mysite/Start/ And, again last I get the following error: OperationalError at /mysite/Start/ no such table: wiki_page Request Method: GET Request URL:http://127.0.0.1:8000/mysite/Start/ Exception Type: OperationalError Exception Value: no such table: wiki_page My traceback is located at the following. http://dpaste.com/93287/ Any ideas? Thanks. Andre --~--~-~--~~~---~--~~ 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-admin.py the system cannot execute the specified program
On Sun, Sep 13, 2009 at 3:09 PM, about2flip wrote: > > I am learning django, and I am having doubts if it is worth it. I am > trying to startproject and I keep getting the system cannot execute > the specified program error at my command prompt. I would type: > > django-admin.py startproject name > > and then I get the error. I am using python 2.6, django 1.1 on XP SP2 > machine. > > Thanks for your help on what to do to fix this issue > > "Cannot execute the specified program" generally means the system can't find some DLL needed for the program. Django doesn't have any DLLs, so I suspect your python installation may be the cause of the problem. Can you run any python program? For example if you create a hello.py file with contents: print 'hello' Can you run it? Karen --~--~-~--~~~---~--~~ 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: Can all of unicode be slugified?
On Sun, Sep 13, 2009 at 8:25 PM, W.P. McNeill wrote: > Is this expected behavior? I can see some discussion on the web that > references unicode support for slugification, but I can't tell if that > unicode support works for any arbitrary unicode characters, or Django > has hand-crafted slugification for certain non-ASCII characters (e.g. > common European characters). When in doubt, look at the source. The 'slugify' template filter is implemented as, well, a template filter, and so lives with all the other built-in filters in django.template.defaultfilters: http://code.djangoproject.com/browser/django/trunk/django/template/defaultfilters.py#L222 It's easy to see from the code what's going on. A Unicode string comes in to the filter, and is normalized (using form NFKD) and encoded as ASCII, ignoring non-convertible characters. Then any character which is neither a space, a hyphen nor an alphanumeric character is stripped, as is leading and trailing whitespace. Finally, spaces are replaced with hyphens. The result is something which will be usable in a URL, regardless of the exotic characters which went into it. However, this does have the possibility of discarding information, in a couple of places. First, the Unicode normalization and ASCII conversion is important -- NFKD decomposes characters, and then the ASCII encode discards anything that can't be converted. So, for example, if the character 'ñ' is in the string, the NFKD normalization decomposes it into 'n' and a combining diacritic, and then the ASCII conversion with the 'ignore' flag discards the diacritic. For a URL, this is typically what you want, because it means 'ñ' becomes simply 'n'. The other place where you can lose characters is in discarding non-alphanumeric characters, but again for a URL this is typically what you want. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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: Is slugify available as a Django API call?
On Sun, Sep 13, 2009 at 9:07 PM, W.P. McNeill wrote: > the web, but this seems error prone. The right way to do it would > seem to be to use the slugify code that is already in Django. > What is the best way to slugify an arbitrary string using a Python > call? from django.template.defaultfilters import slugify -- dz --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Can all of unicode be slugified?
I am writing a Django application that uses characters from the International Phonetic Alphabet (IPA). I am trying to type the IPA characters into the admin interface and have Django automatically prepopulate a slug field. Django is ignoring the IPA characters. Is this expected behavior? I can see some discussion on the web that references unicode support for slugification, but I can't tell if that unicode support works for any arbitrary unicode characters, or Django has hand-crafted slugification for certain non-ASCII characters (e.g. common European characters). If the latter is the case, I will have to IPA slugs from something other than the IPA characters because these are probably too obscure to ever be included in Django API code. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Is slugify available as a Django API call?
I am going to populate the tables in my Django app from .CSV files rather than through the admin interface, so I am going to need a slugify Python function. I could write my own or pull a snippet from the web, but this seems error prone. The right way to do it would seem to be to use the slugify code that is already in Django. This code must be in there somewhere because there is a slugify template feature and the admin pages can prepopulate slug fields. However, I don't see a reference in the documentation to a slugify Python function that can be called from a Django app, and the fact that I can find lots of Django snippets online in which people are rolling their own slugify function makes me think that this function is not part of the Django API. What is the best way to slugify an arbitrary string using a Python call? --~--~-~--~~~---~--~~ 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: get current URL
El Sun, 13 Sep 2009 17:12:41 -0700 (PDT) Shuge Lee escribió: > How to get current URL ? http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path -- P.U. Gonzalo Delgado http://gonzalodelgado.com.ar/ pgpcJxfIZ1MCG.pgp Description: PGP signature
Re: Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?
Hi, First you should have an attribute "name" on your select. It's needed to pass the value when the form is submitted. If your select's name is "foos_combo", then your code you'll look like this: def foo_relatory(request): if request.method == 'POST': foos_combo = request.POST['foos_combo'] return HttpResponse(foos_combo) else: return render_to_response('foo_relatory.html', {'title' : title, 'show_filter_foos': True, }, context_instance=RequestContext(request)) HTH, --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Newbie: How to use object related to dropdown selection in django/javascript spaguetti code?
Hello, I'm a newbie struggling with a simple problem for some time now. I know it is a simple problem and it is a shame that I don't know how to solve it. I have a django spaguetti code that, instead of using forms, uses javascript functions to get a selection from a selection list (). Since I have some deadlines, I'm thinking on use request.POST (saw some about it on results from google), but I don't know when, where an how to use request.POST to get the selection and work on it on the view. Basicaly, there are a Foo class on Models.py And I need to get the selected "foo" object from the dropdown to, then, list data relatated to that foo in the same page. The relevants parts of the code are the following: >foo_relatory.html (template) {% if show_foos_filter %} Foo: {% for foo in foos %} {{ foo.nome }} {% endfor %} {% endif %}
get current URL
How to get current URL ? --~--~-~--~~~---~--~~ 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: Memory limits
It also depends on how OP deploys Django. Use embedding with mod_python or mod_wsgi, instead of daemon mode of mod_wsgi or fastcgi, then you can be setting yourself up for problems. Read: http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html Graham On Sep 14, 1:52 am, Peter Bengtsson wrote: > Hard to say as it depends on your app but can't you just run the app > on your laptop and see how much memory it takes up when you run some > basic stresstests. > Django is quite close to pure python but when you extract large lists > of model instance objects into lists it can push the memory > consumption. > > On Sep 13, 1:14 pm, Pablo Escobar wrote: > > > > > Hi > > i'm wondering what is memory consumption for django 1.1 + postgre. > > Will it be enough to have VPS with 256 MB of RAM as entry level for > > recent projects? > > > 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-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: Deploying with Apache: confused by odd PythonPath requirement
On Sep 14, 7:31 am, Dan06 wrote: > I've 'successfully' deployed django in a development environment on > Apache2. While, I've got it to work, I'm > thoroughly confused by the PythonPath setting needed for it to work. > > I don't understand why I need to give the directory that contains the > django 'project' AND the directory that contains the django > 'application' (see PythonPath below), since the directory that > contains the django 'project' also contains the django > 'application' (see directory structure below). > > Anyone know why I need to specify both 'project' and 'application' > directories? Because you haven't prefixed all your imports or module path references in urls.py with the name of the site. Graham > PythonPath "['/var/django_projects/', '/var/django_projects/test/'] + > sys.path" > > Directory structure: > > var/ > | django_projects/ <--- General directory for all django work/projects > | | test/ <--- Django project directory created by: django-admin.py > startproject test > | | | test_app1/ <--- Django app directory created by: python > manage.py startapp test_app1 --~--~-~--~~~---~--~~ 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 Project Management App
Cheers for the feedback folks. Just to be clear, my app doesn't handle code repositories or bug tracking at all - it's very much a one-user system at the moment. I actually just run it on my Macbook in a terminal (applescripted on startup). It's somewhat similar to basecamp I guess, albeit much simpler - per-project todo lists, time tracking, and invoice generation are pretty much all it can do for now. Anyway, once I've found some time to clean it up, I'll unleash it on the world and see what happens... Cheers, Greg 2009/9/11 Thomas Guettler : > > Greg schrieb: >> Hi all, >> >> Since I started with django a year or so ago, I've been gradually >> building a very simple project management app for myself - it started >> as a project to learn the language but has evolved into a very useful >> tool, handling all my timetracking, task management and invoicing. >> >> I'm wondering if it would be worth open sourcing it? > > Of course, do it. > >> Right now it's >> very much set up for me and me only, but it wouldn't take too much >> effort to make it a portable app that others could use. I've looked >> for django project management projects to use and/or contribute to, >> but there doesn't seem to be any out there. >> > > There is one. I searched for an alternative to trac some time ago. Basie > can handle several SVN-Repositories (Trac does not) and uses django. > > But I had to time to try it: > > http://basieproject.org/ > > Thomas > > > -- > Thomas Guettler, http://www.thomas-guettler.de/ > E-Mail: guettli (*) thomas-guettler + de > > > > -- http://gregbrown.co.nz/ --~--~-~--~~~---~--~~ 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: Editors of choice
After the hordes of happy Vim users around, I gave Vim another try. I've tried to set it up for Django around half an year ago, but finally gave up, and went back to heavy-lifting with Eclipse. Today, I got much further then before, so I'll post what I've found until now, and what I see as the main remaining problems. I would appreciate any help, but it might be another topic. My .vimrc file is at http://pastebin.com/f470926a I installed the following plugins: • django.vim: http://www.vim.org/scripts/script.php?script_id=1487 Usage: :setfiletype htmldjango • taglist.vim: http://vim.sourceforge.net/scripts/script.php?script_id=273 Usage: TlistOpen • tasklist.vim: http://www.vim.org/scripts/script.php?script_id=2607 Usage: \t • omnicomplete: http://blog.fluther.com/blog/2008/10/17/django-vim/ Usage Ctrl+Space • SnipMate: http://www.vim.org/scripts/script.php?script_id=2540 and SnipMate for django: http://github.com/robhudson/snipmate_for_django/tree/master Usage: Tab completion • xmledit.vim: http://www.vim.org/scripts/script.php?script_id=301 Usage: >, >>, % Moreover, created a ``djvim.sh`` to run vim with a given DJANGO_SETTINGS_MODULE set, this is specific to my usual development structure, so you might not like it, it's at http://pastebin.com/m3cd39bd5 What I miss / could not figure it out until now: • have django.vim syntax set for every html file by default • have shortcuts to run the server and unittest with optional django application inside vim • have shortcuts to other commands, like ``shell_plus`` • debugging with jump to code, especially when running ./manage.py test I really like how fast Vim is, and omnicomplete, SnipMate and Taglist made it comparable to Eclipse, while its syntax highlighting seems to be even nicer. Still, I really miss the possibility of running commands, especially django's tests, so if you have any ideas on this, please share it with me. Viktor On Sep 10, 3:50 pm, Sam Walters wrote: > Vim in conjunction with Git - most powerful + extensible editor out > there in my humble opinion. > > On Thu, Sep 10, 2009 at 7:46 PM, boyombo wrote: > > > Vim + pydiction + django.vim > > > On Sep 10, 1:31 pm, eka wrote: > >> Vim + RopeVim + Omincompletion + taglist + tasklist + python_fn > > >> On Sep 10, 8:30 am, slafs wrote: > > >> > Vim > >> > with omnicompletion (CTRL+X, CTRL+O), filetype=htmldjango, TList and > >> > NERDTree > > >> > Regards > > >> > On Sep 9, 9:31 am, Benjamin Buch wrote: > > >> > > I second that. > > >> > > > Vim > > --~--~-~--~~~---~--~~ 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: Development and deployment wit Git
2009/9/14 mr.tinn : > fyi http://delicious.com/tag/git+tutorial > have fun Once you have read the tutorial, I started my repo on the server, then git cloned it locally. When I finish doing any work locally, I git push it back up to the server. The reason I started it on the server first was because I'm behind a NAT so I don't have an external IP for my dev machine. Can be done either way though. > > On Sun, Sep 13, 2009 at 11:55 PM, orschiro wrote: >> >> Hello guys, >> >> I'm a single developer but since a VCS like Git has some really nice >> features, like the history, I want to use it for my webprojects I'm >> building up with Django. >> >> But there are still some points I don't understand. >> >> How do I have to set up Git? >> >> Where do I start the repository - on my local machine or on the >> server? >> >> I think it makes sense to have it on the local machine as I'm >> developing only for myself, but how do I get the project with its >> changes on my server? >> >> Very confusing. Thank you in advance. :) >> >> orschiro >> >> >> >> >> >> >> > > > > -- > This e-mail encoding with UTF-8 > > > > --~--~-~--~~~---~--~~ 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: Running Django on Tornado's HTTP server
2009/9/13 Bret Taylor : > > I am one of the authors of Tornado (http://www.tornadoweb.org/), the > web server/framework we built at FriendFeed that we open sourced last > week (see http://bret.appspot.com/entry/tornado-web-server). > > The underlying non-blocking HTTP server is fairly high performance, so > I have been working this weekend to get other frameworks like Django > and web.py working on Tornado's server so existing projects could > potentially benefit from the performance. To that end, I just checked > in change to Tornado that enables you to run any WSGI-compatible > framework on Tornado's HTTP server. You can find it in a class called > WSGIContainer in our wsgi.py: > > http://github.com/facebook/tornado/blob/master/tornado/wsgi.py#L188 > > You will have to check out Tornado from github to get the change; it > is not yet included in the tarball distribution. > > Here is a template for running a Django app on Tornado's server using > the module: > > import django.core.handlers.wsgi > import os > import tornado.httpserver > import tornado.ioloop > import tornado.wsgi > > def main(): > os.environ["DJANGO_SETTINGS_MODULE"] = 'myapp.settings' > application = django.core.handlers.wsgi.WSGIHandler() > container = tornado.wsgi.WSGIContainer(application) > http_server = tornado.httpserver.HTTPServer(container) > http_server.listen() > tornado.ioloop.IOLoop.instance().start() > > if __name__ == "__main__": > main() > > > I have only done very basic tests using the new module, so if any of > you are interested and start using Tornado with your Django projects, > please let us know what bugs you find so we can fix them. Any and all > feedback is appreciated. > We're acually using Cherrypy, so it would be quite easy to test and check the performance. We'll post any issues we found. Thank you! -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Deploying with Apache: confused by odd PythonPath requirement
I've 'successfully' deployed django in a development environment on Apache2. While, I've got it to work, I'm thoroughly confused by the PythonPath setting needed for it to work. I don't understand why I need to give the directory that contains the django 'project' AND the directory that contains the django 'application' (see PythonPath below), since the directory that contains the django 'project' also contains the django 'application' (see directory structure below). Anyone know why I need to specify both 'project' and 'application' directories? PythonPath "['/var/django_projects/', '/var/django_projects/test/'] + sys.path" Directory structure: var/ | django_projects/ <--- General directory for all django work/projects | | test/ <--- Django project directory created by: django-admin.py startproject test | | | test_app1/ <--- Django app directory created by: python manage.py startapp test_app1 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Running Django on Tornado's HTTP server
I am one of the authors of Tornado (http://www.tornadoweb.org/), the web server/framework we built at FriendFeed that we open sourced last week (see http://bret.appspot.com/entry/tornado-web-server). The underlying non-blocking HTTP server is fairly high performance, so I have been working this weekend to get other frameworks like Django and web.py working on Tornado's server so existing projects could potentially benefit from the performance. To that end, I just checked in change to Tornado that enables you to run any WSGI-compatible framework on Tornado's HTTP server. You can find it in a class called WSGIContainer in our wsgi.py: http://github.com/facebook/tornado/blob/master/tornado/wsgi.py#L188 You will have to check out Tornado from github to get the change; it is not yet included in the tarball distribution. Here is a template for running a Django app on Tornado's server using the module: import django.core.handlers.wsgi import os import tornado.httpserver import tornado.ioloop import tornado.wsgi def main(): os.environ["DJANGO_SETTINGS_MODULE"] = 'myapp.settings' application = django.core.handlers.wsgi.WSGIHandler() container = tornado.wsgi.WSGIContainer(application) http_server = tornado.httpserver.HTTPServer(container) http_server.listen() tornado.ioloop.IOLoop.instance().start() if __name__ == "__main__": main() I have only done very basic tests using the new module, so if any of you are interested and start using Tornado with your Django projects, please let us know what bugs you find so we can fix them. Any and all feedback is appreciated. Bret --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
django-admin.py the system cannot execute the specified program
I am learning django, and I am having doubts if it is worth it. I am trying to startproject and I keep getting the system cannot execute the specified program error at my command prompt. I would type: django-admin.py startproject name and then I get the error. I am using python 2.6, django 1.1 on XP SP2 machine. Thanks for your help on what to do to fix this issue --~--~-~--~~~---~--~~ 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: are you using mptt, treebeard or something else?
What about django-easytree? I'm tempting to try it. http://bitbucket.org/fivethreeo/django-easytree/overview/ On Sep 4, 6:30 am, Aljosa Mohorovic wrote: > On Sep 3, 5:51 pm, Sandra Django wrote: > > > Sorry, a cuestion because I don't understand.mpttrequires v1.1, but not > > SVN version? > > onlympttsvn trunk works with django 1.1 but i would like an official > release rather then trunk. > > Aljosa --~--~-~--~~~---~--~~ 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: Date Field in ModelForm
On Sep 9, 12:07 pm, mettwoch wrote: > Here is the definition of the field: > > date_due = models.DateField(auto_now_add=True) I'd guess that the problem is the auto_now_add. When that's set, the field is not editable (because the date can only be set at creation). So the field is by default excluded from the form - but you've explicitly stated you want that field showing, hence the error. So there is probably a bug, but the bug is that it should raise an explicit exception when you try and add a non-editable field to a form. -- DR. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
New Django-based open source project - CCI:U Open Course Labs
Hello, I'm going to introduce a new Django-based open source project. It is a web application that interfaces cloud-computing infrastructure as course labs which can be used by students and professors in universities. We are in still in very basic level, but with many people's contribution, I'm sure that it could grow as a mature project. See details here: http://code.google.com/p/cciu-open-course-labs/ --~--~-~--~~~---~--~~ 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: PyFacebook and python-twitter
On Sun, 13 Sep 2009 10:21:41 -0600 Adam Olsen wrote: > On Sun, Sep 13, 2009 at 9:54 AM, simba wrote: > > > > > I am looking for hosting that supports both of the above library. i > > have no idea on how to have these two libraries on shared hosting. > > Please Help!! > > > > I've got python-twitter installed on my webfaction account. I'm sure > it would be no trouble at all to install PyFacebook as well. Right, those are just libraries that provide API access over the existing HTTP connection. If python hosting is enabled then there will be no problems with those specific libraries. Asking customer service about support for such will only confuse them because it's an application level that's completely irrelevant to their service. Chris Babcock signature.asc Description: PGP signature
Re: Query with left join?
On 2009/9/13, tom wrote: > > I have a model to save measurement data. Every datarow has a > identifier(CharField) and a value(FloatField) and a entry(ForeignKey). > For example: > > Entry Identifier value > 1s1 100 > 1d1 180 > 1q5 300 > 2z88 10 > ... > ... > > With my query, i want to have as result: > > entry value value value > 1 100 180300 > > > So, my query gets every value for a entry in a row. This is a presentation issue, rather than a query one. You just want to get all the values, and group your output by entry id. So in your view you do: values = Value.objects.all().order_by('entry_id') and in your template: {% for value in values %} {% ifchanged value.entry_id %} {% value.entry_id %} {% endifchanged %} {% value.value %} {% endfor %} or something along those lines. -- DR. --~--~-~--~~~---~--~~ 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: Development and deployment wit Git
fyi http://delicious.com/tag/git+tutorial have fun On Sun, Sep 13, 2009 at 11:55 PM, orschiro wrote: > > Hello guys, > > I'm a single developer but since a VCS like Git has some really nice > features, like the history, I want to use it for my webprojects I'm > building up with Django. > > But there are still some points I don't understand. > > How do I have to set up Git? > > Where do I start the repository - on my local machine or on the > server? > > I think it makes sense to have it on the local machine as I'm > developing only for myself, but how do I get the project with its > changes on my server? > > Very confusing. Thank you in advance. :) > > orschiro > > > > > > > > > -- This e-mail encoding with UTF-8 --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Development and deployment wit Git
Hello guys, I'm a single developer but since a VCS like Git has some really nice features, like the history, I want to use it for my webprojects I'm building up with Django. But there are still some points I don't understand. How do I have to set up Git? Where do I start the repository - on my local machine or on the server? I think it makes sense to have it on the local machine as I'm developing only for myself, but how do I get the project with its changes on my server? Very confusing. Thank you in advance. :) orschiro --~--~-~--~~~---~--~~ 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: PyFacebook and python-twitter
On Sun, Sep 13, 2009 at 9:54 AM, simba wrote: > > I am looking for hosting that supports both of the above library. i > have no idea on how to have these two libraries on shared hosting. > Please Help!! > I've got python-twitter installed on my webfaction account. I'm sure it would be no trouble at all to install PyFacebook as well. -- Adam Olsen SendOutCards.com http://www.vimtips.org http://last.fm/user/synic --~--~-~--~~~---~--~~ 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: html template usage
Suppose you have a template called monster.html that looks like this: Company name Lorem ipsum Then, create a Django view and make it render a template called, say, home.html which you make to look like this: {% extends "monster.html" %} {% block title %}My Company!{% endblock %} {% block content %} Welcome to my website {% endblock %} Now, in the same directory as home.html you now need to turn your monster template into a Django template so change it to this: {% block title %}{% endblock %} {% block content %}{% endblock %} The rest is easy: Plain and simple reading of the Django docs and tutorial. On Sep 12, 8:19 pm, aftalavera wrote: > Hi there, > > All I need is a sample (if available) or a working example on how to use > an existing HTML template into the Django template system. Am I on the > wrong track integrating both? > > 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-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 -~--~~~~--~~--~--~---
PyFacebook and python-twitter
I am looking for hosting that supports both of the above library. i have no idea on how to have these two libraries on shared hosting. 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-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: filter on entries from a certain user
I dont know what db.UserProperty() is but my guess is that that's something related to the model. Your form doesn't understand that so it defaults to None. If you omit the field owner from the form, perhaps the form won't attempt to fiddle with this and then the model is allowed to do it's magic. Something like this: class ContactForm(forms.ModelForm): class Meta: model = Contact exclude = ('owner',) On Sep 13, 9:06 am, Peter Newman wrote: > Guys - > > I have > class Contact(db.Model): > person = db.ReferenceProperty(Person) > contact_date = db.DateTimeProperty(auto_now_add=True) > remarks = db.TextProperty() > owner = db.UserProperty(auto_current_user_add=True) > > and a simple form > class ContactForm(forms.ModelForm): > class Meta: > model = Contact > > but when i add a record owner remains None??? what am i doing 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-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: Memory limits
Hard to say as it depends on your app but can't you just run the app on your laptop and see how much memory it takes up when you run some basic stresstests. Django is quite close to pure python but when you extract large lists of model instance objects into lists it can push the memory consumption. On Sep 13, 1:14 pm, Pablo Escobar wrote: > Hi > i'm wondering what is memory consumption for django 1.1 + postgre. > Will it be enough to have VPS with 256 MB of RAM as entry level for > recent projects? > > 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-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: urls.py
On Sep 13, 1:35 pm, ramanathan wrote: > (r'^/(.+)/$','proj.register.views.activate') > Change to (r'^(.+)/$','proj.register.views.activate') (notice the removed forward slash in the beginning otherwise you have to expect the URL to be http://localhost:8000//90/ > (r'^(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/ramanathan/media/'}) > > These are the two lines in my urls.py file.. > > If i givehttp://localhost:8000/90/ it is matched > ashttp://localhost:8000/media/90/ insetad of getting redirected to > activate function in views.py file. > > Please Help me out. > > Regards, > Ramanathan M --~--~-~--~~~---~--~~ 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: post_save signal to create the new user profile
Signals or no signals I think your profile model is wrong. By making it a subclass of User you're effectively getting all the fields of the User model. Write your profile model like this instead: class Employee(models.Model): user = models.ForeginKey(User) address = models.CharField(...) ... On Sep 13, 1:12 pm, Dmitry Gladkov wrote: > Hi! > > I've got user profile, that uses multi-table inheritance: > > class Employee(User): > address = models.CharField(max_length=50, null=True, blank=True) > phone1 = models.CharField(max_length=15, null=True, blank=True) > phone2 = models.CharField(max_length=15, null=True, blank=True) > skype = models.CharField(max_length=32, null=True, blank=True) > website = models.URLField(null=True, blank=True) > comments = models.TextField(null=True, blank=True) > > When I create a new employee from django admin interface it creates a > new user for it, but how to manage to create a new blank employee > profile after creating a new user from django admin? > > I tried to use post_save signal for it, but have no idea how to create > a new employee when it's inherited from known user. > When i use "instance.employee" it says "Employee matching query does > not exist." > When i try to create new employee using Employee(user=instance).save() > it says that there's no field called "user". > 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-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: File Field max size and admin interface
One way of doing it, and to be honest the only one I know, is to set a limit in the fronting web server. In Nginx for example you add: client_max_body_size 10M; Sadly this means that if a user tries to upload a 11Mb file you won't be able to confront them with a user-friendly "error" message. On Sep 13, 3:44 pm, drakkan wrote: > Hi, > > I'm using the admin interface with some filefield, I tested with a big > file (200 MB) and it was successfully uploaded, this is ok but I would > like a way to limiting the uploaded size for example to a maximun of > 10 MB, any hints? > > thanks > drakkan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
File Field max size and admin interface
Hi, I'm using the admin interface with some filefield, I tested with a big file (200 MB) and it was successfully uploaded, this is ok but I would like a way to limiting the uploaded size for example to a maximun of 10 MB, any hints? thanks drakkan --~--~-~--~~~---~--~~ 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: Updating request.POST
On Sep 13, 6:38 am, koranthala wrote: > Hi, > I have the following scenario. > I am creating a custom admin page for one of the models. I am > adding few extra fields. If the extra fields are set, then the user > does not need to set the model fields. An example is given below: > > Model A: > val1 models.ForeignKey(A1) > val2 models.ForeignKey(A2) > val3 models.CharField() > > Form F: > val_x_1 forms.CharField() > > Now, on the add/change page for Model A, I am giving an option. It > would look like the following: > > Add A: > -- > val_x_1: [] > val2: [] > > OR > > val1: [] > val2: [] > val3: [] > > [Save] [Save and Add Another] > > The user can either type in val1, val2 and val3 or he can put in > values in val_x_1 and val2 only, and my custom add_view should take > care of everything. > > Now, the whole page is working fine. But, I am unable to update > request.POST to set up values for val1, val2 and val3 based on the > values val_x_1 and val2. I created a mutable copy and tried putting > that copy back to request.POST, but everytime I am getting the 'cant > adapt' error. The backend is PostgreSQL. > > If I dont update request.POST, the form.validate would fail inside the > proper add_view. I cannot make it as blank=True straightaway because > if the val_x_1 and val2 is not updated by the user, he needs to update > mandatorily val1, val2 and val3. > > Can anyone help me on this? Sorry for this question. There was a very foolish mistake from my part which caused this issue. I solved the same. Thank You. --~--~-~--~~~---~--~~ 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: Django1.1 logs me out after few seconds inactivity
Maybe it's that old bug: http://blog.umlungu.co.uk/blog/2007/may/20/cookie-problem-django-admin/ Server Upgrade to Lenny is planned in the near future, I hope the problem solves itself with the dist-upgrade. greetz, Florian --~--~-~--~~~---~--~~ 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: post_save signal to create the new user profile
Found My mistake, create parent_link: class Employee(User): user = models.OneToOneField(User, parent_link=True) address = models.CharField(max_length=50, null=True, blank=True) phone1 = models.CharField(max_length=15, null=True, blank=True) phone2 = models.CharField(max_length=15, null=True, blank=True) skype = models.CharField(max_length=32, null=True, blank=True) website = models.URLField(null=True, blank=True) comments = models.TextField(null=True, blank=True) Here is my signal: def user_post_save(sender, instance, **kwargs): Employee.objects.get_or_create(user=instance) models.signals.post_save.connect(user_post_save, sender=User) Now i get IntegrityError at /admin/auth/user/add/ column username is not unique On Sep 13, 3:12 pm, Dmitry Gladkov wrote: > Hi! > > I've got user profile, that uses multi-table inheritance: > > class Employee(User): > address = models.CharField(max_length=50, null=True, blank=True) > phone1 = models.CharField(max_length=15, null=True, blank=True) > phone2 = models.CharField(max_length=15, null=True, blank=True) > skype = models.CharField(max_length=32, null=True, blank=True) > website = models.URLField(null=True, blank=True) > comments = models.TextField(null=True, blank=True) > > When I create a new employee from django admin interface it creates a > new user for it, but how to manage to create a new blank employee > profile after creating a new user from django admin? > > I tried to use post_save signal for it, but have no idea how to create > a new employee when it's inherited from known user. > When i use "instance.employee" it says "Employee matching query does > not exist." > When i try to create new employee using Employee(user=instance).save() > it says that there's no field called "user". > 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-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 -~--~~~~--~~--~--~---
urls.py
(r'^/(.+)/$','proj.register.views.activate') (r'^(?P.*)$', 'django.views.static.serve', {'document_root': '/home/ramanathan/media/'}) These are the two lines in my urls.py file.. If i give http://localhost:8000/90/it is matched as http://localhost:8000/media/90/ insetad of getting redirected to activate function in views.py file. Please Help me out. Regards, Ramanathan M --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Memory limits
Hi i'm wondering what is memory consumption for django 1.1 + postgre. Will it be enough to have VPS with 256 MB of RAM as entry level for recent projects? 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-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 -~--~~~~--~~--~--~---
post_save signal to create the new user profile
Hi! I've got user profile, that uses multi-table inheritance: class Employee(User): address = models.CharField(max_length=50, null=True, blank=True) phone1 = models.CharField(max_length=15, null=True, blank=True) phone2 = models.CharField(max_length=15, null=True, blank=True) skype = models.CharField(max_length=32, null=True, blank=True) website = models.URLField(null=True, blank=True) comments = models.TextField(null=True, blank=True) When I create a new employee from django admin interface it creates a new user for it, but how to manage to create a new blank employee profile after creating a new user from django admin? I tried to use post_save signal for it, but have no idea how to create a new employee when it's inherited from known user. When i use "instance.employee" it says "Employee matching query does not exist." When i try to create new employee using Employee(user=instance).save() it says that there's no field called "user". 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-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: Zip multiple files into a zipped folder for download?
ok thank you guys! I'll test it out and see how it goes. BEst Regards, Eugene On Sep 4, 11:11 pm, Dj Gilcrease wrote: > Here is how I do ithttp://dpaste.com/89530/ > > I am using a View class that I wrote to make my life easier so it wont > directly translate to a standard view function but it should give you > enough details to get you started --~--~-~--~~~---~--~~ 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: How to server static media secured by Django authentication
Hi, There's a couple of ways to do this, but none of them is really as easy as using basic/digest authentication in apache. Most of the methods posted until now passes the static file through django or at least python, which might not be ideal depending on your performance requirements. Anyway, here are two more methods: 1) Use lighttpd with mod_secdownload (http://redmine.lighttpd.net/ projects/lighttpd/wiki/Docs:ModSecDownload). On the page there's an example how to do it with django. Basically you just generate a token, that only you django app and lighttpd server can generate. Bad thing with this method, is that you don't have constant URLs. 2) Use Apache + mod_auth_tkt. mod_auth_tkt is a lightweight module, that works nearly the same way as mod_secdownload. It just puts the token in a cookie and can associate some strings with it (like user/ group etc). Then in apache, you just use a htaccess file to protect your resources. Other more complicated things you can look at is single sign-on solutions for your webserver and django, but it usually starts to get really complicated. Cheers, Lars On Sep 11, 11:03 pm, Jim Myers wrote: > I have a requirement to serve static files only to users authenticated > through Django secure login. > That means I can't use apache basic/digest authentication for those > files. > > So far in my searches of the web and Django docs, I've found no way to > do this. > Of course my alternative is to serve ALL the static files through > Django but that's not very palatable. > > Have I missed anything? What is needed to make this work? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
filter on entries from a certain user
Guys - I have class Contact(db.Model): person = db.ReferenceProperty(Person) contact_date = db.DateTimeProperty(auto_now_add=True) remarks = db.TextProperty() owner = db.UserProperty(auto_current_user_add=True) and a simple form class ContactForm(forms.ModelForm): class Meta: model = Contact but when i add a record owner remains None??? what am i doing 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-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 -~--~~~~--~~--~--~---