Re: Problem template library loading
On Fri, Mar 12, 2010 at 11:37 AM, mrsource wrote: > I have plugged dlevercss application to my Django project. In local > environment (windows xp - python 2.6) I have no errors, but in public > server (Ubuntu linux- python 2.5 - WSGI container), I get this error: > " 'dlevercss_tags' is not a valid tag library: Could not load template > library from django.templatetags.dlevercss_tags, No module named > clevercss" > Sounds like the public server does not have clevercss installed. clevercss is imported by dlevercss_tags.py, and you'll get this error if that import fails. > The strange thing is that the template tag loaders try to load it from > django.templatetags module instead of his path. I placed dlevercss > module under site-packges folder and that path is included in the Path > variable as I can see from the Django debug output. > The error message is misleading. The Django code actually attempts to load tag libraries from any templatetags module found under every application listed in INSTALLED_APPS. dlevercss_tags.py was found, the problem is the import of clevercss inside it is failing. 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-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.
Self Join
I'm trying, without a great deal of success, to perform a simple self join using the django orm. I'm pretty sure the F() function is not the answer. I believe this only allows you to compare two field within the same model instance, not to compare fields within 2 instances of the same model. I want to do this - Model- class Account(models.Model): name = models.CharField(max_length=255) parent_account = models.ForeignKey('self', default=None, blank=True) SQL- SELECT account.*, parent.* FROM account LEFT JOIN account parent ON account.id = parent.parent_account This seems pretty basic, but I can't find any way to do it. 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.
File validation process
I would like some help in figuring out how to handle file validation in my application. I have a series of processing that I'd like to happen at various stages. Some of this validation might have to happen outside of Django itself, like using JavaScript in the actual form as the files that are to be uploaded can be quite large in size. For starters, I would like the extension of the selected file to be checked prior to submission. I have no experience with JavaScript but I take it that I can perform some sort of regex search there? I take it that this has been done before. Could some one point me in the direction of a clear and somewhat simple method of doing this with either a simple self-made script or one built-in to a library? If the filename passes validation, I want the form to be submitted BUT it would be great if there was some way to check the first few bytes of the file as it is being uploaded on the server-side. I should know that the first few bytes of a correct file look like and can do a regex search against a known list of strings. How does one check a file while it's being uploaded in Django? Also, how does one trigger and error or warning so that the upload stops and displays an error page to the user? I'm still pretty new to a lot of what Django provides as well as Python in general so please pardon me if this are well-documented and/ or know procedures. 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.
buildout and django
I tried using buildout to get some django eggs including django-page-cms which has a dependency on mptt svn trunk. How do you take a svn checkout and make an egg, then tell buildout to use that local egg? Or any other way to deal with that in buildout? John -- 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: Recording Django user/session/view requests back into a Django model
On Mar 12, 4:57 pm, Philip Zeyliger wrote: > Hi folks, > > I'd like to measure who's using my site and what views they're looking at. > Presumably, I'd do this with some middleware that stuffs request.user and > view_func into the database and then build some simple views to look at this > data. Has anyone seen a similar open-source Django plug-in for this? I > specifically would like to avoid anything third-party like Google Analytics, > because my application runs within a firewalled network environment. > > Cheers, > > -- Philip Look at the django-request project, which not only does this but also provides some nice graphs of hits and visitors. http://kylefuller.co.uk/projects/django-request/ -- 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-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: field specific error message
On Mar 12, 8:09 pm, Amit Sethi wrote: > How do you do field specific messages ... like for a Telephone Number , if > all characters are not digit send > message (no invalid ) . I have tried raising forms.ValidationError like > specified here (http://www.djangosnippets.org/snippets/337/) > > I have also tried changing forms.Form._errors ... it is this string that > seems to be used > by forms.Form._html_output to put errors in final html .. but still it does > not work for me can some one tell me how to do the above specified thing > > -- > A-M-I-T S|S http://docs.djangoproject.com/en/1.1/ref/forms/validation/#cleaning-a-specific-field-attribute -- 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-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: updating db records.
On Mar 12, 6:50 pm, Omer Barlas wrote: > 1. I have this problem with DB records. I get the record from the DB like > this; > > def bolgeTextProcess(request, bolge, edit=None): > [..] > if not errors: > try: > p = BolteText.objects.get(Id=edit) > except: > p = BolgeText() > p.TarihYarat=date.today().isoformat() > p.Durum=0 > [.] > > but when I save this instance it creates a new record instead of updating it. You are always encountering an error, because you have written "BolteText" rather than "BolgeText". This is why you should never use a bare except clause - if you had used "except BolgeText.DoesNotExist" you wouldn't have hidden your spelling error. > 2. When I request the records from DB, I have to rewrite the default values > one by one, doesn't django have a simple converter for this? All I want to > do is something like; > > convertToDefaults(BolgeText.objects.get(Id=edit) Sorry, not at all clear what you mean here. What would 'convertToDefaults' do? How do you need to rewrite default values? -- 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-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.
MySQLdb error: failed to map segment from shared object: Operation not permitted
Hello I'm trying to deploy django with mod_wsgi on a media temple. I have an error that says: TemplateSyntaxError: Caught ImproperlyConfigured while rendering: Error loading MySQLdb module: /var/tmp/.python_eggs/ MySQL_python-1.2.3c1-py2.4-linux-i686.egg-tmp/_mysql.so: failed to map segment from shared object: Operation not permitted I understand this happens when the user apache is running as doesn't have permission to write and execute whatever the PYTHON_EGG_CACHE directory is. In my .wsgi file I have the line: os.environ['PYTHON_EGG_CACHE'] = '/var/tmp/.python_eggs' (I noticed a lot of people suggested pointing this to /tmp, but that didn't work either). /var/tmp/.python_eggs is owned by apache:apache and when I try to access the page, I notice a mysql module directory is created inside .python_eggs directory. (If I delete it and load the page again, it's recreated) I'm able to import MySQLdb from python without any errors. Does any one have any suggestions about how to troubleshoot this? -- 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.
field specific error message
How do you do field specific messages ... like for a Telephone Number , if all characters are not digit send message (no invalid ) . I have tried raising forms.ValidationError like specified here (http://www.djangosnippets.org/snippets/337/) I have also tried changing forms.Form._errors ... it is this string that seems to be used by forms.Form._html_output to put errors in final html .. but still it does not work for me can some one tell me how to do the above specified thing -- A-M-I-T S|S -- 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: PyCharm IDE - Anyone using it yet
Joe Kueser wrote: > JetBrains has made it pretty clear that they are aiming to make > PyCharm a Python/Django IDE, meaning support for Django at its core, > not as a side-effect of their Python support, or as the result of a > 3rd party plugin, but built-in. So definitely worth keeping your eye > on. Awesome, just installed it, but... How do I run my test batch? I only rarely develop in-the-browser, and I never run a debugger. (I've been Pythoning since 2000.) With Komodo Edit, I can at least crow-bar a test run into the Run- Script command... And how many more decades do we have to wait until editors support testing as aggressively as debugging? -- Phlip http://penbird.deviantart.com/art/Uncle-Wiggily-Wants-You-156969773 -- 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.
Putting dictionary element according to another element's value
Hello everyone, I just can't solve a problem. I have an array of dictionaries each having random fields, and those fields are referenced in another variable, like this: something = { "headers": [{"name": "first", "value": "From"}, {"name": "two", "value": "To"}], "content": [{"first": "Alaska", "second": "Nebraska"}, {"first": "Iowa", "second": "Texas"}] } So I need to iterate through something["headers"] (for item.name as name in something["headers"]) and put relevant content like this: something["content"][name]. The problem is that dictionary is sent to template, and I don't know how to "select" an item from content where content[i].name is equal to the header's name in iteration. I tried this: {% for header in something.headers %} {% for element in something.content %} element.header {% endfor %} {% endfor %} It tries to take element["header"], and it is not correct. How do I solve this problem? -- Best regards, Rishat Muhametshin, technical writer Co BIT “Master”, Izhevsk, Russia http://friendfeed.com/rishatmuhametshin -- 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.
updating db records.
1. I have this problem with DB records. I get the record from the DB like this; def bolgeTextProcess(request, bolge, edit=None): [..] if not errors: try: p = BolteText.objects.get(Id=edit) except: p = BolgeText() p.TarihYarat=date.today().isoformat() p.Durum=0 [.] but when I save this instance it creates a new record instead of updating it. 2. When I request the records from DB, I have to rewrite the default values one by one, doesn't django have a simple converter for this? All I want to do is something like; convertToDefaults(BolgeText.objects.get(Id=edit) Thanks. -- Omer Barlas omer.bar...@gmail.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: Permissions help
Thanks raj, I'll give that a shot. On Mar 12, 11:11 am, raj wrote: > If you want to impose the restriction only upon delete through admin > interface, try to override modelAdmin's has_delete_permission() > method. Or else, model.delete(). > > On Mar 12, 8:37 pm, Brandon Taylor wrote: > > > I need to add a custom permission to only allow deletes on an object > > if it has a certain property and the user is in a specific group, and > > I need it to work in Django admin. > > 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.
Re: PyCharm IDE - Anyone using it yet
I'm using PyCharm on a daily basis. It's definitely alpha software, but still very usable. Their Django support is pretty limited right now, but gets a little better with each release. If you have your Django project set up in "The Standard Way™" it does a pretty good job. I don't, so there are quite a few bells and whistles I'm missing out on, but support for non-standard projects is underway. I've seen a few issues on their issue tracker closed over the past week or so that go toward supporting any Django configuration. JetBrains has made it pretty clear that they are aiming to make PyCharm a Python/Django IDE, meaning support for Django at its core, not as a side-effect of their Python support, or as the result of a 3rd party plugin, but built-in. So definitely worth keeping your eye on. http://youtrack.jetbrains.net/issues/PY If you are confortable with using alpha software for development, I definitely recommend PyCharm. If you want to wait until it's Django support is more robust, and it's more stable, wait until summer to try it. One thing I can definitely recommend staying away from with the current release (94.454) is the hg4idea plugin. It has worked fine with previous builds, but if I have that plugin installed with the 94.454 build it takes over my CPU for about 30 seconds every minute or two. Otherwise, thumbs up! Hope that helps... Joe On Mar 12, 8:32 am, MauroCam wrote: > Hi All, > > just discovered that JetBrains has recently recently a new IDE for > Python which specifically supports Django. > > Having tried to use Eclipse for the past year, I can honestly say that > I am desperate to find something new. > > Loads of people would trust their lives in Eclipse, but I just find it > too awkward to use with all the various plugins that you need to > install. But I don't want to start a debate on Eclipse (please!). > > So, anyone have any experience with PyCharm? > > 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: ellipsis is not safe, use ellipsis.__new__()
I have been getting this to, I'm running 1.2 beta Are you by any chance using the ldap backend? On Mar 1, 10:53 pm, Scot Hacker wrote: > I've been tracking trunk on 1.2 and recently started getting this > error when get_profile() is invoked: > > TypeError at /item/9/ > > object.__new__(ellipsis) isnotsafe,useellipsis.__new__() > > Request Method: GET > Request URL: http://127.0.0.1:8000/item/9/ > Django Version: 1.2 beta 1 SVN-12642 > > File "/Users/shacker/Sites/virtualenvs/domain.org/project/app/ > views.py" in item_view > 268. mylist = > get_object_or_404(List,profile=request.user.get_profile()) > > Commenting out the get_profile() call makes the problem go away. It > was working fine in previous builds. Anyone else seeing this? Should I > file a ticket or is this a red herring (maybe I have another problem > I'mnotseeing somewhere)? > > Thanks, > Scot -- 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: Permissions help
If you want to impose the restriction only upon delete through admin interface, try to override modelAdmin's has_delete_permission() method. Or else, model.delete(). On Mar 12, 8:37 pm, Brandon Taylor wrote: > I need to add a custom permission to only allow deletes on an object > if it has a certain property and the user is in a specific group, and > I need it to work in Django admin. > 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.
Recording Django user/session/view requests back into a Django model
Hi folks, I'd like to measure who's using my site and what views they're looking at. Presumably, I'd do this with some middleware that stuffs request.user and view_func into the database and then build some simple views to look at this data. Has anyone seen a similar open-source Django plug-in for this? I specifically would like to avoid anything third-party like Google Analytics, because my application runs within a firewalled network environment. Cheers, -- Philip -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Problem template library loading
I have plugged dlevercss application to my Django project. In local environment (windows xp - python 2.6) I have no errors, but in public server (Ubuntu linux- python 2.5 - WSGI container), I get this error: " 'dlevercss_tags' is not a valid tag library: Could not load template library from django.templatetags.dlevercss_tags, No module named clevercss" The strange thing is that the template tag loaders try to load it from django.templatetags module instead of his path. I placed dlevercss module under site-packges folder and that path is included in the Path variable as I can see from the Django debug output. -- 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: I need django-evolution app
Thanks friends, regards On Fri, Mar 12, 2010 at 10:28 AM, Shawn Milochik wrote: > South has become the dominant DB migration tool for Django. Have a go at > that. > > http://south.aeracode.org/ > > Shawn > > > -- > 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: Adding Fields To Querysets
the simplest method should work, perhaps you made a mistake early on which set you off on the wrong path? class Person(models.Model): name = models.CharField(max_length=100) def view_func(request): people = Person.objects.all() for person in people: person.calcs = [ 1, 2, 3 ] return render_to_response('people.html', { 'people':people }) {% for person in people %} {{ person.name }} {% for c in person.calcs %} {{ c }} {% endfor %} {% endfor %} - is this what you're after? Darren On Mar 11, 5:10 pm, wubble u wrote: > Hi All, > > I've been passing querysets to templates for looping through rows to > create tables / lists on the page... nice and easy... but I need to > perform calculations on these rows and pass them with the queryset so > I can loop through and display them along with the data from each row. > > I can't seem to find a way to add fields to the queryset, so I've > tried creating a list of lists/dictionaries manually, and adding the > data this way and then passing the list, but not having much luck here > either. > > Then I tried tackling it at the model level using managers and model > methods, but can't seem to access the data from the template. > > I'm from a .NET background so I'm used to populating datatables and > adding columns and moving them around nice and easily, so I guess I'm > probably just going about it the wrong way... > > Anyone got any ideas as to the pythonic way of accomplishing this? > > Cheers, > wubble u -- 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: SQL Server 2008 and django
Thanks for the info, glad there weren't any major issues that popped up that would derail this development path. Since we have a windows box that is hosting the DB I think we're going to run with mssql, it appears to properly handle the multi-db issue. On Mar 12, 1:26 am, David wrote: > As the stackoverflow link states, pyodbc is the most advanced sql > server library for python. Quite a few libraries use it like > sqlalchemy. If you are using Django on Linux, your only options are > django-pyodbc or use sqlalchemy outside of the Django ORM. If your > environment is on Windows, you can also use django-mssql. I am > currently using django-pyodbc on a project with Django 1.2b and I > can't exactly call django-pyodbc stable with multiple databases. In > testing, I didn't have any problems with django-pyodbc with Django > 1.1. > > On Mar 11, 8:29 pm, Sam Lai wrote: > > >http://stackoverflow.com/questions/842831/using-sql-server-with-djang... > > > Might help. No personal experience though. > > > On 12 March 2010 12:16, Nick wrote: > > > > I am working on a new project that has a Microsoft SQL Server 2008 for > > > storing data. Can I bind Python and Django with this DB? Are there any > > > performance issues involved? What sort of server configuration needs > > > to be done? > > > > This is for a job and so I can't really use something that's not been > > > tested and is reliable. > > > > Thanks in advance for any responses. > > > > Nick > > > > -- > > > 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.
Permissions help
Hi Everyone, I need to add a custom permission to only allow deletes on an object if it has a certain property and the user is in a specific group, and I need it to work in Django admin. Possible? I was thinking I might just override the template and remove the delete link, but permissions seems like the cleaner way to do it. 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.
Re: I need django-evolution app
South has become the dominant DB migration tool for Django. Have a go at that. http://south.aeracode.org/ Shawn -- 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: PyCharm IDE - Anyone using it yet
On 12 Mar 2010, at 15:32 , MauroCam wrote: > > Hi All, > > just discovered that JetBrains has recently recently a new IDE for > Python which specifically supports Django. > > Having tried to use Eclipse for the past year, I can honestly say that > I am desperate to find something new. > > Loads of people would trust their lives in Eclipse, but I just find it > too awkward to use with all the various plugins that you need to > install. But I don't want to start a debate on Eclipse (please!). > > So, anyone have any experience with PyCharm? I used to use IJ for Java development (and I always found it much, much better than Eclipse), so I'm giving a shot at PyCharm from time to time, though not on a Django project. In my opinion — PyCharm isn't usable yet (then again, if it were it'd be released already), but the team is reponsive to bug reports and the IDE improves leaps and bounds with each EAP release. Refactorings are not yet at parity with Rope (which I use in Ropemacs) by a long shot and there are quite a few bugs in the intentions (IJ's suggestions) and inspections (warnings & errors IJ displays when it doesn't like your code), but as I said above things are improving fast. Plus due to its history (WebIDE, RubyMine) IJ has quite damn good HTML and JS support, which is a plus if you're doing web-based stuff (as in, coding Django templates). The only real downside is that it's a java IDE, thus even if it's (in my opinion) better than Eclipse, it still tends to be dog slow. Other than that, don't hesitate giving it a shot from time to time, it's worth it. -- 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: local application source files checksum
Many thanks for the hint Jirka! Any other ideas? On 11 Mar, 17:16, Jirka Vejrazka wrote: > > The thing is: the application will get approved from an organization, > > and after that I have to avoid any kind of source edit, > > until another approval.. > > Hi, > > one option would be using proper permission for editing the source > code and Tripwire/AIDE for reporting on any unauthorized changes... > > Cheers > > Jirka -- 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: Exception Value: No module named urls
I finally fund the problem. A freelancer I have working on the site deleted a urls file in my api app. On Mar 11, 10:34 am, nerdydork wrote: > /home/inzolo/webapps/budgetsite/lib/python2.5 contains "django". That > is the only folder there. This is hosted on Webfaction. > > On Mar 11, 9:35 am, Xavier Ordoquy wrote: > > > > > Hello, > > > > /home/inzolo/webapps/budgetsite/lib/python2.5 > > > You probably want > > /home/inzolo/webapps/budgetsite/lib/python2.5/site-packages instead if it's > > a virtual env. > > > Xavier. -- 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.
I need django-evolution app
Hi friends, I'm trying to download django-evolution app, but I can't from Cuba. Could you send to me this app for this way? Please! Thanks, Sandra -- 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 execute erlang code ?
I wouldn't say it's the wrong approach, just makes things difficult using two application stacks side by side, unless your relying on existing code. On Sat, Mar 13, 2010 at 12:39 AM, nameless wrote: > The reason is that every tweet is sent and received in real time like > a web chat ( using ajax and long polling on client side ). > This is because I have chosen Erlang+Yaws+Mnesia. > Is it a wrong approach ? > > thanks. > > > On 12 Mar, 15:20, Dylan Evans wrote: > > That's difficult to say without specifics, but you should be able to > access > > your django database from erlang and reference the user table, or any > other > > required data. Likewise django/python can read any sql database tables > used > > with your erlang code, but probably not mnesia. > > You could also implement RPC style calls between the servers using XMLRPC > or > > something simpler. > > Is there a reason you want to use two different systems? > > > > > > > > > > > > On Fri, Mar 12, 2010 at 7:41 PM, nameless wrote: > > > you right Dylan... maybe is better put erlang code on another > > > webserver. > > > If I use iframe How could I share users information ( on django > > > table ) with erlang ? > > > ie if I send a tweet, and that tweet is stored on erlang webserver > > > ( Mnesia ) then I have to connect that tweet with a certain user. > > > > > excuse me this is very newbie question but I never used 2 webserver > > > with 2 program languages :-\. > > > > > - > > > On 12 Mar, 07:29, Dylan Evans wrote: > > > > I would suggest running your erlang on another webserver and either > using > > > an > > > > iframe or use django as a proxy (connect to erlang in your django > view). > > > > > > On Fri, Mar 12, 2010 at 1:02 PM, nameless > wrote: > > > > > Hi at all. > > > > > I need to create a blogging system with Django+Apache+Postgresql > and a > > > > > twitter-like app with Erlang+Yaws+Mnesia. > > > > > > > How can I execute erlang code through django views ? > > > > > > > -- > > > > > 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. > > > > > > -- > > > > "The UNIX system has a command, nice ... in order to be nice to the > other > > > > users. Nobody ever uses it." - Andrew S. Tanenbaum > > > > > -- > > > 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. > > > > -- > > "The UNIX system has a command, nice ... in order to be nice to the other > > users. Nobody ever uses it." - Andrew S. Tanenbaum > > -- > 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. > > -- "The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum -- 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 execute erlang code ?
The reason is that every tweet is sent and received in real time like a web chat ( using ajax and long polling on client side ). This is because I have chosen Erlang+Yaws+Mnesia. Is it a wrong approach ? thanks. On 12 Mar, 15:20, Dylan Evans wrote: > That's difficult to say without specifics, but you should be able to access > your django database from erlang and reference the user table, or any other > required data. Likewise django/python can read any sql database tables used > with your erlang code, but probably not mnesia. > You could also implement RPC style calls between the servers using XMLRPC or > something simpler. > Is there a reason you want to use two different systems? > > > > > > On Fri, Mar 12, 2010 at 7:41 PM, nameless wrote: > > you right Dylan... maybe is better put erlang code on another > > webserver. > > If I use iframe How could I share users information ( on django > > table ) with erlang ? > > ie if I send a tweet, and that tweet is stored on erlang webserver > > ( Mnesia ) then I have to connect that tweet with a certain user. > > > excuse me this is very newbie question but I never used 2 webserver > > with 2 program languages :-\. > > > - > > On 12 Mar, 07:29, Dylan Evans wrote: > > > I would suggest running your erlang on another webserver and either using > > an > > > iframe or use django as a proxy (connect to erlang in your django view). > > > > On Fri, Mar 12, 2010 at 1:02 PM, nameless wrote: > > > > Hi at all. > > > > I need to create a blogging system with Django+Apache+Postgresql and a > > > > twitter-like app with Erlang+Yaws+Mnesia. > > > > > How can I execute erlang code through django views ? > > > > > -- > > > > 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. > > > > -- > > > "The UNIX system has a command, nice ... in order to be nice to the other > > > users. Nobody ever uses it." - Andrew S. Tanenbaum > > > -- > > 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. > > -- > "The UNIX system has a command, nice ... in order to be nice to the other > users. Nobody ever uses it." - Andrew S. Tanenbaum -- 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.
PyCharm IDE - Anyone using it yet
Hi All, just discovered that JetBrains has recently recently a new IDE for Python which specifically supports Django. Having tried to use Eclipse for the past year, I can honestly say that I am desperate to find something new. Loads of people would trust their lives in Eclipse, but I just find it too awkward to use with all the various plugins that you need to install. But I don't want to start a debate on Eclipse (please!). So, anyone have any experience with PyCharm? 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: How execute erlang code ?
That's difficult to say without specifics, but you should be able to access your django database from erlang and reference the user table, or any other required data. Likewise django/python can read any sql database tables used with your erlang code, but probably not mnesia. You could also implement RPC style calls between the servers using XMLRPC or something simpler. Is there a reason you want to use two different systems? On Fri, Mar 12, 2010 at 7:41 PM, nameless wrote: > you right Dylan... maybe is better put erlang code on another > webserver. > If I use iframe How could I share users information ( on django > table ) with erlang ? > ie if I send a tweet, and that tweet is stored on erlang webserver > ( Mnesia ) then I have to connect that tweet with a certain user. > > > excuse me this is very newbie question but I never used 2 webserver > with 2 program languages :-\. > > > - > On 12 Mar, 07:29, Dylan Evans wrote: > > I would suggest running your erlang on another webserver and either using > an > > iframe or use django as a proxy (connect to erlang in your django view). > > > > > > > > > > > > On Fri, Mar 12, 2010 at 1:02 PM, nameless wrote: > > > Hi at all. > > > I need to create a blogging system with Django+Apache+Postgresql and a > > > twitter-like app with Erlang+Yaws+Mnesia. > > > > > How can I execute erlang code through django views ? > > > > > -- > > > 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. > > > > -- > > "The UNIX system has a command, nice ... in order to be nice to the other > > users. Nobody ever uses it." - Andrew S. Tanenbaum > > -- > 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. > > -- "The UNIX system has a command, nice ... in order to be nice to the other users. Nobody ever uses it." - Andrew S. Tanenbaum -- 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: character , HTML textfield, sqlite3
On Mar 12, 2:07 pm, gintare wrote: > If somebody knows how to answer my questions please let me know. It is > very urgent. I did let you know. Django takes care of this sort of thing for you, as long as you don't deliberately cripple it. > I will modify code by advice of Daniel as fast as i have time = > "never" :) That's your prerogative, of course. Let me know when you launch your site, I'm sure someone will hack it straight away by entering SQL commands in your textarea. -- 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-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: character , HTML textfield, sqlite3
If somebody knows how to answer my questions please let me know. It is very urgent. I will modify code by advice of Daniel as fast as i have time = "never" :) On Mar 11, 3:43 pm, Daniel Roseman wrote: > On Mar 11, 1:19 pm,gintare wrote: > > > > > Hello, > > > How to save special characters: å , ö, ä... > > > I tried to write them in browsers input field in several ways: > > å , ö, ä... > > \xc3\xa5 , \xc3\xa4, \xc3\xb6 > > > I am using sqlite syntax for saving > > from HTML tetxtarea > > to the sqlite3 database textfield: > > models.CharField(max_length=500, blank=True, default=''). > > > for i in range(len(Ltitles)): stLtit=stLtit > > +smart_unicode(Ltitles[i], encoding='utf-8', strings_only=False, > > errors='strict')+' , ' > > st2='INSERT into Ath_aref'+ ' ('+stLtit+') VALUES '+'('+stLq > > +');' ; print 'my_custom_sql st2=', st2 > > cursor.execute(st2); st2='' > > transaction.commit_unless_managed() > > > regards > >gintarestatkute > > 1. Why are you using custom SQL when Django takes care of this for > you? > 2. Why are you using bytestrings rather than Unicode strings? > 3. Why are you inserting POSTed data directly into database commands, > rather than using parameterized queries, leaving yourself open to SQL > injection? > -- > 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-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 execute erlang code ?
On 12/03/10 03:02, nameless wrote: Hi at all. I need to create a blogging system with Django+Apache+Postgresql and a twitter-like app with Erlang+Yaws+Mnesia. How can I execute erlang code through django views ? Well, one option I would seriously consider would be coupling through a message queue. A particularly well-known message queue is _implemented in_ Erlang - RabbitMQ: http://www.rabbitmq.com/ And unsurprisingly there are erlang bindings (rabbitmq-erlang-client, see also rabbitmq-erlang-client-examples for usage examples in erlang (and its "interesting" syntax...)) And it so happens on the django/python side there are the "carrot" bindings: http://pypi.python.org/pypi/carrot/ [Carrot is in turn used by the "celery" task scheduler to do its thing. http://ask.github.com/celery/ ] -- 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 execute erlang code ?
On Mar 12, 3:02 am, nameless wrote: > Hi at all. > I need to create a blogging system with Django+Apache+Postgresql and a > twitter-like app with Erlang+Yaws+Mnesia. > > How can I execute erlang code through django views ? WSGI to the rescue! http://packages.python.org/twod.wsgi/manual/embedded-apps.html -- 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.
Handling upload, adding M2M relation before saving object in admin form
Hi, For a client, I've got the following (simplified) models: class Document (models.Model): file = models.FileField() class Publication (models.Model): title = models.CharField() ... documents = models.ManyToManyField(Document) Publication can have several documents linked to it; my client wants to be able to add a document in the same Django admin form as the Publication; so instead of adding a document to the DB using the (popup) Document form, and then selecting it from within the Publication form, he wants an file upload box *in* the Publication add/ change admin form, so that when "Save" is clicked, before committing the Publication to the DB, the file selected is converted to a Document object, saved, and the ID of that Document is added to Publication.documents, after which the Publication is saved. I'm having a hard time thinking of a good 'clean' way to do this. I'm basically adding two objects from within one (Publication) form. How should I handle this? I've got a custom form, with a custom widget for Publication.documents, which adds a file upload box to the documents field in the Publication form, but how do I handle the document upload before the rest of publication's data is cleaned/validated? Ideally, when the "Save" button is clicked, I'd like some jQuery to check whether the file upload field is filled, and if so, upload the file, show a progress bar indicating the upload's status. Once the upload is finished, the file would be converted into a Document, and it would somehow 'magically' (magically, because I don't really know how this would work) return the new Document's ID, add it to the box, and the Publication form would happily get processed without any extra checks. Any ideas? Henry A. -- 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.
Custom Login Url Django Admin Site
Hi, is there a nice way to redirect the user to a custom login page when accessing a django admin site? I'm thinking about something like LOGIN_URL in settings.py. 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: Strange difference between runserver and shell
On Mar 11, 2010, at 11:56 AM, pyt...@roalddevries.nl wrote: I have the following model: 1 class MyOrderItem(models.Model): 2 orderitem = models.ForeignKey(OrderItem, null=True, blank=True) 3 # other fields 4 5 def save(self, *args, **kwargs): 6 if self.orderitem and self.orderitem.order: 7 orderitems = MyOrderItem.objects.filter(orderitem__order = self.orderitem.order) 8 # ... 9 super(MyOrderItem, self).save(*args, **kwargs) If I execute this from `python manage.py shell`, it works fine, and orderitems (line 7) is a list with 3 items. But if I execute it in a runserver-session, self is omitted from the list, and orderitems is a list with 2 items. It looks like self.orderitem hadn't been stored in the database yet. Moving line 9 to line 6 solves the problem. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: View on site
On 12 March 2010 01:04, Robert wrote: > There is a "View on site" link when you edit a user in admin. > > The link calls the url user/user_name but you have to make the url- > view configuration yourself apparently. > > I wonder if there is a "built-in" way to do this. I looked up an other > thread from 2006 that deals with the same question related to > "flatpages". The thread was started by Mary Adel. You may look it up > by searching with the keywords "View on site". > > It seems that the problem was solved by the recommendation: > > "Put (r'^r/', include('django.conf.urls.shortcut')), in your URLConf. > " > > This shortcut contains this line of code that seems to be on the right > track: > > (r'^(?P\d+)/(?P\d+)/$', > 'defaults.shortcut'), > > However django is not able to match this url. > > Is this supposed to work? > > Please advise. > > Thanks. > > Robert > > -- > 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. > > http://docs.djangoproject.com/en/dev/ref/models/instances/#get-absolute-url http://docs.djangoproject.com/en/dev/ref/contrib/sites/#how-django-uses-the-sites-framework -- 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.
possible bug or feature request with extra and where
HI all, I have a query: results = table1.objects.select_related('table2') plus adding some filter on it. Now I want to add en extra WHERE. So I do: where = 'asdf=12' results = results.extra(where=[where]) Now if I do a count() on that queryset, all related tables are omitted, that are not needed by the filter function for performance reason. But I want to reference such a table in my extra. The docs say: do not use the table property... My workaround for this is: add a (stupid) filter for the related table, I need. Now is there a way to force select_related tables any way in a count? regards Hinnack -- 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 execute erlang code ?
you right Dylan... maybe is better put erlang code on another webserver. If I use iframe How could I share users information ( on django table ) with erlang ? ie if I send a tweet, and that tweet is stored on erlang webserver ( Mnesia ) then I have to connect that tweet with a certain user. excuse me this is very newbie question but I never used 2 webserver with 2 program languages :-\. - On 12 Mar, 07:29, Dylan Evans wrote: > I would suggest running your erlang on another webserver and either using an > iframe or use django as a proxy (connect to erlang in your django view). > > > > > > On Fri, Mar 12, 2010 at 1:02 PM, nameless wrote: > > Hi at all. > > I need to create a blogging system with Django+Apache+Postgresql and a > > twitter-like app with Erlang+Yaws+Mnesia. > > > How can I execute erlang code through django views ? > > > -- > > 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. > > -- > "The UNIX system has a command, nice ... in order to be nice to the other > users. Nobody ever uses it." - Andrew S. Tanenbaum -- 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.