Am I using static files "wrong"?

2012-10-04 Thread Micah Carrick
Regarding Django 1.4... I recently came across a post that suggests that the way I'm managing static files is "wrong". I wanted to make sure I'm clear on things. In development, static files are in the "static" folders both within apps at the project level. STATIC_URL = '/static/' When I deploy

Re: When is a good time to use db_index? Rule of thumb?

2011-09-15 Thread Micah Carrick
As an oversimplification.. any time you will be looking up a record based on a field, then you want an index on that (or those) fields. If you're finding a row based on a slug, you want to index that slug field. A good tool is to use the Django debug toolbar. When you load a page you can take a

Re: refreshing a page loaded via POST

2011-09-14 Thread Micah Carrick
After you successfully process a POST request, you can use a redirect to send the user back to the orginal page. On Wed, Sep 14, 2011 at 4:24 AM, Tom Evans wrote: > On Wed, Sep 14, 2011 at 8:12 AM, mohammed safeer.mtp > wrote: > > if a user hits

Using gedit for django development

2011-09-12 Thread Micah Carrick
I've written a blog post on using gedit, the default text editor in GNOME, as a Django IDE. If you're a Linux user and you've never considered using gedit for development then this may be an interesting read for you. http://www.micahcarrick.com/gedit-as-a-django-ide-for-linux.html -- You

Use of threading.local() ... what is the risk?

2011-09-10 Thread Micah Carrick
I have read https://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser and numerous other discussions about the use of threading.local() yet I still see it being employed in various projects. I have recently implemented a referral system in which the use of threading.local() makes the app

Django Projects in Gedit

2011-09-07 Thread Micah Carrick
For those of you working in GNOME 3 on Linux, I just put a new plugin up on GitHub for managing django projects from within Gedit. I haven't done much testing yet, so watch that repo for commits over the next few weeks while I'm working on a large Django project.

Re: Payment Gateways

2011-04-01 Thread Micah Carrick
No problem. ;) On Fri, Apr 1, 2011 at 4:17 AM, Venkatraman S <venka...@gmail.com> wrote: > > On Wed, Mar 30, 2011 at 12:19 AM, Micah Carrick <mi...@greentackle.com>wrote: > >> I have used Authorize.Net for years and don't have a single complaint. >> For Python/Dj

Re: DjangoCon US 2011

2011-03-31 Thread Micah Carrick
I was wondering about that too seeing as how I live in Portland. On Thu, Mar 31, 2011 at 11:49 AM, Vinicius Mendes wrote: > Hi, I am planing to go to DjangoCon US 2011 announced in this blog post: > http://www.djangoproject.com/weblog/2010/nov/22/djangocon-us-2011/ but >

Re: about url tag

2011-03-31 Thread Micah Carrick
You have created a "Named URL pattern". Check out: http://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns On Thu, Mar 31, 2011 at 9:50 AM, Lic. José M. Rodriguez Bacallao < jmr...@gmail.com> wrote: > well, I don't know if this is ok, but I solved the problem adding a >

Re: staticfile app question

2011-03-31 Thread Micah Carrick
I had to look up "grok". Guess I'm out of the loop. Anyway, one other pitfall with using absolute URLs in CSS is that you can break SSL (https) when you have common CSS for both the SSL and non-SSL pages. So watch out for that. IMO, relative URLs are preferable in external stylesheets. In fact,

Re: How to send emails?

2011-03-30 Thread Micah Carrick
You can setup gmail in your settings.py DEFAULT_FROM_EMAIL = 'your-email@your-domain' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'your-gmail-usern...@gmail.com' EMAIL_HOST_PASSWORD = 'your-gmail-password' And you can use the email_user() method of the

How to hire a freelance Django developer

2011-03-29 Thread Micah Carrick
Hey folks, Let me start by saying: Please don't email me your resume--this is not a job listing. That being said, I do need to hire python/django developers and system admins from time to time to help me out with projects or take something off my plate. Is there a good *free* resource to browse

Re: Payment Gateways

2011-03-29 Thread Micah Carrick
I have used Authorize.Net for years and don't have a single complaint. For Python/Django interfacing to Authorize.Net, Quantam, or PsiGate I use quix.pay, which I also wrote: http://pypi.python.org/pypi/quix.pay/ In testing quix.pay, I found that the Quantam gateway in authorize.net emulation

Re: Read-only fields and complex relationships in admin

2011-03-27 Thread Micah Carrick
Thank you Jacob. That's actually the answer I was hoping for. On Fri, Mar 25, 2011 at 8:48 PM, Jacob Kaplan-Moss <ja...@jacobian.org>wrote: > On Fri, Mar 25, 2011 at 6:39 PM, Micah Carrick <mi...@greentackle.com> > wrote: > > I have an application which handles a ty

Read-only fields and complex relationships in admin

2011-03-25 Thread Micah Carrick
I have an application which handles a typical "checkout" process for an e-commerce website. Orders from online customers end up in several models (order, billing/shipping address, line items, gateway data, shipments, etc.). An administrator will have to be able to (a) create new orders manually

Decoupling shopping cart from checkout

2011-03-16 Thread Micah Carrick
I have a Django app for a shopping cart, and another for checkout (checkout form, payment gateway, order processing). I would really like for these to be completely decoupled but am having a hard time coming up with a solution that gives me a warm fuzzy feeling. Here is a simplification:

Re: Can I sort a related model reference in a template?

2011-03-12 Thread Micah Carrick
Yeash. Don't know how I missed that. Thanks! On Sat, Mar 12, 2011 at 5:27 AM, Shawn Milochik wrote: > You can put a sort order in the model's meta info. That way you'll always > have a default sort. > > -- > You received this message because you are subscribed to the Google

Can I sort a related model reference in a template?

2011-03-12 Thread Micah Carrick
If I have a Product model which has a one-to-many relationship with ProductImage model... I can get the images in the template using product.productimage_set.all, however, is there any way to sort that or will I instead have to query the product images in the view? -- *Green Tackle* -

Re: Generate a unique username for django.contrib.auth

2011-01-12 Thread Micah Carrick
> odds of a collision is quite low. > > On Jan 12, 2011, at 1:11 PM, Micah Carrick wrote: > > > I've got my site's authentication working with and email and password > only--no username (thanks to Shawn Milochik for helping me with that). > However, I still need to put in a usernam

Generate a unique username for django.contrib.auth

2011-01-12 Thread Micah Carrick
I've got my site's authentication working with and email and password only--no username (thanks to Shawn Milochik for helping me with that). However, I still need to put in a username to make the User model happy. I was hoping to have "user" as a prefix and then some unique number. I cannot

Re: Email and activation key in django.contrib.auth

2011-01-12 Thread Micah Carrick
.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Micah Carrick, Founder

Re: Email and activation key in django.contrib.auth

2011-01-12 Thread Micah Carrick
s...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Micah Carrick, Fo

Re: Email and activation key in django.contrib.auth

2011-01-12 Thread Micah Carrick
ost to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google

Email and activation key in django.contrib.auth

2011-01-11 Thread Micah Carrick
long those lines. Any help would be much appreciated. Thanks! -- Micah Carrick, Founder *Green Tackle* - *Environmentally Friendly Fishing Tackle* www.GreenTackle.com <http://www.greentackle.com> Email: mi...@greentackle.com Phone: 971.270.2206 Toll Free: 877.5

Re: A Model to store links to other models

2010-11-22 Thread Micah Carrick
(): db_table = 'link_object' class LinkGroupInline(admin.TabularInline): model = LinkObject class LinkGroupAdmin(admin.ModelAdmin): inlines = [ LinkGroupInline ] admin.site.register(LinkGroup, LinkGroupAdmin) On Sat, Nov 20, 2010 at 5:17 AM, Micah Carrick <mi...@greentackle.

Re: A Model to store links to other models

2010-11-20 Thread Micah Carrick
I had not seen the generic relationships and ContentType. I'm going to play with that a bit. Thanks everybody! 2010/11/20 Łukasz Rekucki <lreku...@gmail.com> > On 20 November 2010 02:51, Micah Carrick <mi...@greentackle.com> wrote: > > I'm having trouble coming up w

A Model to store links to other models

2010-11-19 Thread Micah Carrick
I'm having trouble coming up with a pretty solution to a seemingly simple task. I'm relatively new to Django. I want to allow the end user to control various lists of links on the site used for navigation. The admin should allow the creation of "link groups" which have a collection of "links".