e-commerce - credit cards
Hello all, Regarding Django and e-commerce - has anyone ever built a site that stores credit card information for delayed processing? In other words, the customer makes a purchase, but the Web site "remembers" their information for future purchases? If you have, what special considerations are there for security, storage in database, etc. Thanks in advance. -- 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 profiles
I figured this out - it was a silly error caused by the ordering of my URLconf for the profile app. URL I was using was triggering a different view. Thanks Bill and CrabbyPete for having a look. Appreciated! -- 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 profiles
Bill, I use that setting and I have tried different variations and the result is the same(error is still there): myproject.Profile myproject.profiles profiles.Profile On May 11, 7:29 pm, CrabbyPetewrote: > should be > > AUTH_PROFILE_MODULE = 'app_name.Profile' > > On May 11, 10:15 am, Bill Freeman wrote: > > -- 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 profiles
OK, I'm baffled. I must be missing something right in front of my face... I'm trying to create a form that will allow users to update their profiles. No matter what I try, I get a "User matching query does not exist." ...error. Below is the associated view, and the related model and form clases. Any help would be appreciated. VIEW --- @login_required def update_profile(request): try: myprofile = request.user.get_profile() except: up = Profile(user=request.user) up.save() myprofile = request.user.get_profile() if request.method == 'POST': form = ProfileUpdateForm(request.POST, request.FILES, instance=myprofile) if form.is_valid(): form.save() else: form = ProfileUpdateForm(instance=myprofile) return render_to_response('profiles/update.html', {'form':form, 'profile':myprofile}, context_instance = RequestContext(request)) MODEL --- class Profile(models.Model): # This is the only required field user = models.ForeignKey(User, unique=True) picture = models.ImageField(upload_to='img/profilepics/%Y%m%d/', blank=True, null=True) # The rest is completely up to you... favorite_band = models.CharField(max_length=100, blank=True) favorite_cheese = models.CharField(max_length=100, blank=True) lucky_number = models.IntegerField(null=True, blank=True) FORM --- class ProfileUpdateForm(ModelForm): class Meta: model = Profile -- 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: Grappelli - TinyMCE only works in Firefox
Thanks for the link, Patrick. Since I placed this post, we commented out that line in the init: browsers : "msie,gecko,opera" ...and it works in all browsers *except* IE7. I had tried "MSIE" for explorer, but not lower-case. We'll give that a whirl and see what happens. -- 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.
Grappelli - TinyMCE only works in Firefox
Hi All, We're using Grappelli in the admin of a Django site we're building. Weirdly, the TinyMCE text editor only shows up in Firefox. Has anyone else run into this? I've been scouring the Net and the TinyMCE wiki for clues but so far no luck. Any help would be greatly appreciated. TIA -- 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.
multi-language capabilities of Django/Satchmo
Hi All, I'm interested in finding out more about practical use of django's multi-language capabilities for international sites. Do any of you have experience with this? And can you point towards resources/apps etc. for utilizing these features? 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-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: Hosting for Django sites
Thanks to all! Very helpful. -- 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: Hosting for Django sites
Thanks guys. Very helpful. Confirming my research. We've been using Webfaction for a couple of sites to test drive them, and they come through w/flying colors. The only thing I'd like to see from them is 24/7 phone support (hey, I'm not asking for much, am I? ;-) -- 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.
Hosting for Django sites
Hi Folks, I'm wondering what people would recommend for hosting Django sites? I've read the blog posts; I'm wondering what the latest word on the street would be. We're talking about hosting multiple Django/Satchmo installs, possibly w/dedicated/managed servers. Among the leading contenders so far: - Webfaction - Media Temple - Rackspace Cloud/Slicehost Thoughts? TIA. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: how to make radio buttion selected as form is loaded
Reporting back on this one. I solved the problem, but perhaps there's a more elegant way of writing this. 1) Discovered that I was not in fact comparing like data types, so {% ifequal %} was bound to fail. (Pardon my newb-ness) 2) Once I fixed that problem, I ended up putting six ifequals together in the loop, so that the radio button would be checked if any one of the six possible selections in the "selections" list was equal: ... ... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: how to make radio buttion selected as form is loaded
> > Assuming that 'groupA' is a model field, there's no such property as > 'selections.groupA', because as you've stated, selections is a > queryset - ie a collection of model instances, not a single one. > > However in general you'd be better off using Django's forms framework, > which outputs fields for you with all the correct attributes selected. > -- > DR. selections is a single record, obtained this way... selections = Workshop.objects.get(user__username=request.user.username) I have no trouble accessing/printing the value of selections.groupA (or selections.groupB, etc.) unless I'm inside the "for" loop that displays the Workshops (I'd like to highlight the workshops that the user has selected). selections.groupA is the id for the Workshop they've selected. The basic Django form didn't give me the interaction I was looking for. I want people to use radio buttons to select one Workshop from among a group of five. (That gets submitted as their Group A selection). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
how to make radio buttion selected as form is loaded
Hi All, Pardon a newbie. I'm building a form that will display workshop selections a person has made. They'll be able to update their selections using this form. Selections are represented by radio buttons; I'm trying to make a radio button the "checked" option as I run through a loop, and nothing I try seems to work. I'm using {% ifequal %} primarily: TEMPLATE: --- ... {% for object in workshops %} ... {% endfor %} ... VIEW: - ... workshops = [a queryset] selections = [a different queryset] return render_to_response('workshops/form.html', { ... 'selections': selections, 'workshops': workshops, ... }, context_instance=RequestContext(request)) I can't seem to get the value of selections.groupA while inside the for loop; I can get it just fine anywhere else in the template. I may be barking up the wrong tree; I've scoured the Internet and the documentation to no avail. I would appreciate it if someone can point out what I'm missing and/or suggest an alternative. TIA -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django/Satchmo for Membership orgs (dues, event registration, etc.)
Can anyone show me any examples of Membership organizations that use Django/Satchmo for: * membership registration w/recurring billing for annual dues * events registration (like eventbrite type stuff) 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-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.
images in admin/change_list.html
I feel like I'm missing something obvious. Another set of eyes would be greatly appreciated. I'm trying to add an image to the change_list form in the admin. Doesn't seem to work. Here's a snippet I found that gets me most of the way there: (from models.py) def image_img(self): if self.image: return u'' % self.image.url_125x125 else: return '(test)' image_img.short_description = 'Image' image_img.allow_tags = True --- (from admin.py) class LibraryAdmin(admin.ModelAdmin): list_display = ['image_img', 'image', 'name', 'pub_date'] form = LibraryForm position_field = 'position' order_with_respect_to = 'category' Here is my full models.py: http://dpaste.com/156429/ TIA. -- 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.
UPS shipping module in Satchmo - help?
Hi all, Has anyone customized the UPS shipping module of Satchmo? Here's what we'd like to do: The customer wants UPS to give a quote for all products being shipped in one container (by default, b/c of the way Satchmo communicates w/ UPS, the quote is assumes each product will get shipped in *separate* packages). This issue is described in the last paragraph here: http://www.satchmoproject.com/docs/svn/shipping.html#ups Has anyone run into this and written code for this that they might be willing to share? Thanks in advance. So far, Satchmo/Django pretty much rock... -- 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: having multiple organizations use the same admin?
Did I say option "B"? I meant option 2. -- 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.
having multiple organizations use the same admin?
Hi All, I'd like to get an opinion from the django community on this one. Let's say I'm considering using a django app to be used by several counterpart organizations who cover different geographic regions. The sites could share content from the app, such as news, but they would each have separate and distinct staffs who may or may not cooperate on other matters. I could: 1 - use a single django app (and admin) and let Org A's staff edit all content, including that of Org B 2 - use a single app/admin but extend users and content so that Org A staff could only access/view/edit their own content 3 - build separate django apps that talk to the same database and use different SITE IDs to tag submitted content 4 - have completely separate apps/sites that use some sort of XML pull/ feed to grab data from the other site (this seems to defeat the whole purpose of Django) Have any of you ever done this sort of thing? I'm leaning towards option B, but that seems to limit the ability for an admin user to view/edit user accounts, since to give them access to manipulating users would give them the ability to alter users from other orgs, which may not be supported by a high enough level of trust among the participating org's. Thanks in advance. I appreciate your thoughts. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
how best to allow admin users to edit only one "site"
Hi all, Let's say I have a django app that feeds content to multiple sites. I have an admin user for "Site1" and an admin user for "Site2". I would like to set things up so that the guy from "Site1" can't see/edit the content for "Site2". What's the best way to set this up? Thanks for your help. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=.
Re: trouble w/images
Thanks Antoni, for the link to your code. I'll check it out. On Jun 20, 9:33 am, Antoni Aloy <antoni.a...@gmail.com> wrote: > Look at: > > http://code.google.com/p/appfusedjango/ > > You'll find some examples of uploading images both as an application > and batch mode. > > 2009/6/20 django_jedi <pemaq...@gmail.com>: > > > > > > > Hi Folks, > > > I'm having a devil of a time trying to get image uploading to work. > > What I'd like to do is simply upload and image. > > > This works with: > > > my_object = ImageTest.objects.create() > > > ...but if not with: > > > my_object = ImageTest.objects.get_or_create(user_id=7, > > image=imagepath) > > > Any ideas? > > > Alternatively, if anyone out there has a *simple* example of how to > > upload an image, I would appreciate knowing. Just want to get things > > off the ground. > > > My views.py is below. (The model is a simple 2-field model w/t/fields > > in question. "user_id" is not a Foreign Key to "User"). There is > > some hard-coding as I'm just testing right now. > > > Thanks in advance for any help you can offer. > > > = > > from PIL import Image > > > try: > > import cStringIO as StringIO > > except ImportError: > > import StringIO > > > #from django import newforms as forms > > from django import forms > > from django.conf import settings > > > from models import ImageTest > > > from django.shortcuts import get_object_or_404, render_to_response > > from django.http import HttpResponseRedirect > > from django.views.generic.simple import direct_to_template > > from django.core.urlresolvers import reverse > > from django.template import RequestContext > > from myproject.uploadtest.models import ImageTest > > > from django.core.files import File > > > import os > > > class ImageTestForm(forms.Form): > > """ > > Profile image upload form. > > """ > > image = forms.ImageField(widget=forms.FileInput()) > > > def my_view(request): > > if request.method == 'POST': > > form = ImageTestForm(request.POST, request.FILES) > > if form.is_valid(): > > handle_uploaded_image(request.FILES['image']) > > return HttpResponseRedirect('/') > > > else: > > form = ImageTestForm() > > > return direct_to_template(request, 'uploadtest/image_upload.html', > > {'image_upload_form': form}) > > > def handle_uploaded_image(i): > > # resize image > > imagefile = StringIO.StringIO(i.read()) > > imageImage = Image.open(imagefile) > > > # (width, height) = imageImage.size > > # (width, height) = imageImage.scale_dimensions(width, height, > > longest_side=240) > > > width = 200 > > height = 200 > > > resizedImage = imageImage.resize((width, height)) > > > imagefile = StringIO.StringIO() > > resizedImage.save(imagefile,'JPEG') > > filename = 'foo5.jpg' > > > # #save to disk > > imagefile = open(os.path.join('/tmp',filename), 'w') > > resizedImage.save(imagefile,'JPEG') > > imagefile = open(os.path.join('/tmp',filename), 'r') > > content = File(imagefile) > > > path = 'img/testupload/2009/06/20/' > > imagepath = path + filename > > > #my_object = ImageTest.objects.all() > > > #my_object = ImageTest.objects.get_or_create(user_id=7, > > image=imagepath) > > my_object = ImageTest.objects.create() > > my_object.image.save(filename, content) > > = > > -- > 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 -~--~~~~--~~--~--~---
trouble w/images
Hi Folks, I'm having a devil of a time trying to get image uploading to work. What I'd like to do is simply upload and image. This works with: my_object = ImageTest.objects.create() ...but if not with: my_object = ImageTest.objects.get_or_create(user_id=7, image=imagepath) Any ideas? Alternatively, if anyone out there has a *simple* example of how to upload an image, I would appreciate knowing. Just want to get things off the ground. My views.py is below. (The model is a simple 2-field model w/t/fields in question. "user_id" is not a Foreign Key to "User"). There is some hard-coding as I'm just testing right now. Thanks in advance for any help you can offer. = from PIL import Image try: import cStringIO as StringIO except ImportError: import StringIO #from django import newforms as forms from django import forms from django.conf import settings from models import ImageTest from django.shortcuts import get_object_or_404, render_to_response from django.http import HttpResponseRedirect from django.views.generic.simple import direct_to_template from django.core.urlresolvers import reverse from django.template import RequestContext from myproject.uploadtest.models import ImageTest from django.core.files import File import os class ImageTestForm(forms.Form): """ Profile image upload form. """ image = forms.ImageField(widget=forms.FileInput()) def my_view(request): if request.method == 'POST': form = ImageTestForm(request.POST, request.FILES) if form.is_valid(): handle_uploaded_image(request.FILES['image']) return HttpResponseRedirect('/') else: form = ImageTestForm() return direct_to_template(request, 'uploadtest/image_upload.html', {'image_upload_form': form}) def handle_uploaded_image(i): # resize image imagefile = StringIO.StringIO(i.read()) imageImage = Image.open(imagefile) # (width, height) = imageImage.size # (width, height) = imageImage.scale_dimensions(width, height, longest_side=240) width = 200 height = 200 resizedImage = imageImage.resize((width, height)) imagefile = StringIO.StringIO() resizedImage.save(imagefile,'JPEG') filename = 'foo5.jpg' # #save to disk imagefile = open(os.path.join('/tmp',filename), 'w') resizedImage.save(imagefile,'JPEG') imagefile = open(os.path.join('/tmp',filename), 'r') content = File(imagefile) path = 'img/testupload/2009/06/20/' imagepath = path + filename #my_object = ImageTest.objects.all() #my_object = ImageTest.objects.get_or_create(user_id=7, image=imagepath) my_object = ImageTest.objects.create() my_object.image.save(filename, content) = --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---