Re: Where is the best place to get assistance installing Red Hat, Oracle and Django onto a VPN?

2015-06-10 Thread Kurtis Mullins
I would also recommend checking out Heroku for a quicker test release. Down the line, when you want more control over the system administration, you can save a bit of money by building out your own services. > On Jun 10, 2015, at 8:35 AM, Vijay Khemlani wrote: > > Wihtout knowing anything abou

Re: Terrible performance when dropping into raw SQL Oracle

2014-03-05 Thread Kurtis Mullins
Sort of off-topic as I don't have anything constructive to add to help fix your problem but I recommend not running complex (long-running) queries directly in Django views. Perhaps use Celery. I know this doesn't solve your problem (although it might help a bit if Django's environment is causing i

Re: html to odt

2013-11-22 Thread Kurtis Mullins
I'm not sure if I understand the problem correctly, but if you are wanting to serve HTML files rendered as ODT, you could take the following steps: 1. In your view, renderyour HTML 2. Use this library

Re: Disable "Password Upgrading"?

2013-05-16 Thread Kurtis Mullins
feels clumsy and I'm sure there's a better way. Your mileage may very. On Thu, May 16, 2013 at 7:06 PM, Kurtis Mullins wrote: > It took some digging but I believe I found the answer, just in case anyone > else comes across this problem. I'll post again after I've tested thi

Re: Disable "Password Upgrading"?

2013-05-16 Thread Kurtis Mullins
It took some digging but I believe I found the answer, just in case anyone else comes across this problem. I'll post again after I've tested this. https://github.com/django/django/blob/1.5.1/django/contrib/auth/hashers.py#L20 On Tue, May 14, 2013 at 6:05 PM, Kurtis wrote: > As per this documen

Re: Accessing django development server from internet!

2013-05-07 Thread Kurtis Mullins
You would need to make port 80 accessible from the internet. As mentioned, that's out of the scope of the Django User Group. To give you a little bit of help, I suggest searching for the terms "web server from home". That should get you started. On Tue, May 7, 2013 at 4:19 PM, Nikolas Stevenson-M

Re: FW:

2013-05-03 Thread Kurtis Mullins
Phishing Web Site (SPAM) On Sat, Apr 6, 2013 at 9:10 PM, Ian Foote wrote: > http://kyokushin-aoki.sakura.ne.jp/www/tvojdi.php > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails fro

Re: How many workers do you run on one machine using django celery?

2013-04-20 Thread Kurtis Mullins
Both Michael and Shawn are spot-on in terms of scaling and using the queuing. However, I'd like to add that 5 seconds to complete a single task like this seems way too slow to me. I don't have much experience with sending SMS but if you're using an external SMS API, it should be extremely quick. I

Re: Need Advice: Sending Emails

2013-04-12 Thread Kurtis Mullins
Check out sendgrid. If you use Rackspace I think they even give you a good discount. You could also just configure everything to use Google's SMTP. I've done that for quite a few projects. On Fri, Apr 12, 2013 at 12:19 PM, Tom Evans wrote: > On Fri, Apr 12, 2013 at 5:01 PM, Venkatraman S wrote

Re: Doubt regarding JSON/SQL in Django

2013-03-30 Thread Kurtis Mullins
If you don't use the ORM, Forms, and even the templating system you're losing quite a bit with Django. In my opinion, it's not worth using Django for those sorts of projects. While not a Python project, I found NodeJS & node-restify a good candidate for these types of applications. That's not a co

Re: Goodbye, Malcolm

2013-03-20 Thread Kurtis Mullins
R.I.P. On Wed, Mar 20, 2013 at 8:16 PM, Ray Loyzaga wrote: > Hi Jacob, > > Would you be able to email me regarding the future funeral arrangements for > Malcolm. > So far the family are looking at 4th April, in Sydney, but the time (and > the date), haven't been totally settled. > It would be g

Re: how to get data from other website after login on other sites through my site?

2013-03-15 Thread Kurtis Mullins
I am going to assume that you do not own, or otherwise have access to Coursera as a developer. After a quick search, I see they offer no API. Therefore, I don't believe there would be any "ethical" way of doing this. You could have a user login through your site as a sort of gateway but I don't bel

Re: How many developers have moved to class-based views?

2012-11-12 Thread Kurtis Mullins
John, My argument (or reason for switching) is it's DRY. Saves a lot of time and repetition in the long run ... at least in my experience. On the other hand, there are still perfectly good purposes for "function based views". On Mon, Nov 12, 2012 at 11:07 AM, John DeRosa wrote: > On Nov 11, 20

Re: How many developers have moved to class-based views?

2012-11-11 Thread Kurtis Mullins
I use them! On Sun, Nov 11, 2012 at 2:05 PM, Kevin wrote: > Wow, the dev docs are much more informative and actually explains the best > way to alter a form before saving it. I was using a different method, but > the method mentioned in the dev docs are much more cleaner than what I was > doin

Re: google app engine suggestion

2012-11-10 Thread Kurtis Mullins
Well for development purposes, I just recommend using Django's built-in "runserver" command. It will launch a relatively full-featured HTTP Server for testing on your own computer. The command is "python manage.py runserver" and you should be able to access it using localhost:8000 Otherwise, I thi

Re: How to crop image ?

2012-11-09 Thread Kurtis Mullins
The only thing I didn't like about easy-thumbnails is that it relied on generating them on the fly and caching them, if I remember correctly. While that's not totally horrendous, I was using a CDN and didn't want to use my Django Application to serve media. Note: I might be thinking of something el

Re: How to call a database function from Django?

2012-11-08 Thread Kurtis Mullins
I usually create management commands and call that. Here's the docs: https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ On Thu, Nov 8, 2012 at 2:41 PM, Andre Lopes wrote: > Hi all, > > I need to run a script once a day. The script basically will call a > postgresql function

Re: How to crop image ?

2012-11-08 Thread Kurtis Mullins
(However, I don't know of any ways to crop images before upload ... except maybe with Flash or Java) On Thu, Nov 8, 2012 at 1:25 PM, Kurtis Mullins wrote: > I've used JCrop in combination with a custom Django Form and PIL before. I > had good results. > > > On Thu, Nov

Re: How to crop image ?

2012-11-08 Thread Kurtis Mullins
I've used JCrop in combination with a custom Django Form and PIL before. I had good results. On Thu, Nov 8, 2012 at 8:09 AM, Gink Labrev wrote: > How to crop image before upload ? > I found this project: > https://github.com/jonasundderwolf/django-image-cropping, but it does not > work well. >

Re: compiler

2012-11-05 Thread Kurtis Mullins
You could use Lint to check your code for syntax errors. On Mon, Nov 5, 2012 at 4:18 PM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > I tried copy/pasting the code you linked into PyCharm and it worked fine. > Gotta be spacing/indentation somewhere. > > > _Nik > > On 11/5/2012 1:

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-30 Thread Kurtis Mullins
The easiest thing I've found to use is simply uWSGI with Nginx. It's easy to just create new Django servers on the fly. You simply include the IPs in a list and it will use various algorithms (optional) to distribute the requests appropriately. As a lot of applications are IO bound, you could also

Re: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Kurtis Mullins
The old rule of thumb is to avoid premature optimization. I'd build, profile, then scale or otherwise optimize as needed. This isn't a tutorial or really a discussion on all points of scaling a system; but identifying bottle necks will do wonders when it comes to deciding what, where, and how to sc

Re: Django Development Model

2012-10-28 Thread Kurtis Mullins
Hey, I'm not sure there is a specific Project Management (which to me implies Software Engineering) style that people use with Django. In my experience, using agile methodologies work great; You can quickly prototype your idea and enhance your product as needed. The tutorial, as others have menti

Re: Strange behaviour after pressing on button

2012-10-26 Thread Kurtis Mullins
Just to give you a hint, you'll need to do 2 things: 1. Use {% csrf_token %} in your view to generate the CSRF Token Form Field 2. Include the value and name from that Form Field in your Javascript Request #2 is much more a Javascript issue; not specific to django. although someone here may help

Re: Create table and load data

2012-10-12 Thread Kurtis Mullins
Whoops, sorry that was the master branch. Here you go: https://github.com/django/django/blob/1.4.1/django/core/management/commands/syncdb.py On Fri, Oct 12, 2012 at 4:24 PM, Kurtis Mullins wrote: > Good luck to you! The code is here if you want to start crawling through > it for a good po

Re: Create table and load data

2012-10-12 Thread Kurtis Mullins
PM, Kurtis Mullins > wrote: > > On Fri, Oct 12, 2012 at 2:09 PM, Larry Martell > > wrote: > >> > >> > >> So my client decided to use xml. I created the file and put it in > >> fixtures/initial_data.xml. On my development machine, which is a Mac, >

Re: Create table and load data

2012-10-12 Thread Kurtis Mullins
On Fri, Oct 12, 2012 at 2:09 PM, Larry Martell wrote: > > > So my client decided to use xml. I created the file and put it in > fixtures/initial_data.xml. On my development machine, which is a Mac, > it worked fine - running syncdb loaded the data. But on my client's > machine, which is running Cen

Re: Image/Photo app

2012-10-12 Thread Kurtis Mullins
Hey Thomas, I'm not sure if you're on a deadline or what-not; but these are usually the kinds of apps I develop (personally) for fun. For example, you can extend your code-base to scan the images to pull in its EXIF data and what-not. If you're on a deadline, there's multiple Django Applications

Re: Display only model fields that are non-empty

2012-10-11 Thread Kurtis Mullins
There's a couple of ways, assuming you're talking about in the template. One example would simply be: {% if object.fieldname %} {{ object.fieldname }} {% endif %} Another example might be: {{ object.fieldname|default:"" }} But it doesn't allow for much formatting of an empty field. If you wan

Re: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Kurtis Mullins
; On Thu, Oct 11, 2012 at 10:04 AM, Kurtis Mullins > wrote: > > If you use GET requests to transmit data, there is still a chance that > the > > data might be intercepted by a DNS server or Proxy Server regardless of > SSL. > > I'd keep everything contain

Re: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Kurtis Mullins
If you use GET requests to transmit data, there is still a chance that the data might be intercepted by a DNS server or Proxy Server regardless of SSL. I'd keep everything contained in POST and just like the others have mentioned, simply go with SSL and Signed Certificates. On Thu, Oct 11, 2012 at

Re: A very basic question with Django

2012-10-10 Thread Kurtis Mullins
On Wed, Oct 10, 2012 at 2:29 PM, Tomas Ehrlich wrote: > Common guys, this thread isn't about me and CGI :) I really don't care > what it is and know, when you've just told me what it is I don't care > even more :) > > If you know what's CGI, feel free to answer the original question: > "Could Djan

Re: A very basic question with Django

2012-10-10 Thread Kurtis Mullins
1. Django is perfectly suitable for handling Forms and content stored in a database. In a low to medium traffic site, serving static content is not a problem at all. In fact, that's the purpose of a Content Management System. Many of which have been built on or around Django. If you get to a point

Re: Update a model using UpdateView

2012-10-10 Thread Kurtis Mullins
By the way, that 'owner' field would be something like this: owner = ForeignKey(User) And in my example, I use the Form to make sure the Owner is set properly. On Wed, Oct 10, 2012 at 7:14 AM, Kurtis Mullins wrote: > You've got it. I included an 'owner' field o

Re: Update a model using UpdateView

2012-10-10 Thread Kurtis Mullins
You've got it. I included an 'owner' field on any model that I wanted to show ownership with. This is actually not too insanely hard as you could make a Parent Model or Mixin to make things easier. Another option is to use something like django-guardian to handle all of your permissions. However,

Re: accessing django

2012-10-09 Thread Kurtis Mullins
ys for helping this out. > One more question what is the basic step of installing the package? are > they all the same? > > > On Tue, Oct 9, 2012 at 11:45 AM, Kurtis Mullins > wrote: > >> Not really. You could probably use a host that might have some fancy >> control pan

Re: Javascript encoding and python decoding and vice versa

2012-10-09 Thread Kurtis Mullins
You could obfuscate the Javascript; but there's no such thing as security through obfuscation :) HTTPs is your best bet in terms of getting it from the server to the client without someone in the middle reading it. On Tue, Oct 9, 2012 at 1:20 AM, Mike Dewhirst wrote: > On 9/10/2012 4:07pm, Laxmi

Re: when is a Context Processor called?

2012-10-08 Thread Kurtis Mullins
https://docs.djangoproject.com/en/dev/topics/http/sessions/ On Mon, Oct 8, 2012 at 10:28 AM, Stefano T wrote: > Ok. > so basically they are called before the rendering of a template. > > How can i have an object stored in the request object (if possible)? > > Something that lets me to do, in a vi

Re: Disabling CSRF is not working.

2012-10-08 Thread Kurtis Mullins
Another solution would be to simply work with the CSRF Protection. It's not really that hard, even when using Javascript. There's even a good, simple example of using JQuery with it in the official documentation. On Sun, Oct 7, 2012 at 3:41 AM, Laxmikant Gurnalkar < laxmikant.gurnal...@gmail.com>

Re: Newbie question: first project can't connect to MySQL

2012-10-05 Thread Kurtis Mullins
Also, if memory serves me correctly, MySQL may be setup to allow connections from 127.0.0.1 but not Localhost On Fri, Oct 5, 2012 at 2:45 PM, Mohamad Efazati wrote: > Hi afshin > localhost is kind of pointer to 127.0.0.1, maybe in /etc/hosts or other > thing you overwrite it. > so 127.0.0.1 is so

Re: Django performance vs others

2012-10-05 Thread Kurtis Mullins
Probably the ability to both extend and include (template inheritance) On Fri, Oct 5, 2012 at 9:24 AM, Amirouche Boubekki < amirouche.boube...@gmail.com> wrote: > I have had no idea until recently that django template are sooo slow... >> other engines do the same... but spent less time. What the

Re: URLField and Web Sockets URLs

2012-10-04 Thread Kurtis Mullins
Looks like this is similar and shows that people want other protocols as well: http://stackoverflow.com/questions/8778416/what-are-the-valid-values-for-a-django-url-field You could modify the validator's regex but I imagine the cleanest way to do this would be to make a copy of it in your own code

Re: app for kickstarter-like goals

2012-10-01 Thread Kurtis Mullins
haha, I'm not sure of anything that already implements this but it shouldn't be too difficult to build yourself. On Sun, Sep 30, 2012 at 3:10 PM, Matteo Suppo wrote: > I'm developing a website for a non-profit organization. > > They want something similar to kickstarter, only based on people inst

Re: Using success_url with reverse() in class-based generic view

2012-09-26 Thread Kurtis Mullins
Sometimes, though, you may need to pass variables to a success url. In that case, I'd use the "get_success_url" method so you can access the 'self' attributes. On Wed, Sep 26, 2012 at 1:32 PM, Germán wrote: > Just for the record. > > Since Django 1.4, the best way to set up success_url in class-

Re: Using email instead of username for registration and login

2012-09-24 Thread Kurtis Mullins
You could check out django-userena On Mon, Sep 24, 2012 at 9:57 PM, Bill Beal wrote: > Hi all, > > I want to use the email address as the username for registration and > login. I'm using django-registration for 2-stage registration. I'm > looking for an easier way than what I've come up with s

Re: Possible spam from mailing list? ("China Mobile")

2012-09-14 Thread Kurtis Mullins
address, so they'd be easy to block on an individual > > level. But my guess is that everyone posting to django-users is receiving > > these, so it would be good for a group admin to address this at the group > > level (someone suggested removing that user). > > > &

Re: Possible spam from mailing list? ("China Mobile")

2012-09-13 Thread Kurtis Mullins
I actually just received another one of those emails. The funny part is that it used this exact thread's subject in the message. I'm curious as to whether this 139.com is emailing everybody who sends an email to the list or if it only sends emails to people in who are involved in the same thread(s)

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Kurtis Mullins
Try installing python using "brew" or another packaging utility On Thu, Sep 13, 2012 at 1:54 PM, Bob Aalsma wrote: > Umm, could you be more specific about how/where to put this? > All the combinations and location I could think of will all still give the > same error... > > > > > Op donderdag 13

Re: Model Validation with Exception Handling

2012-09-12 Thread Kurtis Mullins
Just a quick example of a field that can have two completely different error types but both throw a ValidationError while running full_clean(). Let's say my Model includes an email address. The email address must be unique. It could either fail because 1. It's not Unique (or) 2. It's an invalid em

Re: Possible spam from mailing list? ("China Mobile")

2012-09-12 Thread Kurtis Mullins
Thanks guys for confirming. I'm glad I'm not the only one! I've just set it as spam, hopefully gmail will catch on. On Wed, Sep 12, 2012 at 6:38 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > +1 just received one of these. > > > On Wed, Sep 12, 2012 at 10:

Re: Iphone applications via django

2012-09-11 Thread Kurtis Mullins
I can offer some information if you can share your "skill level" when it comes to developing iOS and/or Django Applications. 1. Do you currently know how to program iOS Applications? If so, do you have any experience writing iOS programs that can handle HTTP Requests? If the answer to either of th

Re: Marketplace for Django apps

2012-09-11 Thread Kurtis Mullins
How about a compromise; just an easier way to donate to Django and Django Application developers? It would encourage sharing high quality projects and hopefully make it worth our time (financially, not just because we love and support libre software) to do so. For that matter, there's all sorts of

Re: form doesn't validate when trying to upload file

2012-09-10 Thread Kurtis Mullins
Sorry about that. I accidentally over-looked where you mentioned that in your email. Are you running this on a debug server? Also, can you try replacing your template code with a simple {% csrf_token %}{{ form }} and see if that makes any differences? On Mon, Sep 10, 2012 at 10:38 AM, mapapage w

Re: form doesn't validate when trying to upload file

2012-09-10 Thread Kurtis Mullins
ahh, sorry I just saw something that might help. Try making this change: docpath = models.CharField(max_length=200) to: docpath = models.FileField(...) # Check the docs for arguments to this Field. https://docs.djangoproject.com/en/dev/ref/models/fields/#filefield On Mon, Sep 10, 2012 at 8:41 A

Re: form doesn't validate when trying to upload file

2012-09-09 Thread Kurtis Mullins
Also, don't forget the multi-part in your template: On Sun, Sep 9, 2012 at 2:29 PM, Joseph Mutumi wrote: > I'm assuming you are using the forms.ModelForm for your model? Say > LicenceForm? > > class LicenseForm(forms.ModelForm): > class Meta: > model = License > > According to the d

Re: is django too big for my use case?

2012-09-08 Thread Kurtis Mullins
I have a project that will be making extensive use of Neo4j, along with other data systems. As much as I love Django, I don't think the marriage is there for what you want, yet. If you're not using Django's ORM, Template System, Administration System, etc... then there's really not much left of Dja

Re: Announcement of GUI for Creating Models

2012-09-08 Thread Kurtis Mullins
You could take it a few steps farther and reproduce some work done by a doctor(now) I used to go to school with. http://knoesis.wright.edu/research/srl/projects/mobicloud/ On Sat, Sep 8, 2012 at 2:50 PM, Javier Guerra Giraldez wrote: > On Fri, Sep 7, 2012 at 9:42 PM, Timothy Clemans > wrote: >

Re: Site Architecture

2012-09-07 Thread Kurtis Mullins
ources, it can be the best solution to a project. However, smaller projects which tend to lack resources can fall into a trap if they're not careful and well informed on the differences inherent to this type of architecture. On Fri, Sep 7, 2012 at 12:12 PM, Tom Evans wrote: > On Fri, Sep 7,

Re: Site Architecture

2012-09-07 Thread Kurtis Mullins
I would recommend not using Django to consume services over a network without intensive caching and safe-guards just due to the fact that it will hold up the connection when a user tries to access a page. Importing your existing project into Django (as opposed to accessing it through an API) would

Re: Development server won't work from a shared web host

2012-09-06 Thread Kurtis Mullins
Hey, All you should need to get through the Django Tutorial is Python and Django. During development you can use SQLite which is built in and doesn't need any third-party libraries. Good luck! On Thu, Sep 6, 2012 at 1:23 PM, ecs1749 wrote: > Thanks. I might as well bite bits of it. It's tough

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
se Firefox on Linux (so the most efficient setup) you will probably need at least 10 machines to generate that kind of load. Quite insane when JMeter/Grinder/httperf can generate the same kind of load with a single machine. " On Wed, Sep 5, 2012 at 2:52 PM, Kurtis Mullins wrote: > No prob

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
> > On Wed, Sep 5, 2012 at 2:48 PM, Kurtis Mullins > wrote: > > Sure, > > > > To submit a cookie, check this out: > > > http://stackoverflow.com/questions/3334809/python-urllib2-how-to-send-cookie-with-urlopen-request > > > > To harvest a CSRF Token

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
> want to share, that would be great. > > On Wed, Sep 5, 2012 at 1:50 PM, Kurtis Mullins > wrote: > > Actually, I've got another idea for you. You mentioned you wanted to > simply > > access using urllib. Maybe you could create a small script to extract a > CSRF

Re: How to use FTP to upload files with Django?

2012-09-05 Thread Kurtis Mullins
Do you want to use FTP to serve or accept the files? On Wed, Sep 5, 2012 at 2:14 PM, Mando wrote: > Would this work -> nginx-gridfs ? > > > On Wednesday, September 5, 2012 1:09:25 AM UTC-5, Chaney Lee wrote: >> >> I just want to allow users uploading some

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
12 at 1:06 PM, Larry Martell wrote: > Thanks - but now I'm getting > > NameError: "global name 'get_backends' is not defined" > > > On Wed, Sep 5, 2012 at 12:59 PM, Kurtis Mullins > wrote: > > Looks like you just need a quick: > > > >

Re: Django Interview Questions

2012-09-05 Thread Kurtis Mullins
Yeah, I think this guide is a little crazy. If I'm getting interviewed based on questions I can't answer without looking up relevant documentation then I'd probably look bad even though the interviewer is the one lacking the required knowledge to get the job done. Maybe that's why I don't intervie

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
ackends()[0] > > user = user[0] > > user.backend = "%s.%s" % (backend.__module__, > > backend.__class__.__name__) #fake authentication > > login(request, user) > > > > You can add that to your testing environnement MIDD

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
This *might* be helpful depending on how you're testing: http://stackoverflow.com/questions/2036202/how-to-mock-users-and-requests-in-django On Wed, Sep 5, 2012 at 11:36 AM, Kurtis Mullins wrote: > I don't see why not. Are you running unit tests (testing scripts) or are > yo

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
I don't see why not. Are you running unit tests (testing scripts) or are you just using the browser for testing? On Wed, Sep 5, 2012 at 11:24 AM, Larry Martell wrote: > On Wed, Sep 5, 2012 at 9:22 AM, Kurtis Mullins > wrote: > > If any of your templates/views depend upon a re

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
If any of your templates/views depend upon a request.user object, you'll run into issues because that will not exist without "logging in". I'm not sure of a good way around this off-hand without knowing more about your site. Sorry! On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell wrote: > We have a

Re: What does this code do? Also, testing decorator via terminal?

2012-08-31 Thread Kurtis Mullins
> > On Fri, Aug 31, 2012 at 9:17 PM, Micky Hulse wrote: > > I'd like to add: > > if objects.status_code != 200: > > return objects > > ... which is found via this code: > > > > Doh! After a bit of trial and error, I given up on trying to merge > those two c

Re: Models relationship

2012-08-23 Thread Kurtis Mullins
Hello Fernando, Just as a quick example, you could do something like this: class Factory(models.Model): # Assuming suppliers and customers are just two sides of the same relationship suppliers = models.ManyToManyField("self", related_name="customers") Then simply query accordingly: fact

Re: SyntaxError Creating New Project

2012-08-22 Thread Kurtis Mullins
Very weird. I ran the syntax and did not receive a syntax error. I just checked on the documentation and it does say Python 2.5 is required, which as you mentioned you have installed. Maybe double-check to make sure that you're executing this with the right Python executable? I'm running Python 2.

Re: custom field for callable python object like class or function

2012-08-22 Thread Kurtis Mullins
, 2012 at 6:15 PM, Kurtis Mullins wrote: > It looks like you want to, basically, store a reference to a Python object > in your Model. It shouldn't be too extremely difficult. I'd create a Model > for this purpose though and just use extra methods to provide any > functionali

Re: custom field for callable python object like class or function

2012-08-22 Thread Kurtis Mullins
It looks like you want to, basically, store a reference to a Python object in your Model. It shouldn't be too extremely difficult. I'd create a Model for this purpose though and just use extra methods to provide any functionality you need. Just as a quick prototypical example: class ReferenceModel

Re: How I do to centralize logins OpenID in django?

2012-08-21 Thread Kurtis Mullins
I've never tried this approach; but maybe you could use the multi-database feature of Django to share a database for the Authentication/Sessions components? (https://docs.djangoproject.com/en/dev/topics/db/multi-db/) On Tue, Aug 21, 2012 at 7:39 PM, Mustapha Aoussar < mustapha.aous...@gmail.com> w

Re: django.db.utils.DatabaseError when resyncing django app models

2012-08-21 Thread Kurtis Mullins
It looks to me like you might have a CharField with a max_length that is greater than what your Database supports. That's my guess anyways :) On Tue, Aug 21, 2012 at 9:21 PM, Mhlanga Bothin wrote: > Hi, > > I am very new to Django, I have created multiple models in my app. I am > using postgresql

Re: Can somebody help me on how to handle this scenario?

2012-08-21 Thread Kurtis Mullins
Sorry, I meant to say the "User class which would be better extended using a User Profile". Documentation: https://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-information-about-users On Tue, Aug 21, 2012 at 5:03 PM, Kurtis Mullins wrote: > I'd offer to help

Re: Can somebody help me on how to handle this scenario?

2012-08-21 Thread Kurtis Mullins
I'd offer to help but I think there may be quite a bit more you should understand about Django, before-hand. Have you gone through the Tutorial, yet? Also, just as a general style guideline to follow; class names are typically Pascal Case (http://c2.com/cgi/wiki?PascalCase) and the User class may b

Re: new to django

2012-08-21 Thread Kurtis Mullins
python manage.py runserver Then open your browser and goto http://localhost:8000 On Tue, Aug 21, 2012 at 12:43 PM, maha wrote: > .don know what to do after that.. > > >> >> >> >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view

Re: Questions Tags Users Badges Unanswered Ask Question

2012-08-21 Thread Kurtis Mullins
Is your tfAdapter.sortabletable.js file in one of your static directories? If so, are you using the proper URL to access it? For example, . If so, what do you see when you "View Source" through your browser on that page? If you click on the javascript link from the "View Source", does it still show

Re: Updating a model instance with extra checks.

2012-08-21 Thread Kurtis Mullins
I remember running into similar situations in a different domain (collision detection in physics engines). It was a pain in the butt :) I'd say first, figure out what you want to do if the process does reach a point where there isn't sufficient funds to perform the transaction. Then take multiple s

Re: [ImageField -Upload a valid image]

2012-08-20 Thread Kurtis Mullins
Whenever you compile PIL, make sure that libjpeg is available to it. You should see a message showing you what is available when you install PIL. On Mon, Aug 20, 2012 at 3:33 PM, MN TS wrote: > Yes. > > Png and GIF are ok. > > > On Mon, Aug 20, 2012 at 8:00 PM, Amyth Arora wrote: > >> did you tr

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread Kurtis Mullins
+1 on "Roll your own" solution. Complicated M2Ms and Django Forms aren't always the cleanest pair of features to work with when combined. On Fri, Aug 17, 2012 at 9:36 AM, houmie wrote: > Thanks Melvyn, > > To be honest I would be willing to purchase a widget if there was one. iw > ill look into

Re: Best way to export data from Django?

2012-08-17 Thread Kurtis Mullins
Just curious, which data do you not have available when using signals? You mentioned the ID but this *should* be available during post_save and pre_delete hooks, if I'm not mistaken. Also, I'd recommend caution on performing external server calls during a single HTTP Request. You might have better

Re: [old question]NoReverseMatch.. I am sorry.

2012-08-17 Thread Kurtis Mullins
In this case, you are using a 'named URL' in the Admin namespace. Here's two links that may help you learn a bit more about this topic. https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns https://docs.djangoproject.com/en/dev/topics/http/urls/#defining-url-namespaces https:

Re: Full auth solution

2012-08-17 Thread Kurtis Mullins
http://www.django-userena.org/ -- 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

Re: Auto login with external cookie from different system

2012-08-15 Thread Kurtis Mullins
On Wed, Aug 15, 2012 at 10:08 AM, Melvyn Sopacua wrote: > ... > Split does not work like you think it does: > http://localhost/doc/python/library/stdtypes.html#str.split > ... Just wanted to clear one small thing up I saw :) Not all of us host the Python docs, locally, haha. I think the link you

Re: Calculations in Queries

2012-08-15 Thread Kurtis Mullins
On Wed, Aug 15, 2012 at 8:51 PM, Callum Bonnyman wrote: > I've tried a few things but i cannot get the correct date formats to > calculate the difference, so far i have this: > > popular_posts = Post.objects.extra(select={ > 'popularity': '(' + datetime.datetime.now() + ' - created) * view

Re: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Kurtis Mullins
I just noticed another thing here. But, it could just be related to copying and pasting your source here. See below On Tue, Aug 14, 2012 at 11:16 PM, Sky wrote: > I've having a similar problem here using Django 1.4 and I can't quite > figure what's wrong. The error reads: Could not import polls.

Re: 回复: Stuck on "ViewDoesNotExist" last step of tutorial part 4

2012-08-15 Thread Kurtis Mullins
This line should be commented out: "Uncomment the next two lines to enable the admin:" Also, I don't see why it's trying to import 'polls.views.index'. That would be a function named 'index' in your views.py file in the polls directory (also known as a module). Not only does that 'index' method/fu

Re: DJANGO_DEFAULT_SETTINGS

2012-08-14 Thread Kurtis Mullins
Hey Carlos, Unfortunately I'm having a difficult time understanding your English. I do apologize! If I understand correctly, it sounds like you want to insert some data using the shell and you're running into an error. Can you show us the error you are getting? On Tue, Aug 14, 2012 at 2:48 PM, C

Re: Using Forms without Request Data

2012-08-14 Thread Kurtis Mullins
Thanks a lot! I was curious on how to grab the raw POST data but didn't spend any time looking into it. This will definitely come in handy. On Tue, Aug 14, 2012 at 12:35 PM, S.Prymak wrote: > Here is the code snippet about JSON validation I use in my application: > > try: > j

Re: Using Forms without Request Data

2012-08-13 Thread Kurtis Mullins
On Mon, Aug 13, 2012 at 5:10 PM, Melvyn Sopacua wrote: > > > data argument to a form instance must be a dictionary-like object. Other > then that there's no requirements. > I'm kinda curious why you need a form if you're using a non-html data > format. > > I figured it out :) It was as simple as cr

Re: custom management commands: AttributeError: 'module' object has no attribute 'Command'

2012-08-13 Thread Kurtis Mullins
I'd look more into the full traceback. I haven't had any trouble with underscores either. On Mon, Aug 13, 2012 at 2:31 PM, creecode wrote: > I have many custom management command names that have underscores in them. > I've never had a problem. I believe that a management command name only > ne

Re: Issue Deploying Django

2012-08-12 Thread Kurtis Mullins
On Aug 11, 2012 6:31 PM, "Mario Lacunza" wrote: > > Dont forget ask to webfaction about it too before > you buy the package, you have root access in WF > and you can install whaterver you want I guess. Web faction gives root access now? > Anyways ask WF support. > > http://www.webfaction.com?aff

Re: Middleware manipulating template in response

2012-08-09 Thread Kurtis Mullins
I saw this in one of the previous Python newsletters (I think) and it looked pretty interesting: https://github.com/gregmuellegger/django-mobile On Thu, Aug 9, 2012 at 9:29 AM, Thomas Weholt wrote: > Hmmm ... is there any other way to achieve the same result ( using a > special template for mobil

Re: Separate file stream from request input stream while upload

2012-08-08 Thread Kurtis Mullins
Check out nginx. It can be configured to separately upload a file and provide a status indicator. I'm not sure if you could still retrieve the WSGI Request separately or not -- but you could always take the AJAX route like Russ suggested. On Wed, Aug 8, 2012 at 6:42 AM, Jian Chang wrote: > 是不是可以

Re: .filter(Q(childobj__attr1="something", childobj__attr2__gte=100)) and .filter(~Q(childobj__attr1="something", childobj__attr2__gte=100)) Don't Produce Opposite Results

2012-08-03 Thread Kurtis Mullins
Let's write this in logical notation models.ParentObj.objects.filter(Q(childobj__attr1="something", > childobj__attr2__gte=100)).count() A AND B This query should give you all objects where both attr1="something" is true AND attr2_gte=100 is true. Does this sound right from the data you have at

Re: Registering only folks with .org email

2012-08-03 Thread Kurtis Mullins
Hey Steve, There's a number of ways you could go about tackling this task. I, typically, would read the original's application code and first determine how it worked. In some cases, I would write my code to subclass (or re-use) theirs and just make the modifications required. Other times, dependin

  1   2   3   4   >