Re: About using Django Auth with my app, Auto saving the User

2011-03-19 Thread AJ
OK. I believe that the form is invalid. "if post_form.is_valid():" actually fails and it prints "not working". I am using the default form that Django creates from class PostForm(ModelForm): class Meta: model = Post Is it not good? On Mar 18, 10:10 pm, AJ wrote: > I

Re: django-admin-py?

2011-03-19 Thread Steve Holden
Last I looked (though it's been a,while) the Django install dropped django-admin.pt somewhere on the executable path. How did you install Django? Regards Steve On Mar 17, 2011 5:05 PM, "gh" wrote: > Hi > > I´m new to django and maybe this is a simple thing but I need some > advise what's wrong. >

Re: how to get csrf cookie in ajax app

2011-03-19 Thread Brian Craft
Yeah, I'm using that technique. It works fine once you have the cookie. My question was about how to get the cookie, which is not described well in the documentation. Manually calling get_token() in the view for the first ajax GET seems to be working. After that I can POST to other views. On Sat,

Re: Auto import files into database

2011-03-19 Thread Corey Farwell
So would it look something along these lines: from app.models import NewModel # parse csv data here meow = NewModel(whatever = parsedData) meow.save() Where should this script live? Is there a general place django developers keep these scripts? If I want this script to run every x minutes, would

Re: Auto import files into database

2011-03-19 Thread Shawn Milochik
I recommend creating a script that reads the CSV files then creates instances of your models from that data and saves them. This will ensure that your signals (if any) fire, and that any relationship or validation errors are known immediately, rather than breaking your application later. Shawn -

Auto import files into database

2011-03-19 Thread Corey Farwell
I have a folder of files that have CSV data that I want to import into the database of data that my Django app is using. I can import the data I want with the script manually using SQL commands but I feel like there is a much more Django/pythonic way. I know how to parse CSV files with python, just

Re: ModelChoiceField problems

2011-03-19 Thread vac
I had similar problem and i sort it out by overloading __init__ func of my form and change queryset method of a field (ModelChoiceField), i.e.: self.fields[depatment].queryset = self.fields[depatment].queryset.filter(company=selectedcompany) Maybe it will help You with finding right solution. On 1

orm: operations between models fields

2011-03-19 Thread maxi
Hi, Which is the better way to do this on orm language ? select filed1, sum(field2 * field3) from a_table group by field1 Thanks in advance. --- Maxi -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Slow Pagination with Inclusion Tags FAIL

2011-03-19 Thread Mazery Smith
Hello, I've got a couple questions here. The first one is kinda long. Sorry ;) 1. I'm using two custom inclusion tags for different styles of pagination in a project (takes_context=False). Each tag is registered to a different pagination template HTML. Therefore each tag hands-off a context to i

Re: how to get csrf cookie in ajax app

2011-03-19 Thread Matt Robenolt
This is actually something new coming in Django 1.3, and by default is requiring all AJAX request to define an X-CSRFToken header. Fortunately, they've written about how to do it here and provided a jQuery implementation: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax -- You recei

Re: Django in low memory environments

2011-03-19 Thread Matt Robenolt
Try nginx and uWSGI instead of fcgi. http://projects.unbit.it/uwsgi/ -- 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+

Re: images in a template

2011-03-19 Thread Sultan Imanhodjaev
The piece of code below from my own development stack ( r'^static/(?P.*)$', serve, {'document_root': '%s/../static' % (APPLICATION,)} ) On Sat, Mar 19, 2011 at 10:42 PM, Vladimir wrote: > Thank You, Sultan! > Search "django.views.static.serve" for Django 1.2 in > http://docs.djan

Re: images in a template

2011-03-19 Thread Vladimir
Thank You, Sultan! Search "django.views.static.serve" for Django 1.2 in http://docs.djangoproject.com/ gives nothing. I failed to get any from Your answer, because I'm a beginner, You see. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: has anyone forced django-contact-form to send the email from the contactor

2011-03-19 Thread shofty
just in case anyone else googles this anytime i chose the former approach so i need to change that attribute after the form is posted, cos until then we don't have the users email address. inside get_message_dict, line before returning message_dict message_dict['from_email'] = self.request.POST[

Re: images in a template

2011-03-19 Thread Sultan Imanhodjaev
Hello, Sometimes for unknown reason I've to use a small workaround while developing from django.views.static import serve and then just use serve itself url((r'^site_media/(?P.*)$', serve, {'document_root': settings.STATIC_DOC_ROOT}), 2011/3/19 Vladimir > Большое спасибо, Артем, за до

Re: images in a template

2011-03-19 Thread Vladimir
Большое спасибо, Артем, за добрый совет, сразу моя ошибка прояснилась! У меня есть Подробное руководство А.Головатого и Д.Каплан-Мосса (2010), и книга Дж.Форсье, П.Биссекса и У.Чана (2010). Руководство на сайте Django я тоже стараюсь читать вдумчиво. Не ожидаю, что за меня все сделают. Пока осваива

Re: images in a template

2011-03-19 Thread Vladimir
Thank You very much, Daniel ! I try to follow every advice of You and Mike. > So you put the image in the media directory. In a project directory 'galiontour' I created a subdirectory 'media' and placed 'galion.gif' into it. Index.html was placed into application level directory 'galion'. > Then

Re: What is the best server for Django

2011-03-19 Thread andreap
hi Nate, i want to give some services to my customers. I will sell a cms and my Suite(crm and more...) my customers can't see the code. what do you think about this choise ? Andrea On Mar 18, 9:33 pm, Nate Aune wrote: > I can't help you with your WebFaction questions, but I'd like to hear more

Re: images in a template

2011-03-19 Thread Vladimir
> unmatched parentheses `url((` should be `url(` Thank You very much, Mike! -- 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

Re: images in a template

2011-03-19 Thread Artem
Почемуб тебе сначала не разобратся как и что работает, и не задавать глупых вопросов, за тебя всеравно все не сделают. Почитай (вдумчиво) книжки и туторы по джанге, например мне сам больше помогла разобратся "Beginning Django E-Commerce [Jim McGaw] (2009)" -- You received this message because you

Re: images in a template

2011-03-19 Thread Mike Ramirez
On Saturday, March 19, 2011 05:37:04 am Vladimir wrote: > url((r'^site_media/(?P.*)$', 'django.views.static.serve', > {'document_root': settings.STATIC_DOC_ROOT}), unmatched parentheses `url((` should be `url(` Mike -- Program load too heavy for processor to lift. -- You receive

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 12:54:22 PM UTC, Vladimir wrote: > > Daniel, I understand that's a wrong idea to mix files of different > nature in one directory. I only showed that one and the same simple > (?) configuration: index.html plus image file does works when I call > index.html directly a

Re: images in a template

2011-03-19 Thread Vladimir
Daniel, I understand that's a wrong idea to mix files of different nature in one directory. I only showed that one and the same simple (?) configuration: index.html plus image file does works when I call index.html directly and doesn't work when I call it in Django style. Of cource, this is a resul

Re: images in a template

2011-03-19 Thread Vladimir
1. I have read this article before. I think this instruction teaches us how we can access files in this directory. My problem differs: I can't include this files into index.html. 2. I don't understand why shall I create STATIC_DOC_ROOT, MEDIA_ROOT is already exists. 3. I failed following this artic

Re: Template Tags and TemplateSyntaxError: - expected 'endblock' or 'endblock content'

2011-03-19 Thread Mazery Smith
So i figured out the with my inclusion tags pretty quick...the syntax error was generated within the page_tags.py b/c I had my registration "@register.inclusion_tag("pagination_links.html")" statement without the "@" decorater symbol Now my only question how this mistake bubbled up into a Template

Re: images in a template

2011-03-19 Thread Daniel Roseman
On Saturday, March 19, 2011 9:44:41 AM UTC, Vladimir wrote: > > It does not work. If I call index.html which contains > #title h1{ background-image: url(galion.gif); background-position: > left top; background-repeat: no-repeat; } > directly in web browser then image is displayed. > If I ca

Re: images in a template

2011-03-19 Thread Mike Ramirez
On Saturday, March 19, 2011 02:44:41 am Vladimir wrote: > It does not work. If I call index.html which contains > #title h1{ background-image: url(galion.gif); background-position: > left top; background-repeat: no-repeat; } > directly in web browser then image is displayed. > If I call it: > h

Re: images in a template

2011-03-19 Thread Vladimir
It does not work. If I call index.html which contains #title h1{ background-image: url(galion.gif); background-position: left top; background-repeat: no-repeat; } directly in web browser then image is displayed. If I call it: http://localhost:8000/index/ then image is not displayed. Note, for s

Re: Cost model field

2011-03-19 Thread Darren
Oops! Thankyou :) (tedious name for it though, although I do concede it's Python's invention.) On Mar 18, 9:29 pm, Kenneth Gonsalves wrote: > On Fri, 2011-03-18 at 17:57 -0700, Darren wrote: > > I want to store costs (prices) in my DB. The obvious field type is > > Integer, storing the cost in