"select for update" with models
Hi, I'm new to Django -- looking to write a credit card transaction module and I need the ability to perform a "SELECT FOR UPDATE" (mysql) so that an order does not get processed by two different threads. I see an open ticket for this here: http://code.djangoproject.com/ticket/2705 Has anyone successfully used this code in a production environment? Any workarounds that people can think of? Greg -- 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.
virtual currency / check-in apps
Can anyone recommend any apps/tools for implementing either virtual currency or "check-ins" in Django? Thanks, Greg -- 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.
Deleting sessions without Request object
Is it possible to log out a user manually? The desired result is that after I do this, the user will be forced to log in again. I will not have an active Request object (ie, this will be done from the admin app or a management command, not a view). Can I simply add the Session table to the admin app and manually delete a user's entry? Thanks, Greg -- 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: Temporary group membership tally - Any clever way to do it?
Why not have a "user.membership_exp_date" field. If a user signs up on day 0, the membership_exp_date could be set to now() + 5 days. This will let you query the results in real-time. No cron job needed. On Thu, Jul 15, 2010 at 12:27 PM, Continuation wrote: > I have groups that users can join. > > The difference between this and "normal" groups is that membership is > temporary - a user decides on joining to be a member for 5 days, a > week, 2 weeks, etc (choices are pre-defined). Or potentially all > memberships could be set to be of the same length - say a week - if > that makes thing simpler. > > I'd like to have a running tally of the number of members of each > group. The number doesn't need to be accurate up to the last second. > But it can't be *too* out of date either - say, should be updated once > a day. > > The "obvious" way to calculate the number of members seems to be > running a cron job, say daily, and go through every member of every > group one by one. If a membership has expired, remove that member > from the group and decrement the group's membership count by 1. > > That approach seems very inefficient and not very scalable. With a > large number of groups, it could take forever. > > Can you think of a better way to do this? The membership counts do > not need to be accurate to the latest second. It can be approximate > and (slightly) out of date. Also if it makes a difference all > memberships can be set to be of the same length, say a week. > > -- > 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. > > -- Greg Pelly CEO / CTO, Munchly Inc. -- 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: What is a good source code control software?
This doesn't really have much to do with Django, but here is my 2 cents: If you have no experience with version control software, I'd recommend that you start with subversion. There are more advanced tools (git and mercurial being the favorites right now), but there is a steep learning curve if you are a beginner. I chose git for my company after using subversion for years, and I had to learn its nuances over time (ie, it was really frustrating at times). For a while you'll find yourself unable to do basic things (adding files, merging changes, making commits) when you encounter problems. If the danger of this sounds worse to you than the advanced features/benefits of a distributed VCS, go with subversion. If your team is highly tech savvy (perhaps they already know git/mercurial), then those may be better options, but it doesn't sound like that is the case (or they probably would have recommended one to you). I recommend finding an external host. They are cheap and you won't have to worry about hardware/backups/administration yourself. On Fri, Jul 16, 2010 at 4:56 PM, Hooshyar wrote: > Hello Django users, > > My Django-driven web application has grown fast and large enough and > more programmers are contributing code and UI components that I would > like to set up a source code management software. I would be glad if > you could share your experience as to what software I should use. I am > new to this task, so I would appreciate your pointers too. What to > look for? What the future expansion might compel me to adapt, etc. > > One of the first questions I thought I would need to address is > whether I should install the source code management software on our > dedicated server or use a hosted service? My immediate need is to > expedite development cycle, as more programmers are working on > different components and need to update the source code frequently. To > give you an idea of our development environment, we have pure Python > developers, Django developers, and we have UI/UX designers constantly > working on Django templates. We also have Javascript coders working on > various aspects of jQuery and our in-house developed Ajax > functionality. > > I am willing to pay a service provider and be up and running. But in > reality, is it how it is going to work out? In the category of hosted > services, I found one entity http://www.svnrepository.com (it seems it > is a public-facing web site to another destination > http://www.SourceRepo.com). > Has anyone experience with either of these? Or, would you recommend > the installation is really easy, if I install the software myself. > > My application is NOT open-source and will not become one in the > immediate future. It is a proprietary SaaS (software as a Service), > although for some reasons I prefer to call it a PaaS (Platform as a > Service). Either description, the final product will be proprietary > and we would like to protect our code. Would this imply a hosted > service is out of question? > > Thank you in advance. > > Regards, > Hooshyar F. Naraghi > > > > -- > 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. > > -- Greg Pelly CEO / CTO, Munchly Inc. -- 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: scaling my site
You will need to find/hire a sysadmin if you can't do this yourself. We looked into Amazon for our purposes and found their interface kludgy and their documentation confusing rather than helpful. Also, I kept a server running idle on Amazon for a month and it was more expensive than slicehost ($20/month), which we ultimately chose. In any event, it sounds like you should find a sysadmin to help you with these decisions/tasks. Greg On Fri, Jul 23, 2010 at 12:43 PM, Tony wrote: > I have just about finished all the logic for my site. In short, I > need the site to be pretty fast and a good amount of database storage > with the possibility of getting more in the future if and probably > when I need it. Right now I am just testing my website on my computer > with Django, (mod_swgi) apache and postgresql. I should also mention > I don't have the money right now to buy my own servers so I've been > looking into Amazon S3 and the computing cloud, EC2 but this is my > first time doing something like this so I don't know too much about > these things. Anyway, I'm looking for advice on the best way to set > this website up and I am leaning toward using amazon's features, but I > really need a lot more insight on how all that works. What database > server should I use? How does S3 and EC2 work? Should i use a web > host like web-lackey.com or something? I'm a little unaware on how to > put something into production and how everything connects. I accept > and appreciate any advice on the matter. > Thanks, > Tony > > -- > 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: generating random keys/passwords
have a look at Django Command Extensions: http://code.google.com/p/django-command-extensions/ sample usage: $ ./manage.py generate_secret_key xr7+43ak=i^2+ommc_e6xn$6vph)_$ffb$n3kp#o1!675euxdu Greg On Fri, Aug 13, 2010 at 3:32 PM, bagheera wrote: > Hi, i'm looking for python module to generate random strings used as > activation keys to being sent to newsletter subscribers in order to activate > their subscription. > Any suggestions? > > > -- > Linux user > > -- > 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: generating random keys/passwords
And to answer your more general question about email signups, have a look at Django Registration. It should have everything you need. http://bitbucket.org/ubernostrum/django-registration/wiki/Home On Fri, Aug 13, 2010 at 3:44 PM, Greg Pelly wrote: > have a look at Django Command Extensions: > http://code.google.com/p/django-command-extensions/ > > sample usage: > > $ ./manage.py generate_secret_key > xr7+43ak=i^2+ommc_e6xn$6vph)_$ffb$n3kp#o1!675euxdu > > Greg > > > On Fri, Aug 13, 2010 at 3:32 PM, bagheera wrote: > >> Hi, i'm looking for python module to generate random strings used as >> activation keys to being sent to newsletter subscribers in order to activate >> their subscription. >> Any suggestions? >> >> >> -- >> Linux user >> >> -- >> 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: Displaying images
try this: def math_form(request): return render_to_response('form.html', {}, context_instance=RequestContext(request)) greg On Thu, Aug 19, 2010 at 10:35 AM, Bradley Hintze < bradle...@aggiemail.usu.edu> wrote: > I am sorry. I am using render to response. > > #view.py > > def math_form(request): >return render_to_response('form.html') > > #base.html > > > > >{% block title %}{% endblock %} > > > > {% block header %}{% endblock %} >Please enter two numbers to add them. >{% block content %}{% endblock %} >{% block footer %} > >Thanks for visiting my site. >{% endblock %} > > > On Thu, Aug 19, 2010 at 1:11 PM, Javier Guerra Giraldez > wrote: > > On Thu, Aug 19, 2010 at 12:03 PM, Bradley Hintze > > wrote: > >> So do I create 'my_data_dictionary'? and whats in there? > > > > are you using render_to_response()? can't comment on your code if you > > don't show it > > > > -- > > Javier > > > > -- > > 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. > > > > > > > > -- > Bradley J. Hintze > Graduate Student > Duke University > School of Medicine > 801-712-8799 > > -- > 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. > > -- Greg Pelly CEO / CTO, Munchly Inc. -- 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: Displaying images
Are your settings properly set up? Can you confirm that you are able to print settings.MEDIA_URL in your view? MEDIA_URL defaults to the empty string, so that seems like the problem. Then, pass in the request context as I described previously. >From http://docs.djangoproject.com/en/dev/ref/templates/api/ If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every RequestContext will contain a variable MEDIA_URL, providing the value of the MEDIA_URL setting. Greg On Thu, Aug 19, 2010 at 10:54 AM, Bradley Hintze < bradle...@aggiemail.usu.edu> wrote: > Greg, that didn't do it :( > Thanks though :) > > On Thu, Aug 19, 2010 at 1:43 PM, Greg Pelly wrote: > > try this: > > def math_form(request): > > return render_to_response('form.html', > > {}, context_instance=RequestContext(request)) > > > > greg > > On Thu, Aug 19, 2010 at 10:35 AM, Bradley Hintze > > wrote: > >> > >> I am sorry. I am using render to response. > >> > >> #view.py > >> > >> def math_form(request): > >>return render_to_response('form.html') > >> > >> #base.html > >> > >> > >> > >> > >>{% block title %}{% endblock %} > >> > >> > >> > >>{% block header %}{% endblock %} > >>Please enter two numbers to add them. > >>{% block content %}{% endblock %} > >>{% block footer %} > >> > >>Thanks for visiting my site. > >>{% endblock %} > >> > >> > >> On Thu, Aug 19, 2010 at 1:11 PM, Javier Guerra Giraldez > >> wrote: > >> > On Thu, Aug 19, 2010 at 12:03 PM, Bradley Hintze > >> > wrote: > >> >> So do I create 'my_data_dictionary'? and whats in there? > >> > > >> > are you using render_to_response()? can't comment on your code if you > >> > don't show it > >> > > >> > -- > >> > Javier > >> > > >> > -- > >> > 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. > >> > > >> > > >> > >> > >> > >> -- > >> Bradley J. Hintze > >> Graduate Student > >> Duke University > >> School of Medicine > >> 801-712-8799 > >> > >> -- > >> 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. > >> > > > > > > > > -- > > Greg Pelly > > CEO / CTO, Munchly Inc. > > > > -- > > 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. > > > > > > -- > Bradley J. Hintze > Graduate Student > Duke University > School of Medicine > 801-712-8799 > > -- > 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. > > -- Greg Pelly CEO / CTO, Munchly Inc. -- 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.
Using Django to white-label sites for multiple clients
I'm looking to "white label" a site built using Django. For those unfamiliar with white-labeling, we would like my site (call it "Amazing Site") to be able to be customized by sponsors A and B. Customer A provides us with their header, footer, css, and we can do *basic* re-branding, in order to present the site as "A Amazing Site" (or B's Amazing Site). I have considered rolling my own by changing the base template. So instead of {% extends "base.html" %} I would pass in a variable from the view: {% extends site-base-template %} Have others tried this? Are there existing strategies? Perhaps a django app that takes care of this? Thanks, Greg -- 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.