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 about your project, I think going RedHat + Oracle 
> might be a bit overkill, especially Oracle since it is a mess to configure 
> and tune.
> 
> Have you considered CentOS as an alternative? same binaries and libraries as 
> RedHat but completely free, and also easier to deploy in the typical VPS 
> providers (Linode, DigitalOcean, etc). For the database PostgreSQL is solid 
> and (kinda) simple to deploy and configure.
> 
> 
>> On Wed, Jun 10, 2015 at 7:36 AM, Jason  wrote:
>> We are a group of developers that are reasonable new to the Django web 
>> framework. We've managed to build an application that is currently housed in 
>> PythonAnywhere and are now at the stage where we would like to conduct some 
>> performance testing.
>> 
>> Our current plan is to rent some space from a VPN provider with 
>> production-like specs and start testing the performance of our application. 
>> However, whilst we are reasonably capable at building our application, we 
>> are new to the deployment of things in Virtual environments (including OS, 
>> database software etc...).
>> 
>> We are planning to use Red Hat Linux for the OS and an Oracle database for 
>> the initial deployment and would appreciate any ideas on how to go about 
>> gaining some assistance with this. To start with, we are planning to have 
>> the application code and the database under one virtual server and later on 
>> we will test the separation of the database and the application code.
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/c4e4dbd6-c50c-41b3-92c3-5d9d6ba8472e%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALn3ei1YQN1f78w6_COm2JcoDLgyPGry5%2BYc%3D6tuXhWPrEhBLg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6AB5A293-E70A-459A-95E0-A42A09D12447%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 issues).

Good luck!


On Wed, Mar 5, 2014 at 1:21 PM, Shawn H  wrote:

> I can't do that, as your assumption is incorrect. I don't have a table
> that holds recordnumb as a unique value.  Each recordnumb occurs many
> times, and occurs many times per case number, by design. The number is used
> to identify unique ownership among many properties for a particular case -
> each unique owner is assigned a recordnumb and that number is assigned to
> each property that the unique owner owns. That's why we're doing a
> distinct, so we can identify the number of unique recordnumb values for a
> particular case.  BTW, I tried using max() instead of distinct, with no
> change, which I expected since the database solution would be nearly
> identical in that case.  Hopefully I didn't misunderstand what you were
> requesting I try.
>
>
> On Monday, March 3, 2014 1:43:35 PM UTC-6, junctionapps wrote:
>
>> Hey Shawn, would you do me a favour and try something a query with a
>> implicit distinct like the following substituting YOURRECORDTABLE for
>> whatever table holds your recordnumb as a unique value (I'm making a large
>> assumption you have a table where each recordnum occurs once). Could you
>> let me know if you see improvements in speed from the SQLPlus, and
>> subsequently Django?
>>
>> SELECT count(1) from (
>>
>> SELECT RECORDNUMB FROM YOURRECORDTABLE
>> where RECORDNUMB IN
>> (
>> SELECT RECORDNUM
>> FROM NOTICED_PARCELS
>> WHERE CASE_NUMBER = %s AND RECORDNUMB > 0
>>  UNION count(1)
>> SELECT RECORDNUMB
>> FROM CONDONOTICE
>> WHERE CASE_NUMBER = %s AND RECORDNUMB > 0
>> )', [case_number, case_number]
>>
>> On Thursday, 27 February 2014 11:48:40 UTC-4, Shawn H wrote:
>>>
>>> The cursor.execute specifically.  I'm printing a timestamp immediately
>>> before and immediately after that line.  I'm positive it is ONLY the query
>>> that takes 16 seconds, whether using django.cursor or a cx_Oracle cursor.
>>>
>>> On Thursday, February 27, 2014 9:27:48 AM UTC-6, Scott Anderson wrote:

 Are you timing the query in the view specifically, or the entire view?
 That is, do you know for sure that it is *only* the query that is taking 16
 seconds and not the rest of the view?

 -scott

 On Wednesday, February 26, 2014 5:53:15 PM UTC-5, Shawn H wrote:
>
> I said that before testing it.  The exact same code using cx_Oracle
> takes ~4 seconds outside of the django environment, but still takes ~16
> seconds when running in the django view.  What the heck is going on?
>  Updated portion of code below
>
> cnxn = cx_Oracle.connect('notification/notifydev@landmgm')
> cursor = cx_Oracle.Cursor(cnxn) #connections['landtest_11'].cursor()
> print datetime.datetime.now()
> cursor.execute('SELECT count(1) from (SELECT DISTINCT RECORDNUMB FROM
> DEVGIS.NOTICED_PARCELS WHERE CASE_NUMBER = &s AND RECORDNUMB > 0 UNION \
> SELECT DISTINCT RECORDNUMB FROM DEVGIS.CONDONOTICE WHERE CASE_NUMBER =
> &s AND RECORDNUMB > 0)', [case_number, case_number])
>  print datetime.datetime.now()
> number_count = cursor.fetchone()
>
>
> On Wednesday, February 26, 2014 4:41:06 PM UTC-6, Shawn H wrote:
>>
>> Because this worked so well, I've gone directly to cx_Oracle in my
>> django view and used that to get the result in the 4 seconds.  There is
>> definitely a problem with the Django implementation - I wonder if perhaps
>> the indexes on the tables aren't being used properly.
>>
>> On Wednesday, February 26, 2014 3:49:47 PM UTC-6, Shawn H wrote:
>>>
>>> 3.8 seconds.  It seems to be django, not cx_Oracle.
>>>
>>> On Wednesday, February 26, 2014 2:50:58 PM UTC-6, Shawn H wrote:

 Good idea.  I'll try that and report back

 On Wednesday, February 26, 2014 1:22:52 PM UTC-6, Tom Evans wrote:
>
> On Wed, Feb 26, 2014 at 6:16 PM, Shawn H 
> wrote:
> > Yes.  I've tested with several case numbers, and I'm using a
> similar
> > parameterized approach in my gui Oracle client as well, with the
> same
> > results.  It's always about 3 to 4 times slower running via
> django.  I've
> > tried it both on my local development web server as well as my
> production
> > apache linux box, and it always takes much longer running via
> django.
> >
> >
>
> If you write a standard python program, ie not using django, but
> still
> using whatever oracle DB adapter Django uses, that connects to
> your
> oracle server and executes the query, is it still 

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  (or
something similar) to convert it to ODT
3. Return a Response that includes the ODT as the content and the set the
proper content-type 


On Fri, Nov 22, 2013 at 11:13 AM, Tom Lockhart wrote:

>
> On 2013-11-21, at 9:34 PM, Harjot Mann  wrote:
>
> > I want to save my html django templates to odt file. Is there any way
> > to do this?
>
> Not sure what you actually want to do. If you are trying to capture your
> final html, you might be able to script something, possibly with selenium,
> to generate the page and then send it to Libre Office as a batch job:
>
>
> http://stackoverflow.com/questions/16202103/how-to-open-file-in-libre-office-and-save-this-like-doc-file
>
> hth
>
>  - Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4082C55B-E4DC-425A-A239-5BC11B652042%40gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPbEHsf%2B%2BS3k%3DwE6cV0CoVjdmADo7z%3Da0_NNxzM%2B_PA%2B_0y%3DHg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Disable "Password Upgrading"?

2013-05-16 Thread Kurtis Mullins
I didn't get around to testing the mentioned location of changing the
password_hasher. After further investigation, I realized that the password
hashes use a static hash and I was using a dynamic (per-user) hash.

*Just in case anyone runs into this problem (non-static Hash)*:

My solution was to by-pass the existing authentication system all-together.
I already had a custom User Model which sub-classed AbstractBaseUser. I
simply overrode (sp?) the set_password and check_password methods to do the
password checking on the spot; without delegating
to django.contrib.auth.hashers

The reasoning behind this solution is that I ran out of time attempting to
track down a method of passing my per-user value to be included in the Hash.

*WARNING*: This may not be a great idea. I haven't ran unit tests to see
what sort of problems this will bring. Possibly none; I don't know until I
do. Either way, I still believe the standard process-validation approach
should be taken in case one needs to upgrade passwords or has multiple hash
algorithms they want to use. I'm sure this work-around could be cleaned up
to fall-back on the Django approach when needed. Either way, it 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 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 document:
>>
>> https://docs.djangoproject.com/en/1.5/topics/auth/passwords/
>>
>> Django will upgrade all existing passwords to use the 'preferred'
>> algorithm. Two questions:
>>
>> 1. What is the 'preferred' algorithm? Is this set by Django? Or is this
>> simply the hasher at the top (or bottom) of the PASSWORD_HASHERS tuple?
>>
>> 2. *How can I disable or otherwise bypass this feature?* The database I
>> am working with is shared with an older code-base and until we migrate the
>> other components, I"d rather not "upgrade" the existing password hashes.
>>
>> Thanks!
>> - Kurtis
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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 document:
>
> https://docs.djangoproject.com/en/1.5/topics/auth/passwords/
>
> Django will upgrade all existing passwords to use the 'preferred'
> algorithm. Two questions:
>
> 1. What is the 'preferred' algorithm? Is this set by Django? Or is this
> simply the hasher at the top (or bottom) of the PASSWORD_HASHERS tuple?
>
> 2. *How can I disable or otherwise bypass this feature?* The database I
> am working with is shared with an older code-base and until we migrate the
> other components, I"d rather not "upgrade" the existing password hashes.
>
> Thanks!
> - Kurtis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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-Molnar <
nik.mol...@consbio.org> wrote:

>  Are you sure there's no router involved? Even if it's not *your* router,
> you're likely connected to the internet through a router. But let's step
> back for a moment. The phrase "available over the internet" suggests a
> production environment, and again, you *should not* use the Django web
> server for that. I recommend finding an internet hosting service which
> supports Django (many here will have suggestions, look back through the
> threads for discussion on this) and deploy your Django app as described
> here: https://docs.djangoproject.com/en/1.5/howto/deployment/
>
> _Nik
>
>
> On 5/7/2013 12:25 PM, Kakar Arunachal Service wrote:
>
> Thank you for your reply! But coud you pls explain in detail how to make
> it available over the internet. And i dont have a router, m running it on
> my laptop. Pls advise.
>
>
> On Tue, May 7, 2013 at 11:10 PM, Nikolas Stevenson-Molnar <
> nik.mol...@consbio.org> wrote:
>
>>  Keep in mind that the Django development server is designed neither for
>> security nor performance, so under no circumstances should you use it as a
>> production server. With that said, assuming you're using this for* 
>> *development
>> purposes, change your manage.py runserver command to bind to the address
>> 0.0.0.0. E.g:
>>
>> $ python manage.py runserver 0.0.0.0
>>
>> This should make is available to your local network (if not, you may need
>> to add the machines your accessing it from to your INTERNAL_IPS setting).
>> To make it available over the internet (*not suggested!)* you'll need to
>> configure your router.
>>
>> _Nik
>>
>>
>> On 5/7/2013 8:43 AM, Kakar wrote:
>>
>> I have my project in my pc, and on python manage.py runserver, i can view it 
>> on my browser. But how to view from other computer or on the internet and 
>> not locally?... How to make my pc a server to view it from over the 
>> internet? Plz help me guyz!
>>
>>
>>
>>--
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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 from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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
imagine it's something along the lines of just a simple HTTP Request and
checking the response to make sure the request was successfully accepted.
Manually test this to see how long it takes from your own computer. If it
is very quick, check for bottlenecks elsewhere. Without knowing the
implementation details of your system there's not much more I could suggest
checking into.


On Sat, Apr 20, 2013 at 11:40 PM, Shawn Milochik  wrote:

> In addition to Michael's good comments:
>
> I suspect you won't have 100,000 tasks coming in every second of every
> day. If you have to send out SMS messages and some of them take a few
> minutes to go out, that should be fine for most purposes. In addition, some
> SMS services have some limit per minute/hour for the number of messages you
> can send. If so, you'll be forced to queue them regardless and trickle out
> the sending.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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:
> > Looks like an overkill to me. Why setup an SMTP server for this!
> > Are there no other options?
>
> Use your ISPs SMTP server. If your ISP doesn't provide one, you have
> to provide one.
>
> Some MTA has to deliver the email to the right MDA, if your ISP
> doesn't provide one, you have to do it yourself, that's just how email
> works.
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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 conclusive alternative as I
honestly didn't put a *lot* of time into looking at Python alternatives
since this one merged so seamlessly into our technologies (Backbone.js,
MongoDB, Web-Service)

Also, there's some Django Rest Modules which can help automate some
Object->JSON (RESTful) functionality


On Sat, Mar 30, 2013 at 2:16 PM, Alexis Roda <
alexis.roda.villalo...@gmail.com> wrote:

> Al 30/03/13 16:41, En/na Parin Porecha ha escrit:
>
>  Thanks !
>>
>> Okay, so i am dropping the idea of using JSON for storage.
>>
>> So, if I use JSON only as a format to send data
>> to client ( All the parsing will be done client side ), is it better
>> than using {{ task.name }}, {{ task.start_date }} ? ( Sorry to ask
>> this again, but i haven't got it )
>>
>
> Sorry, but I still don't get the point on your question. Do you mean "is
> better to manage presentation on the client (json response + javascript) or
> in the server (django templates)"?
>
>
>
> Regards
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> django-users+unsubscribe@**googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/django-users?hl=en
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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 great if your could update the notice to include the details,
> as his family is not in contact with his wider group of friends.
>
> rloyz...@gmail.com
>
>
> On Wednesday, March 20, 2013 4:01:39 AM UTC+11, Jacob Kaplan-Moss wrote:
>>
>> Hello fellow Djangonauts,
>>
>> We have difficult news: Malcolm Tredinnick has passed away.
>>
>> Malcolm was a long-time contributor to Django, a model community member,
>> a brilliant mind, and a friend. His contributions to Django — and to
>> many other open source projects — are nearly impossible to enumerate.
>> Many on the core Django team had their first patches reviewed by him;
>> his mentorship enriched us. His consideration, patience, and dedication
>> will always be an inspiration to us.
>>
>> To say we'll miss him is an understatement.
>>
>> Our thoughts are with Malcolm's friends, colleagues, and family at this
>> difficult time.
>>
>> This came as quite a shock, and we're still sorting out details. We'll
>> update our blog,
>> https://www.djangoproject.com/**weblog/2013/mar/19/goodbye-**malcolm/,
>>
>> once we know the details of how you can express your condolences to
>> Malcolm's friends and family.
>>
>> — The Django Core Team
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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 believe that is an honest or ethical solution unless you are willing
to do whatever it takes (financially and IT-wise) to guarantee the safety
of the user's information, ensure that no-one will access or use the
information for immoral purposes, you are not violating Coursera's own
Terms of Use, and your users know full and well what it is they are exactly
doing.

Overall, I'd suggest not even attempting to do something like this;
especially if you're already stumbling on the "How to" portion of the
problem :) (No offense, I just take data security very seriously and
wouldn't want to see anyone get nailed with a huge lawsuit)

If you want to try it out for personal purposes (let's say your children,
or something like that), I did see that Coursera uses BackboneJS which
means there are endpoints available which would make the project
potentially a lot easier.


On Fri, Mar 15, 2013 at 3:17 AM, Avnesh Shakya wrote:

> Hi,
> Actually I want to get data from other website, for example-- i have
> my django wesite, and one user login on my site then he click on link of
> other site(like coursera), which is given on my site, and login on
> coursera, then i want to get user's data from coursera site,not secure
> data, only course performance data
> please help me... i m unable to find out solution of this problem
>
> thanks in advance..
> regards,
>   Avnesh shakya
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




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, 2012, at 9:57 AM, Kevin  wrote:
>
> > Hello!
> >
> >   I am curious of how many existing Django developers have moved over to
> class-based views or are still using the function-based ones.  I tend to
> use a mix depending on what I am trying to do.  I try to stick with
>
> I use only function-based views. I've yet to read a compelling argument
> for switching.
>
> --
> 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.
>
>

-- 
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.



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
> doing.  Many thanks for this.
>
>
> On Sunday, 11 November 2012 12:54:45 UTC-6, Lee Hinde wrote:
>
>> The dev docs are much more informative.
>>
>>
>> On Sun, Nov 11, 2012 at 10:45 AM, Arnold Krille wrote:
>>
>>>
>>> Docs on CBV in django1.4 are a bit sparse to say the least.
>>>
>> 
>>
>>>
>>> Have fun,
>>>
>>> Arnold
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/jZ8_sGjQpkoJ.
>
> 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.
>

-- 
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.



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 think the web server of your choice depends upon your needs.
I, personally, prefer Nginx and uWSGI but something else may be better for
your particular use case.

Good luck!


On Sat, Nov 10, 2012 at 2:10 AM, Ashwin Kumar  wrote:

> thank you javier,
>
> i am a .net and php developer, i can setup .net and php servers on
> windows, ubuntu.
>
> i am new to django/python. i love python so giving it a try.
>
> can you give any idea of setting up my own django server, i found hard
> time in setting up one. not able to choose between apache and nginx
> mod_wsgi, mod_python.
>
> i never found a decent documentation on how to setup and run django on
> apache or nginx.
>
> With Best
> -Ashwin.
> +91-9959166266
>
>
>
> On Fri, Nov 9, 2012 at 11:24 PM, Javier Guerra Giraldez <
> jav...@guerrag.com> wrote:
>
>> On Fri, Nov 9, 2012 at 11:53 AM, Aswani Kumar 
>> wrote:
>> > my question is google app engine supports python 2.7 but django moving
>> > towards python 3.x now with django 1.5 the minimum required version of
>> > python is 2.6. and django 1.6 will be on python 2.7. what will be my
>> future
>> > if i choose google app engine and django.
>>
>> migration to 3.x is still experimental, it will be some time before
>> it's mandatory.
>>
>> also, a significant part of Django deprecation policy is which
>> versions are available in widely used platforms. Not so long ago, 2.4
>> was still supported just because some still-supported RHEL version
>> uses it by default.
>>
>> finally, i'm sure Google will make 3.x available before 2.7 is
>> hopelessly obsolete.  Remember that they employ some big-name Python
>> developers just for that (even someone with GvR initials)
>>
>>
>> > i need a PAAS like google app engine so i can concentrate on developing
>> app
>> > instead of managing servers.
>>
>> personally, i find much easier to manage my own server than to be
>> constantly distracted by the by-design limitations of the different
>> PaaS offerings.  But if you find one that you really like, and don't
>> mind the lock-in, go for 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-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.
>>
>>
>  --
> 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.
>

-- 
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.



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
else (sorl?) so my apologies if I've given incorrect information.


On Fri, Nov 9, 2012 at 9:56 AM, Brent  wrote:

> Have you looked at easy-thumbnails? It depends on PIL or Pillow and works
> great for cropping amount other image manipulations.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-8PoiC9kdKYJ.
> 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.
>
>

-- 
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.



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. I've google and I found a solution just like
> this. The problem is that does not work.
>
> [code]
> import os
> os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
> from myapp.models import *
>
> MyModelClass.objects.raw("select materialize('some', 't_some_table');")
> [/code]
>
> I've created a file with the code above, but the RAW does not run the
> function "materialize".
>
> There is a better way to call a function using the Django environment?
>
>
>
> Best Regards,
>
> --
> 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.
>
>

-- 
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.



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 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.
>> Does someone know other solutions ?
>>
>> Thanks,
>>
>> --
>> 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.
>>
>
>

-- 
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.



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.
> Does someone know other solutions ?
>
> Thanks,
>
> --
> 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.
>

-- 
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.



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:26 AM, Markus Christen wrote:
>
> I have tryed your input, but i have always the same problem... i cant fix
> it. it doesent work and i dont know why. (i have it in pycharm and there
> are only these 2 return problems marked.)
>
>
> Am Freitag, 2. November 2012 18:44:46 UTC+1 schrieb ke1g:
>
>> Surely the error message included a line number?
>>
>> Also, probably not related, but check that there is no whitespace after
>> your line ending back-slashes.  (Hint it is safer to put the opening triple
>> quote before the backslash, and safer yet to put the triple quoted string
>> in a pare of parentheses, the opening one where you have the backslash.)
>>
>> On Wed, Oct 31, 2012 at 3:28 AM, Markus Christen 
>> wrote:
>>
>>> Good Morning
>>> I have downloaded files, that can helps by my mssql-odbc connection.
>>> This is my downloaded file:
>>> http://code.google.com/p/**django-pyodbc/source/browse/**
>>> trunk/sql_server/pyodbc/**compiler.py?r=190
>>>
>>> On lines 188 and 273, i become the message "'return' outside of
>>> function". It's not a space/tab fail, i have checked this.
>>> How can i fix this?
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**uvBBHw13tokJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/DMb-vkIM5xsJ.
> 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.
>
>
>  --
> 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.
>

-- 
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.



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 use a distributed
database system to help with your scalability. I don't have much experience
in that area, though.

This still leaves a point of failure: Nginx (or whatever load balancer or
reverse proxy you use). Maybe someone else here will know more about load
balancing Nginx itself ... that might require specialized hardware. I know
a lot of cloud services offer load balancers (e.g. rackspace) so you could
possibly use that with multiple nginx servers and further multiple django
servers.

On Tue, Oct 30, 2012 at 3:42 AM, Isaac XXX  wrote:

> Hi there,
>
> maybe you're right, but I'm not really worried about RAM footprint, or
> resources consumption. I'm concerned now on architecture, setting a right
> scalable system, and a right cluster of systems, without lacks of
> communications between them.
>
> Underlaying technologies can be easily replaced (say apache-mod_wsgi for
> gunicorn or uwsgi), and some performance improvements can be made, but this
> is not what I'm looking for. I'm looking for the tools to generate a robust
> system, balancing requests through several systems, and allowing increase
> the size of this system (adding more servers) without trouble.
>
> Cheers,
>
> Isaac
>
>
> On 10/29/2012 05:18 PM, Some Developer wrote:
>
>> On 29/10/2012 16:03, Isaac XXX wrote:
>>
>>> Hi there,
>>>
>>> thank you for response Tom.
>>>
>>> Actually, I've a complete idea at how to build this system, but I lack
>>> the exact information about how to join systems, and what I was looking for
>>> was a source of cohesive information on all systems. At least, when I
>>> finish to build that system, I will write this tutorial.
>>>
>>> For someone who can help me, I will describe here what I thought it can
>>> be this structure:
>>>
>>> - 1 nginx, as a reverse proxy on frontend, serving static/media and
>>> redirecting content to apache clusters
>>> - n apache servers, with mod_wsgi, serving dynamic data
>>> - m postgresql servers, in a master-slave flavour
>>>
>>> Cheers,
>>>
>>> Isaac
>>>
>>
>> Why not just ditch Apache entirely and just use Nginx for serving all
>> media (both static and dynamic)? You can then save quite a few resources as
>> you only need to run one HTTP server rather than two.
>>
>> Using Nginx to serve Django content works well. Just serve your Django
>> application via FastCGI or uWSGI and you'll significantly simplify your
>> configuration and reduce RAM usage on your servers as well.
>>
>>
> --
> 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+unsubscribe@**
> 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-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.



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 scale. Good luck!

-- 
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.



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 mentioned, is a great starting point to learn
about the Django Framework. For the purpose of a university course, I would
keep the technologies as simple as possible: Use SQLite for the database
(this comes with Django), use Django's built-in 'runserver' for development
purposes until you need to push the web application to a production (read:
live) environment. I would focus on things such as building Models, using
Forms and Views to get and display any related data, and maybe some
semi-complex Templates related functionality such as Template Inheritance.

Depending on the depth of the course, it would be very great knowledge for
the students to know how to use a traditional DBMS with Django. It would
also be very beneficiary for the students to learn how to configure an HTTP
Server to communicate with a Django Application. However, these are only
details related to the deployment of Django and can easily set the students
on a wide tangent from the objective of teaching students how to manage and
implement a web application project using the Django framework.

Hopefully that helps answer your question a bit. Good luck!



On Sun, Oct 28, 2012 at 4:39 PM, Smriti Patodi wrote:

> Hi Everyone,
> I am a MSIS student at Santa Clara University, CA. My team has chosen
> Django to work on for our Software Project Management course.
> I was wondering if there is some place where I can find documentation
> related to Django's Software Development process/model.
> Or if any of the community members can give some insight on the topic.
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/YTgUf90fZxkJ.
> 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.
>

-- 
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.



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 you.

Good luck

On Fri, Oct 26, 2012 at 5:16 AM, Stone  wrote:

> Hi Nik,
>
> I do not understand. How can I submitted as a actual form parameter?
> Are there any examples?
>
> On Oct 25, 5:24 pm, Nikolas Stevenson-Molnar 
> wrote:
> > It looks like you're submitting your request via AJAX and using the
> > X-CSRFToken header. It's very possible that one of your proxies isn't
> > forwarding that header correctly. You might try submitting it as an
> > actual form parameter instead.
> >
> > _Nik
> >
> > On 10/25/2012 6:01 AM, Stone wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Over Firefox and Firebug I have received that CSRF Validation failed.
> > > My server is running on apache2-2.2.22 and there are two proxy's
> > > All template file and forms includes csrf_token tag.
> >
> > > On Oct 24, 6:54 pm, Nikolas Stevenson-Molnar 
> > > wrote:
> > >> It's possible that the CSRF token isn't being sent correctly. As a
> test,
> > >> try adding the @csrf_exempt decorator to your view. If you no longer
> get
> > >> the 403, then it's a CSRF problem.
> >
> > >> _Nik
> >
> > >> On 10/24/2012 6:31 AM, Stone wrote:
> >
> > >>> My Django application is running on real server (apache2-2.2.22).
> > >>> In urls.py is mentioned:
> > >>> (r'^configSave/$', configSave),
> > >>> My HTML is bellow. After pressing on configSave I am receiving HTTP
> > >>> 403 error page.
> > >>> In view.py is mentioned:
> > >>> def configSave(request):
> > >>>configFile={}
> > >>>if os.path.isfile(SSO_CONF) != False:
> > >>>f = open(SSO_CONF,"r")
> > >>>for line in f:
> > >>>line = line.strip()
> > >>>if re.search('^#',line) != None:
> > >>>'''print 'This is the commentary'''
> > >>>else:
> > >>>'''print line'''
> > >>>try:
> > >>>name, value = line.split('=',2)
> > >>>configFile[name]=value
> > >>>print '<%s>%s' % (name,
> value, name)
> > >>>except ValueError, err:
> > >>>''' print 'This is empty row'''
> > >>>
>  configFile['SlaveDeactAppl']=configFile['SlaveDeactAppl'].split(',');
> > >>>
> configFile['SlaveDeactScripts']=configFile['SlaveDeactScripts'].split(',');
> > >>>configFile={}
> > >>>if os.path.isfile(SSO_CONF) != False:
> > >>>f = open(SSO_CONF,"r")
> > >>>for line in f:
> > >>>line = line.strip()
> > >>>if re.search('^#',line) != None:
> > >>>'''print 'This is the commentary'''
> > >>>else:
> > >>>'''print line'''
> > >>>try:
> > >>>name, value = line.split('=',2)
> > >>>configFile[name]=value
> > >>>print '<%s>%s' % (name,
> value, name)
> > >>>except ValueError, err:
> > >>>''' print 'This is empty row'''
> > >>>
>  configFile['SlaveDeactAppl']=configFile['SlaveDeactAppl'].split(',');
> > >>>
> configFile['SlaveDeactScripts']=configFile['SlaveDeactScripts'].split(',');
> > >>>c = {}
> > >>>c = Context({
> > >>>'config':configFile,
> > >>>'item':2,
> > >>>})
> > >>>c.update(csrf(request))
> > >>>return
> > >>>
> render_to_response('config.html',c,context_instance=RequestContext(request))
> > >>> By the way how to really fast define logging mechanism which can be
> > >>> use for debugging.
> > >>> Is this my programmer approach corrector is there any other way how
> to
> > >>> react on the pressing of button?
> > >>>  "http://
> > >>>www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > >>> {% extends "index.html" %}
> > >>> {% block content %}
> > >>> http://www.w3.org/1999/
> > >>> xhtml">
> > >>> 
> > >>>   top.helpID="SSO_config";
> > >>>   $(document).ready(function () {
> > >>>function sendAjax()
> > >>>{
> > >>>$(document).ajaxSend(function(event, xhr, settings) {
> > >>>function getCookie(name) {
> > >>>var cookieValue = null;
> > >>>if (document.cookie && document.cookie != '') {
> > >>>var cookies = document.cookie.split(';');
> > >>>for (var i = 0; i < cookies.length; i++) {
> > >>>var cookie = jQuery.trim(cookies[i]);
> > >>>if (cookie.substring(0, name.l

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 point to place a breakpoint:
> https://github.com/django/django/blob/master/django/core/management/commands/syncdb.py
>
>
> On Fri, Oct 12, 2012 at 3:30 PM, Larry Martell wrote:
>
>> On Fri, Oct 12, 2012 at 12:22 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,
>> >> it worked fine - running syncdb loaded the data. But on my client's
>> >> machine, which is running CentOS, running syncdb did not load the data
>> >> (it said 'Installed 0 object(s) from 0 fixture(s)'). But when I ran:
>> >>
>> >> manage.py loaddata fixtures/initial_data.xml
>> >>
>> >> That worked. Anyone have any ideas why sycndb worked on my mashine,
>> >> but it's not working on theirs?
>> >
>> >
>> > That's very weird. I haven't seen that affect off-hand. I've worked with
>> > Django on Linux (CentOS, Ubuntu, Debian) as well as OSX and it has
>> always
>> > tended to work fine. I'm not sure on a solution other than to keep
>> checking
>> > for inconsistencies or issues with the .xml file itself. Hopefully
>> someone
>> > else who has ran into this problem before can chime in and offer some
>> help.
>> > Good luck!
>>
>> Yeah, I don't think it's platform dependent. The xml file was pulled
>> from our git repository, and it matches mine. And it works with
>> loaddata. I'll have to set a breakpoint and see why manage doesn't see
>> the file.
>>
>> --
>> 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.
>>
>>
>

-- 
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.



Re: Create table and load data

2012-10-12 Thread Kurtis Mullins
Good luck to you! The code is here if you want to start crawling through it
for a good point to place a breakpoint:
https://github.com/django/django/blob/master/django/core/management/commands/syncdb.py

On Fri, Oct 12, 2012 at 3:30 PM, Larry Martell wrote:

> On Fri, Oct 12, 2012 at 12:22 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,
> >> it worked fine - running syncdb loaded the data. But on my client's
> >> machine, which is running CentOS, running syncdb did not load the data
> >> (it said 'Installed 0 object(s) from 0 fixture(s)'). But when I ran:
> >>
> >> manage.py loaddata fixtures/initial_data.xml
> >>
> >> That worked. Anyone have any ideas why sycndb worked on my mashine,
> >> but it's not working on theirs?
> >
> >
> > That's very weird. I haven't seen that affect off-hand. I've worked with
> > Django on Linux (CentOS, Ubuntu, Debian) as well as OSX and it has always
> > tended to work fine. I'm not sure on a solution other than to keep
> checking
> > for inconsistencies or issues with the .xml file itself. Hopefully
> someone
> > else who has ran into this problem before can chime in and offer some
> help.
> > Good luck!
>
> Yeah, I don't think it's platform dependent. The xml file was pulled
> from our git repository, and it matches mine. And it works with
> loaddata. I'll have to set a breakpoint and see why manage doesn't see
> the file.
>
> --
> 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.
>
>

-- 
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.



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 CentOS, running syncdb did not load the data
> (it said 'Installed 0 object(s) from 0 fixture(s)'). But when I ran:
>
> manage.py loaddata fixtures/initial_data.xml
>
> That worked. Anyone have any ideas why sycndb worked on my mashine,
> but it's not working on theirs?


That's very weird. I haven't seen that affect off-hand. I've worked with
Django on Linux (CentOS, Ubuntu, Debian) as well as OSX and it has always
tended to work fine. I'm not sure on a solution other than to keep checking
for inconsistencies or issues with the .xml file itself. Hopefully someone
else who has ran into this problem before can chime in and offer some help.
Good luck!

-- 
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.



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 you could
probably tie together to get decent results relatively quickly. Django
Tags, Haystack (for search), and maybe Django Guardian for the permissions
(although I like going custom here). Thumbnails might also be helpful.

One thing I would recommend is writing a Django Management "Script" to scan
your library and synchronize it instead of relying on the built-in "File
Upload Handlers" since you've already got the files on your disk and it
would be insanely inefficient to Upload Them One by One to you own server
(I doubt that was your idea, though).

I'm not sure about the syncing of tags between the GUI and Web Application;
I think that would completely depend on your ability to export or otherwise
use the tags created by the GUI application. If you can figure out how to
get ahold of that data and parse it, then I'm sure it wouldn't be too
difficult to re-use it.

Good luck!

On Fri, Oct 12, 2012 at 10:32 AM, Thomas Guettler  wrote:

> I have 40k photos (jpg) on my ubuntu PC and want to share them with my
> friends and
> family.
>
> I searched for a django app which can sync with a local application like
> digikam or shotwell. But none
> seem to be alive.
>
> Which django app do you use for photos?
>
> It would be great, if I could sync tags and notes between the GUI and the
> web app.
>
> I need these features:
>  - tags
>  - notes
>  - star rating
>  - access control: A user must only see these pictures which match to his
> groups/permissions.
>  - search by tag and date.
>
>
> Regards,
>   Thomas Güttler
>
>
>
>
> --
> Thomas Guettler, http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de
>
> --
> 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+unsubscribe@**
> 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-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.



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 want to do this generically, you could take an approach of looping
through all fields of a model and checking if each has a value before
printing. Something along the lines of this might work for you:

http://stackoverflow.com/questions/2217478/django-templates-loop-through-and-print-all-available-properties-of-an-object

Good luck!

On Thu, Oct 11, 2012 at 1:47 PM, Keir Lawson  wrote:

> Hello,
>
> I was wondering what the most elegant way (using a DetailView or similar)
> to display the fields of a model, excluding those that are empty?
>
> Thanks
>
> Keir
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/uYV-psryrHcJ.
> 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.
>

-- 
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.



Re: Javascript encoding and python decoding and vice versa

2012-10-11 Thread Kurtis Mullins
Sorry, you're probably right. I imagine there are no security risks related
to pulling a host-name from a DNS server. However, I do not know if the
case is the same for an HTTP Proxy when the query is included in the URL.

On Thu, Oct 11, 2012 at 11:14 AM, Javier Guerra Giraldez  wrote:

> 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 contained in POST and just like the others have
> > mentioned, simply go with SSL and Signed Certificates.
>
> ??
>
> AFAICT, GET and POST are exactly the same from both DNS, SSL and
> information theory points of view
>
> --
> 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-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.
>
>

-- 
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.



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 10:37 AM, Javier Guerra Giraldez  wrote:

> On Thu, Oct 11, 2012 at 3:39 AM, Laxmikant Gurnalkar
>  wrote:
> >  I'm using ssl at all. Still I need some data which is going through
> Ajax.
>
> i'm not sure i understand correctly.  do you mean "i'm _not_ using ssl
> at all", or "i'm using ssl for everything" ??
>
> if the former, then stop reading and turn everything to https (that's
> http in ssl).
> if the latter, then you're more than halfway through.
>
> with https and the correct certificates in your server, you get:
>
> - a secure channel
> - server identity verification
> - non-forgeable IP number of client
>
> what you don't get:
>
> A: client identity verification
> B: obscured data (aka. DRM)
> C: client code certification
>
> for A, just making sure that the user/password travel via SSL is
> usually enough.  but if you store that password somewhere, then it
> might be used by malicious code.  a crypto library can help (typically
> by a challenge-response protocol and HMACs), but since the client code
> (JS) is on the clear and on a user-controlled repository (the
> browser), then that part is somewhat lost cause.
>
> by B, I mean that any data you send and is decoded by JS client code
> is user-available and you can't control it anymore.  there are DRM
> schemes that allow client code to do some verifications before
> decrypting, but as repeatedly shown by DRM exploits, the simple fact
> that the client needs the decrypting keys means that somebody else
> would get them
>
> finally, C is what makes most of these issues next to impossible:
> there's no way that you can verify that the JS client code you're
> communicating with is what you want to be.  that's the main point of
> the last link i sent originally.
>
> from a security design point of view, you can carefully protect the
> data deep within your server; but at the far end (the user's eyes)
> it's no longer private.  that's common to all systems.  what you must
> do is determine which is the boundary between what's controllable and
> what not.
>
> in traditional client-server systems, you can (mostly) control client
> code, so the boundary might be the user's screen.
>
> but in web applications, by using SSL in the best possible way, the
> last place where you have privacy is the client's network port.
> everything beyond that (OS, browser, even your JavaScript code) is off
> your hands and must be treated as potentially hostile.
>
>
> > So, I suppose  that I can encrypt using crypto.js but how can I decrypt
> my
> > code in my python code.
>
> if using SSL, you don't have to.  the http sever (typically
> Apache/Nginx) handles the decoding.
>
> if using crypto.js (on top of SSL, never in place of), then just stay
> within well known crypto protocols and find the equivalent python
> library.  since there's no advantage in doubly-encrypting, i'd say
> don't bother with encryption.  where crypto.js (and others) can help
> you is with mutual verification, mostly using HMACs, Diffie-Hellman
> and other hash applications.
>
> note that SSL already does D-H to get mutual verification on the
> connection.
>
>
> > Just Wanted to let you know, I'm doing such stuff for first time. and i
> dont
> > want to take any risk over my data transer  while user is purchasing
> > something or etc.
>
>
>
> --
> 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-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.
>
>

-- 
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.



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 Django be deployed using CGI?"
>
> Cheers,
>  Tom :)
>

I'm not sure when/where you asked that question. It looked like this thread
was started by Sarbjit who asked three different questions.

To answer your question: Yes, it's possible.

-- 
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.



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
where your site is hitting an *insane* amount of traffic (unlikely,
statistsically speaking), there is at least one project which will take
your Django pages and turn them into static HTML so you can serve them
outside of Django using a very fast web server.

2. As others have said, CGI is simply one method (technically, an interface
standard) to dynamically generate content to be served by Web Servers.
Django would not be a substitute because Django is a Framework for building
Web Applications and CGI is an interface for serving content. However,
Django could be compared to a CGI Application and in that case it would,
basically, be a substitute.

3. Absolutely. Many web sites are built on Django. That's actually the
entire purpose behind it :)

On Wed, Oct 10, 2012 at 1:24 AM, Sarbjit singh wrote:

> First of all, I am very sorry for asking this basic question. I am not
> sure if this is the right place to put this question but I am very confused.
>
> I am not having much experience with web development, so i don't know
> where the Django fits in here. I searched a lot on internet, few forums
> suggested to use Django for websites and few mentioned that Django is not
> for web development. So i have couple of basic questions and i want to be
> sure that i am on right track in learning Django.
>
> Q: There are simple websites which just serves static contents and other
> site which deals with forms and data base. I have once used PHP for form
> processing and using it with DB. If i have to design such websites using
> Python, Is Django suitable for the following or there are some other
> modules which needs to be used.
>
> Q: Is Django a substitute to CGI for dynamic web generation.
>
> Q: Can i use Django for development of a full fledged website.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ksXPpVuDYSkJ.
> 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.
>

-- 
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.



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 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, the one time I've used it (required by a third
> party package) it wasn't the most pleasant experience in my opinion.
>
>
> On Wed, Oct 10, 2012 at 3:39 AM, Stefano Tranquillini <
> stefano.tranquill...@gmail.com> wrote:
>
>> Thanks.
>> one question: this works great if you are modifying user data. in fact,
>> you do the checking
>>
>> qs = super(RequestUpdateView, self).get_queryset()
>> return qs.filter(owner=self.request.user)
>>
>>
>> now. let's image i've a form (call it Task) that must be updated by
>> someone (or a group of user). how can i do this control?
>> do i have to put a "owner" field in the Task model and check it later or
>> django does something of this automatically or exists a predefined way to
>> do it?
>>
>> ciao.
>>
>> On Tuesday, October 9, 2012 5:14:50 PM UTC+2, Kurtis wrote:
>>
>>> Check out my example of the updateview here: http://stackoverflow.**
>>> com/questions/5531258/example-**of-django-class-based-**
>>> deleteview/10903943#10903943<http://stackoverflow.com/questions/5531258/example-of-django-class-based-deleteview/10903943#10903943>
>>>
>>> On Tue, Oct 9, 2012 at 10:48 AM, Stefano Tranquillini <
>>> stefano.tr...@gmail.**com> wrote:
>>>
>>>> Hi all.
>>>> I'm trying to let user update their values still having trouble.
>>>>
>>>> i've my models:
>>>>
>>>> class Language(models.Model):
>>>> name = models.CharField(max_length=**100,default='')
>>>> fb_id = models.IntegerField(default=0)
>>>>
>>>> def __unicode__(self):
>>>> return str(self.fb_id)
>>>>
>>>> class UserProfile(models.Model):
>>>> user = models.OneToOneField(User)
>>>> name = models.CharField(max_length=**100,default='')
>>>> surname = models.CharField(max_length=**100,default='')
>>>> birthday = models.DateField(default=**datetime.now, blank=True)
>>>> email = models.CharField(max_length=**100,default='')
>>>> locale = models.CharField(max_length=**100,default='')
>>>> picture = models.CharField(max_length=**255,default='')
>>>> gender = models.CharField(max_length=**100,default='')
>>>> hometown = models.CharField(max_length=**255,default='')
>>>> #languages goes as 1-M relation
>>>> languages = models.ManyToManyField(**Language)
>>>>  latitude = models.FloatField(default=0.0)
>>>> longitude = models.FloatField(default=0.0)
>>>> reward_dollars = models.DecimalField(decimal_**
>>>> places=2,max_digits=8,default=**0.0)
>>>> reward_time = models.IntegerField(default=0)
>>>> #checkins = models.TextField()
>>>>
>>>> def __unicode__(self):
>>>> return self.name+' '+self.surname
>>>>
>>>>
>>>> and i've create view and form
>>>>
>>>> class UpdateForm(BootstrapForm):
>>>> username = forms.CharField(label=(u'name'**))
>>>> name = forms.CharField(label=(u'**surname'))
>>>> class Meta:
>>>>  layout = (Fieldset("Test","name", "surname",))
>>>>
>>>> Here i used the 
>>>> https://github.com/earle/**django-bootstrap<https://github.com/earle/django-bootstrap>beacuse
>>>>  i've bootstrap as frontend.
>>>> *Question:* do i have to create the form manually? or can django
>>>> create it automatically for me?. in the second case, how can i deal with
>>>> M-to-M relation or with the fact that i don't want to display some fields?
>>>>
>>>> class UserProfileUpdate(UpdateView):
>>>> form_class = UpdateForm
>>>> model =

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, the one time I've used it (required by a third
party package) it wasn't the most pleasant experience in my opinion.

On Wed, Oct 10, 2012 at 3:39 AM, Stefano Tranquillini <
stefano.tranquill...@gmail.com> wrote:

> Thanks.
> one question: this works great if you are modifying user data. in fact,
> you do the checking
>
> qs = super(RequestUpdateView, self).get_queryset()
> return qs.filter(owner=self.request.user)
>
>
> now. let's image i've a form (call it Task) that must be updated by
> someone (or a group of user). how can i do this control?
> do i have to put a "owner" field in the Task model and check it later or
> django does something of this automatically or exists a predefined way to
> do it?
>
> ciao.
>
> On Tuesday, October 9, 2012 5:14:50 PM UTC+2, Kurtis wrote:
>
>> Check out my example of the updateview here: http://stackoverflow.**
>> com/questions/5531258/example-**of-django-class-based-**
>> deleteview/10903943#10903943
>>
>> On Tue, Oct 9, 2012 at 10:48 AM, Stefano Tranquillini <
>> stefano.tr...@gmail.**com> wrote:
>>
>>> Hi all.
>>> I'm trying to let user update their values still having trouble.
>>>
>>> i've my models:
>>>
>>> class Language(models.Model):
>>> name = models.CharField(max_length=**100,default='')
>>> fb_id = models.IntegerField(default=0)
>>>
>>> def __unicode__(self):
>>> return str(self.fb_id)
>>>
>>> class UserProfile(models.Model):
>>> user = models.OneToOneField(User)
>>> name = models.CharField(max_length=**100,default='')
>>> surname = models.CharField(max_length=**100,default='')
>>> birthday = models.DateField(default=**datetime.now, blank=True)
>>> email = models.CharField(max_length=**100,default='')
>>> locale = models.CharField(max_length=**100,default='')
>>> picture = models.CharField(max_length=**255,default='')
>>> gender = models.CharField(max_length=**100,default='')
>>> hometown = models.CharField(max_length=**255,default='')
>>> #languages goes as 1-M relation
>>> languages = models.ManyToManyField(**Language)
>>> latitude = models.FloatField(default=0.0)
>>> longitude = models.FloatField(default=0.0)
>>> reward_dollars = models.DecimalField(decimal_**
>>> places=2,max_digits=8,default=**0.0)
>>> reward_time = models.IntegerField(default=0)
>>> #checkins = models.TextField()
>>>
>>> def __unicode__(self):
>>> return self.name+' '+self.surname
>>>
>>>
>>> and i've create view and form
>>>
>>> class UpdateForm(BootstrapForm):
>>> username = forms.CharField(label=(u'name'**))
>>> name = forms.CharField(label=(u'**surname'))
>>> class Meta:
>>> layout = (Fieldset("Test","name", "surname",))
>>>
>>> Here i used the 
>>> https://github.com/earle/**django-bootstrapbeacuse
>>>  i've bootstrap as frontend.
>>> *Question:* do i have to create the form manually? or can django create
>>> it automatically for me?. in the second case, how can i deal with M-to-M
>>> relation or with the fact that i don't want to display some fields?
>>>
>>> class UserProfileUpdate(UpdateView):
>>> form_class = UpdateForm
>>> model = UserProfile
>>> template_name = 'userprofile_form.html'
>>>
>>> def get_object(self, queryset=None):
>>> return UserProfile.objects.get(user=**self.request.user)
>>>
>>>
>>> in the urls
>>>
>>> url(r'^profile/update/$',**UserProfileUpdate.as_view()),
>>>
>>>
>>>
>>> *Question:* here in the view i rewrote the get_object in order to get
>>> the current user. if i don't do it django wants a pk as parameters in the
>>> url, that's fine. but how can i assure that the user 1 can edits only the
>>> data of user 1 and not user 2. if he put /2/ in the url i get access to
>>> user 2 data.
>>> In addition to this, image to have a forum and people can edits  post.
>>> how can i assure that each user can modifty only its posts? so avoid the
>>> fact that calling /update/{{idsomeoneelsepost}} they can edit a post.
>>>
>>> *Question:* do i've to implement the saving things or django does it
>>> automatically when data are POST (if so, how can i do that?)
>>>
>>> *Problem: *right now what i get by running this code is: __init__() got
>>> an unexpected keyword argument 'instance'
>>>
>>> I know that they can sounds as basic question, but i found that
>>> documentation of django is too detailed and miss examples while
>>> stackexchange and the like are questions that not always appliy to my need.
>>> do you have a good website or book with tutorials (i see there's a similar
>>> post f

Re: accessing django

2012-10-09 Thread Kurtis Mullins
It depends on the computer, but I'd recommend using a Virtual Environment
and the program called 'pip'. Google can be your friend there :) Or if you
run into any specific problems, don't hesitate to ask!

On Tue, Oct 9, 2012 at 11:48 AM, Lewis Satini wrote:

> Thank guys 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 panel for doing something like that; but I'd recommend just using
>> the shell. It'll make life a lot easier in the long run.
>>
>>
>> On Tue, Oct 9, 2012 at 11:39 AM, Lewis Satini wrote:
>>
>>> Hello,
>>> I am sorry for misplace script and package. I am new to Django.
>>> so everytime when I need to install Django packages. I need to do it
>>> through command shell? is there any other way without going through command
>>> shell?
>>>
>>> Thanks
>>>
>>>
>>> On Tue, Oct 9, 2012 at 11:36 AM, Tom Evans wrote:
>>>
>>>> On Tue, Oct 9, 2012 at 4:29 PM, Lewis Satini 
>>>> wrote:
>>>> > For example, there's a script I want to install and everytime, I need
>>>> to
>>>> > access to the command shell to install it, but in the case of php I
>>>> can just
>>>> > unzip and upload to the server and access through browser.
>>>> > Can I do with that way? how is the process?
>>>> >
>>>>
>>>> Django doesn't work like PHP. In PHP, each PHP file is a single
>>>> "program" that is run when the web server loads that 'page'. In
>>>> django, there is a single "program" that runs and communicates with
>>>> the web server. There are no "Django scripts" for instance, there are
>>>> Django packages you can install which add functionality to your Django
>>>> "program".
>>>>
>>>> So no, you can't simply upload "scripts" to the web server with ftp,
>>>> not easily.
>>>>
>>>> Cheers
>>>>
>>>> Tom
>>>>
>>>> --
>>>> 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.
>>>>
>>>>
>>>
>>>
>>> --
>>> facebook.com/artistbean
>>> SMS at (646) 450-6756
>>>
>>> --
>>> 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.
>>>
>>
>>  --
>> 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.
>>
>
>
>
> --
> facebook.com/artistbean
> SMS at (646) 450-6756
>
> --
> 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.
>

-- 
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.



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, Laxmikant Gurnalkar wrote:
>
>>
>> Hi, Guys.
>>
>> Anybody knows to encrypt the content in javascript and decode it using
>> python and vice versa.
>>
>
> Not sure where you see the threat but if it is between the browser and the
> server then I think your server needs to provide https encryption.
>
> http://en.wikipedia.org/wiki/**HTTP_Secure
>
>
>
>  I am doing a high security data transfer. The things are showstopper to
>> transferring data through javascript to the python. Is it possible to
>> hide data or send data over web in that should not be  human readable.
>>
>> Thanks
>>
>>
>>
>>
>>
>> --
>> 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+unsubscribe@**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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> 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-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.



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 view: request.user_profile...
>
>
> On Sunday, October 7, 2012 8:37:01 PM UTC+2, Daniel Roseman wrote:
>>
>> On Sunday, 7 October 2012 17:43:19 UTC+1, Stefano T wrote:
>>
>>> Hi all.
>>> i just discovered the context processor, and i use it for put an object
>>> in the request automatically, this is the code:
>>>
>>> def addProfile(request):
>>> try:
>>> userProfile = UserProfile.objects.get(user=**request.user)
>>> return {'user_profile':userProfile}
>>> except:
>>> return {}
>>>
>>> this is the setting.py
>>>
>>> TEMPLATE_CONTEXT_PROCESSORS = (
>>> 'django.contrib.auth.context_**processors.auth',
>>> 'django.contrib.messages.**context_processors.messages',
>>> 'social_auth.context_**processors.social_auth_by_**type_backends',
>>> 'earth.context_processors.**addProfile',
>>> )
>>>
>>> now, it works, except one case.
>>> i've in a html page ajax call that sends some data to an url, here the
>>> JS:
>>>
>>> $.post("/geoloc/updateloc/", { latitude: lat, longitude: lon });
>>>
>>> mapped as
>>>
>>> url(r'^geoloc/updateloc/$', 'earth.views.updateLoc'),
>>>
>>>
>>> and here is the view:
>>>
>>> @login_required
>>> @csrf_protect
>>> def updateLoc(request):
>>> message={}
>>> message['status']='ko'
>>> if request.is_ajax():
>>> if request.method == 'POST':
>>> message['status']='ok'
>>> userProfile = request.user_profile
>>> userProfile.latitude=request.**POST['latitude']
>>> userProfile.longitude=request.**POST['longitude']
>>> userProfile.save()
>>> # Here we can access the POST data
>>> return HttpResponse(json.dumps(**message),
>>> mimetype="application/json")
>>>
>>> the fact is that in the view, the request.user_profile (which should be
>>> loaded by the context template) is empty or none. basically if i print it i
>>> don't have anything printed.
>>>
>>> basically: when is my context processor called?
>>> is it called  only for render_to_response or also for redirect or
>>> HTTPResponse or HTTPResponseRedirect?
>>> what should i do?
>>>
>>>
>>> thanks
>>>
>>> ciao
>>>
>>>
>>>
>>> --
>>> Stefano
>>>
>>
>>
>> The name of the setting should give you a clue:
>> TEMPLATE_CONTEXT_PROCESSOR. Context processors are for doing stuff to
>> template contexts. They have nothing whatsoever to do with views. If you're
>> not using a template, then context processor won't help you.
>> --
>> DR.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/SrWWDpVQ-joJ.
>
> 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.
>

-- 
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.



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> wrote:

> Thanks, for the response.
> I had a problem like this
>I was trying to create a  storesite which can be worked without django
> framework but using django. i.e just static template index.html &
> a java-script file. With all the stuff dynamically generated & only urls by
> the django, so that anybody can use my index.html, just calls my server for
> the url to display dynamic content using users information.
> so for this purpose I had a cookies resided in my browser and I was trying
> to create database objecst using javascript with api urls.
>
> When I studied CSRF in detail, I understood that, *private dynamic
>  javascript cookies *cannot be directly used to  retrieve or access the
> database related to your site. Hence, my javascript was considered by
> django as a *malicious/attack *content and thrown a 403 forbidden error.
> So I was trying to remove the CSRF from my project. But* Failed. Due to
> the same reason as you guys have told me.*
> *So on understanding CSRF  just removed code of cookies & just added
> parameters to url just before when user refreshes the page. And whole thing
> worked.  That was the Great  experience.*
> *
> *
> *anyways,*
> *Plz tell me if I can hv any other method to do this. adding parameters
> to url is definitely not secure always.*
> *
> *
> *One more thing I am using csrf_exempt to handle api views.*
> *
> *
> *Thanks a lot again.*
> *
> *
> On Sat, Oct 6, 2012 at 4:38 AM, Bill Freeman  wrote:
>
>> Right you are.
>>
>> On Fri, Oct 5, 2012 at 6:20 PM, Ian Clelland  wrote:
>> >
>> >
>> > On Friday, October 5, 2012, Bill Freeman wrote:
>> >>
>> >> I believe that I read somewhere that newer Djangos force the CSRF
>> >> middleware even if it's not listed in MIDDLEWARE_CLASSES.
>> >
>> >
>> > You might be thinking of the CSRF context processor, which is always
>> > enabled, no matter what is in settings. Even the most recent docs don't
>> say
>> > anything about forcing the middleware.
>> >>
>> >>
>> >> You could dive into the middleware code to see how this happens, and
>> >> come up with a stable strategy to circumvent it.  Or you could just
>> >> fix the necessary views and templates.  There is, after all, a chance
>> >> that you will want to be able to upgrade this site without jumping
>> >> through hoops.
>> >>
>> >> On Thu, Oct 4, 2012 at 4:56 AM, Laxmikant Gurnalkar
>> >>  wrote:
>> >> > Hi, Guys
>> >> >
>> >> > Disabling CSRF is not working.
>> >> > These are my midlewares., Removed {% csrf_token %} all templates.
>> >> >
>> >> > MIDDLEWARE_CLASSES = (
>> >> > 'django.middleware.common.CommonMiddleware',
>> >> > 'django.contrib.sessions.middleware.SessionMiddleware',
>> >> ># 'django.middleware.csrf.CsrfViewMiddleware',
>> >> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> >> > #'django.contrib.messages.middleware.MessageMiddleware',
>> >> > #'django.middleware.csrf.CsrfResponseMiddleware',
>> >> > # 'igp_acfs.acfs.disablecsrf.DisableCSRF',
>> >> > )
>> >> >
>> >> >
>> >> > Also tried by writing disablecsrf.py like this :
>> >> >
>> >> > class DisableCSRF(object):
>> >> > def process_request(self, request):
>> >> > """
>> >> > """
>> >> > setattr(request, '_dont_enforce_csrf_checks', True)
>> >> >
>> >> >
>> >> > Thanks in Advance!!!
>> >> >
>> >> > Laxmikant
>> >> >
>> >> > --
>> >> > 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.
>> >>
>> >> --
>> >> 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.
>> >>
>> >
>> >
>> > --
>> > Regards,
>> > Ian Clelland
>> > 
>> >
>> > --
>> > 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.
>>
>> --
>> You received this message because you are subscribed to

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 source and always work.
>
>
> 2012/10/4 Afshin Mehrabani 
>
>> Hey Kevin,
>>
>> Thanks for your correct reply, I had this problem also but after changing
>> host from "localhost" to "127.0.0.1" problem solved, But why? what's the
>> different between 'localhost' and '127.0.0.1'?
>>
>> On Wednesday, February 4, 2009 9:15:32 PM UTC+3:30, Kevin Audleman wrote:
>>>
>>> I found the solution in the archives: I changed DATABASE_HOST to
>>> 127.0.0.1 from ''
>>>
>>> Kevin
>>>
>>> On Feb 4, 9:41 am, Kevin Audleman  wrote:
>>> > Hello everyone,
>>> >
>>> > I am running through the tutorial and setting up my first django
>>> > project. Quite exciting! However I have run into trouble connecting to
>>> > MySQL. My settings.py file looks like this:
>>> >
>>> > DATABASE_ENGINE = 'mysql'   # 'postgresql_psycopg2',
>>> > 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
>>> > DATABASE_NAME = 'test' # Or path to database file if using
>>> > sqlite3.
>>> > DATABASE_USER = 'root' # Not used with sqlite3.
>>> > DATABASE_PASSWORD = '' # Not used with sqlite3.
>>> > DATABASE_HOST = '' # Set to empty string for localhost.
>>> > Not used with sqlite3.
>>> > DATABASE_PORT = '' # Set to empty string for default. Not
>>> > used with sqlite3.
>>> >
>>> > Yes, the username is 'root' and there is no password. This is on my
>>> > local machine (OS X 10.5) so it doesn't matter.
>>> >
>>> > When I run...
>>> >
>>> > $ python manage.py syncdb
>>> >
>>> > I get the following...
>>> >
>>> > Traceback (most recent call last):
>>> >   File "manage.py", line 11, in 
>>> > execute_manager(settings)
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > __init__.py", line 340, in execute_manager
>>> > utility.execute()
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > __init__.py", line 295, in execute
>>> > self.fetch_command(subcommand)**.run_from_argv(self.argv)
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > base.py", line 192, in run_from_argv
>>> > self.execute(*args, **options.__dict__)
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > base.py", line 218, in execute
>>> > self.validate()
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > base.py", line 246, in validate
>>> > num_errors = get_validation_errors(s, app)
>>> >   File "/Library/Python/2.5/site-**packages/django/core/**management/
>>> > validation.py", line 65, in get_validation_errors
>>> > connection.validation.**validate_field(e, opts, f)
>>> >   File "/Library/Python/2.5/site-**packages/django/db/backends/**mysql/
>>>
>>> > validation.py", line 8, in validate_field
>>> > db_version = connection.get_server_version(**)
>>> >   File "/Library/Python/2.5/site-**packages/django/db/backends/**mysql/
>>>
>>> > base.py", line 277, in get_server_version
>>> > self.cursor()
>>> >   File "/Library/Python/2.5/site-**packages/django/db/backends/
>>> > __init__.py", line 56, in cursor
>>> > cursor = self._cursor(settings)
>>> >   File "/Library/Python/2.5/site-**packages/django/db/backends/**mysql/
>>>
>>> > base.py", line 262, in _cursor
>>> > self.connection = Database.connect(**kwargs)
>>> >   File "/Users/audleman/django_**projects/pollster/__init__.py"**,
>>> line
>>> > 74, in Connect
>>> >
>>> >   File "/Library/Python/2.5/site-**packages/MySQL_python-1.2.2-**py2.5-
>>>
>>> > macosx-10.5-i386.egg/MySQLdb/**connections.py", line 170, in __init__
>>> > _mysql_exceptions.**OperationalError: (2002, "Can't connect to local
>>> > MySQL server through socket '/tmp/mysql.sock' (2)")
>>> >
>>> > I'm not exactly sure what this socket is or why django can't find it.
>>> > One thought is that I installed LAMP on my machine using XAMPP, which
>>> > puts everything in the /Applications/xampp directory. Poking around, I
>>> > managed to find a mysql.sock file here:
>>> >
>>> > /Applications/xampp/**xamppfiles/var/mysql/mysql.**sock
>>> >
>>> > Assuming this is the correct socket, how do I tell django where to
>>> > find it?
>>> >
>>> > Thanks,
>>> > Kevin
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/0dD75LGNe6UJ.
>> 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.
>>
>> --
>> با تشکر
>> اف

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 cool feature
>> prevent it for rendering it faster?
>
>
> The template parsing I guess, but I'm not sure.
>
> --
> 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.
>

-- 
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.



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 base and modify/use
accordingly.

I'm not sure on the best way to make proposals. Hopefully someone else can
chime in there for you.

On Thu, Oct 4, 2012 at 12:51 PM, Julian Cerruti
wrote:

> Apparently the current implementation of URLField rejects Web Sockets URLs
> such as ws://my.server.com/
>
> This seems to be due to the implementation of the underlying URLValidator,
> which has a regex to search for ftp or http based URLs only.
>
> Is there any chance the URLValidator regexp can be updated to include ws
> as a valid protocol qualifier too?
>
> Also, more generally, what is the recommended procedure for proposing
> changes (and accompanying code) such as this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ap-_kaacEngJ.
> 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.
>

-- 
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.



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 instead
> of money.
>
> Let's say there's an event. A birthday.
>
> If 5 people preorder the ticket there will be a clown*
> If 10 people preorder the ticket there will be a clown orchestra (in a
> small car)
> il 100 people preorder the ticket there will be a golden statue of a clown.
>
> I have no problem with the "buying tickets thing", but I couldn't find in
> django-packages anything related to milestones or goals.
>
> Do you know if there is already something I can use? Or should I create it?
>
> Thanks!
>
> * if you hate clowns you can replace them with cookies
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/2y9biFnbiIUJ.
> 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.
>

-- 
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.



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-based
> generic views with url names is:
>
>> success_url = reverse_lazy('my_url_name')
>
>
> On Wednesday, September 21, 2011 4:53:56 PM UTC-3, Xavier Ordoquy wrote:
>
>> Hi,
>>
>> You can also use get_success_url for that:
>>
>> class ContactView(generic.FormView):
>> form_class = ContactForm
>>
>> def get_success_url(self):
>> return reverse('contact-sent')
>>
>> Regards,
>> Xavier
>>
>> Linovia.
>>
>> Le 21 sept. 2011 à 00:08, Daniel P a écrit :
>>
>> > Same problem. You'r not alone!
>> >
>> > this is also a solution: 
>> > http://djangosnippets.org/**snippets/2445/
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> > To post to this group, send email to django...@googlegroups.com.
>> > To unsubscribe from this group, send email to django-users...@**
>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/bm1tU2fvPAAJ.
>
> 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.
>

-- 
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.



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 so far.  I can modify
> registration and activation, but then django.contrib.auth.views.login has a
> 30-character limit on the username.  I'm not looking forward to making
> username act like an email address.  Any quick fixes?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/E4GTF1wAPZ8J.
> 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.
>

-- 
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.



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

2012-09-14 Thread Kurtis Mullins
Thanks for looking into it, Russ!

On Fri, Sep 14, 2012 at 9:24 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> Hi,
>
> Unfortunately, this appears to be a problem with (yet another) service
> provider not playing nice with mailing lists. Someone has subscribed
> to Django Users, and their mail provider (China Mobile in this case)
> has decided to reply to the original author, instead of the "reply to"
> address.
>
> This happens from time to time; we occasionally get the same effect
> when someone's mailbox fills up. The only way to resolve the issue is
> to identify the rogue subscription, and kill it.
>
> However, to compound matters, the "find members" functionality on
> Google Groups is fairly limited, and in this case, it probably
> wouldn't help anyway - the message is from an automated service that
> passes email messages to an SMS number -- 13672725001 looks to me like
> a Chinese cell phone number.
>
> If anyone is able to identify the rogue subscription, I'll gladly kill
> it; but there's not much we can do otherwise.
>
> Yours,
> Russ Magee %-)
>
> On Fri, Sep 14, 2012 at 11:43 PM, Nikolas Stevenson-Molnar
>  wrote:
> > It seems to me that I get one of these emails for every post I make,
> about
> > one day later. That includes replies to this very thread. I think they
> come
> > from the same email 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).
> >
> > _Nik
> >
> >
> > On 9/13/2012 7:53 PM, Kurtis Mullins wrote:
> >
> > 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)
> > as the user responsible.
> >
> > On Thu, Sep 13, 2012 at 10:32 PM, Rivsen  wrote:
> >>
> >> 13672725...@139.com , he has canceled his cell phone number, please
> >> administrator kick him.
> >>
> >> I use my phone call this number and be informed that the number no
> longer
> >> exists.
> >>
> >>
> >> 2012/9/13 Rivsen 
> >>>
> >>> I received this e-mail too. It's about someone using 139.com email
> join
> >>> the group, and now this e-mail address was closed by 139.
> >>>
> >>> Maybe hes mobile phone lost or arrears.
> >>>
> >>>
> >>> 2012/9/13 Jon Blake 
> >>>>
> >>>> I've had a coup[le of these, now.
> >>>>
> >>>>
> >>>> On Tuesday, September 11, 2012 5:27:59 AM UTC+10, Kurtis wrote:
> >>>>>
> >>>>> I just received a very unusual e-mail that included a recent post's
> >>>>> subject. The post in question was: "Re: form doesn't validate when
> trying to
> >>>>> upload file". It was sent directly to my email address; by-passing
> the User
> >>>>> Group.
> >>>>>
> >>>>> Google roughly translated this email as coming from "China Mobile"
> and
> >>>>> included the domain "139.com". Has anyone else seen this sort of
> thing?
> >>>>> Unfortunately, I am unable to read the language and the Google
> Translation
> >>>>> isn't very clear; but it's definitely displayed using a very clean
> and fancy
> >>>>> template. I'm not sure if it's spam or something else.
> >>>>>
> >>>>> Just figured I'd see if anyone else has gotten an email similar to
> >>>>> this. Thanks.
> >>>>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "Django users" group.
> >>>> To view this discussion on the web visit
> >>>> https://groups.google.com/d/msg/django-users/-/yZnQCJfOEekJ.
> >>>>
> >>>> 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

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) as the user responsible.

On Thu, Sep 13, 2012 at 10:32 PM, Rivsen  wrote:

> 13672725...@139.com , he has canceled his cell phone number, please
> administrator kick him.
>
> I use my phone call this number and be informed that the number no longer
> exists.
>
>
> 2012/9/13 Rivsen 
>
>> I received this e-mail too. It's about someone using 139.com email join
>> the group, and now this e-mail address was closed by 139.
>>
>> Maybe hes mobile phone lost or arrears.
>>
>>
>> 2012/9/13 Jon Blake 
>>
>>> I've had a coup[le of these, now.
>>>
>>>
>>> On Tuesday, September 11, 2012 5:27:59 AM UTC+10, Kurtis wrote:

 I just received a very unusual e-mail that included a recent post's
 subject. The post in question was: "Re: form doesn't validate when trying
 to upload file". It was sent directly to my email address; by-passing the
 User Group.

 Google roughly translated this email as coming from "China Mobile" and
 included the domain "139.com". Has anyone else seen this sort of
 thing? Unfortunately, I am unable to read the language and the Google
 Translation isn't very clear; but it's definitely displayed using a very
 clean and fancy template. I'm not sure if it's spam or something else.

 Just figured I'd see if anyone else has gotten an email similar to
 this. Thanks.

>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/yZnQCJfOEekJ.
>>>
>>> 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.
>>>
>>
>>
>  --
> 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.
>

-- 
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.



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 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het
> volgende:
>
>> I'm a newbie following the tutorial. In this, creating a superuser is
>> described, using
>>
>> manage.py createsuperuser --username=joe --email=j...@example.com
>>
>>
>> Using this leads to an error, which I could match to the closed ticket
>> #16017.
>>
>> But I couldn't find how to proceed from there. It seems some software was
>> changed about 4 weeks ago:
>> "Made createsuperuser more robust when getting current OS username."
>>
>> So where can I find it?
>> [I'm assuming there is a procedure for this, but I'm sorry to say I
>> couldn't find that either]
>>
>> Regards,
>> Bob
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/shAajf44XV4J.
>
> 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.
>

-- 
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.



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 email address.

What I really want to do is determine the exception/error-type so that I
can handle it appropriately.

On Wed, Sep 12, 2012 at 7:09 PM, Kurtis  wrote:

> Hey Guys,
>
> Do you have any suggestions on a good way to grab error types during Model
> Validation? I'm not using Forms or HTML. First, here's a simplified snippet
> showing my current format for Model Data Validation.
>
> my_object = MyModel(**data_dict)
> try:
> my_object.full_clean()
> my_object.save()
> return SuccessJSONResponse()
> except ValidationError, e:
> print e.message_dict # Testing
> # ... build some custom JSON data from the error
> return ErrorJSONResponse(json_data)
>
> This works fine for properly validating the data and being able to print
> out errors. It also allows me to easily see which fields threw errors.
> Unfortunately, it doesn't provide me with the types of errors in a
> "programmatic" fashion as far as I can tell. For example, a field can fail
> because it's a duplicate entry or it can fail because it didn't meet the
> criteria of the field-type (e.g. max_length).
>
> What I'm hoping for is there's a way I can still easily validate my data
> using my Model but get more specific information about the types of errors.
> If it's an IntegrityError then I need to build a custom response indicating
> which field had failed along with an "internal" (to the project) error code
> and a description. If it's some other specific error (for example, maybe an
> email address isn't a "valid" email address) then I'd like to identify the
> error type, field name, and display that error accordingly. Hopefully that
> makes sense :)
>
> I'm not sure if I'm just over-looking something or trying to do things the
> hard way but I'm up for suggestions. Keep in mind that Forms + HTML are out
> of the question since this is an API-only application.
>
> Thanks!
> - Kurtis
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/7CS8sJxLHhwJ.
> 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.
>

-- 
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.



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:18 PM, Nikolas Stevenson-Molnar <
> nik.mol...@consbio.org> wrote:
>
>>  Looking at Google's translation of the text, I would guess it's
>> informing you that you need to be on that user's whitelist: "You send is
>> not activated 139 mailbox user's mail seven days will be deleted by the
>> system, please to notify Friends timely activation to receive e-mail."
>>
>> In other words, this user needs to specifically approve people to receive
>> email from. Usually Google is good about filtering out auto-responses and
>> the like, but it seems to be missing this one.
>>
>> _Nik
>>
>>
>> On 9/12/2012 2:15 PM, Nikolas Stevenson-Molnar wrote:
>>
>> I just got the same email after replying to a message.
>>
>> _Nik
>>
>> On 9/10/2012 7:28 PM, Rivsen wrote:
>>
>> Maybe someone use 139 email, ask group manager check this and contact
>> that one who use 139 email.
>>
>> 2012/9/11 Brad Pitcher 
>>
>>> Yes, I received a similar email about the post "Re: I can't install
>>> django on my mac. I'm not sure wh..." which I recently responded to. Not
>>> sure what to make of it.
>>>
>>>
>>> On Mon, Sep 10, 2012 at 12:27 PM, Kurtis wrote:
>>>
 I just received a very unusual e-mail that included a recent post's
 subject. The post in question was: "Re: form doesn't validate when trying
 to upload file". It was sent directly to my email address; by-passing the
 User Group.

  Google roughly translated this email as coming from "China Mobile"
 and included the domain "139.com". Has anyone else seen this sort of
 thing? Unfortunately, I am unable to read the language and the Google
 Translation isn't very clear; but it's definitely displayed using a very
 clean and fancy template. I'm not sure if it's spam or something else.

  Just figured I'd see if anyone else has gotten an email similar to
 this. Thanks.
  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/django-users/-/cs6UrXOcBOkJ.
 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.

>>>
>>> --
>>> 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.
>>>
>>
>> --
>> 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.
>>
>>
>>
>>  --
>> 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.
>>
>
>  --
> 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.
>

-- 
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.



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 those is "no", then you may want to dive in to some
iOS coding first. Alternatively, skip to #2:

2. Do you know how to program Django Applications? If so, do you have a
pretty good understanding of the Server-Client Paradigm?

There's many different approaches you can take to this problem. One
approach would be to create an iOS Application which uses a Django
Application as a "back-end". Another approach would be to simply write a
Django Application and use HTML to make the web site look like a native iOS
Application. There's pros and cons to each of these methods. One or the
other may be easier dependent upon what you're trying to accomplish in this
particular Mobile Application as well as your skill level and how much
time/motivation you have to learn new technologies.

On Tue, Sep 11, 2012 at 3:41 PM, Sait Maraşlıoğlu wrote:

> What do you mean by api wrapper, ur previous link a bit complicated and Im
> having a hard time understanding this term, can u explain in a smiple
> manner?
>
>
>
> On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> It would be a cold day in hell before I ever used XML for an API ;)
>>
>> There's a whole ton of API wrappers for Django (hell you could write your
>> own in under 50 lines of code), but here is a pretty good one:
>>
>> http://django-tastypie.**readthedocs.org/en/latest/**index.html
>>
>>
>> Tastypie is a bit complex to look at, but it is sane and ensures you keep
>> to good security and design principles.
>>
>> Hope this helps!
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch  wrote:
>>
>>> Can you tell me how do i do that?
>>> Do you have any kind of blog or tutorial which would help me out
>>> connecting the web API's with iphone.
>>>
>>> Do you suggest JSON or XML ?
>>>
>>>
>>> On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming
>>> [Simplicity Media Ltd] wrote:
>>>
 You can create a server side API for the app - but the actual interface
 is done using the methods mentioned by Mario previously.

 Cal

 On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:

> Nope. You do objective c or html and js with something like phonegap
> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:
>
>>  How do you create iphone applications via django.
>> Application logic will be django but what about user interface, do we
>> do that with django too?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit https://groups.google.com/d/
>> **ms**g/django-users/-/**xL4mqQobAEUJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> 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...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> 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 view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**J44uT5ivqbIJ
>>> .
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/F73khMkPWO4J.
>
> 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

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
ways to make money around free software (laid out by RMS among others) such
as Paid Support, selling printed documentation, etc...

On Tue, Sep 11, 2012 at 1:36 PM, Jorge Vargas wrote:

> I agree with Jonas here. having a place were you have get apps to solve
> hard problems no one has done right (ecommerce is a very good example) is a
> plus.
>
> As for it being "cancer" and bad I don't agree there is a market for
> everything. And that will bring more people in which in the end is what
> everyone wants.
> I do agree that it should be clear that said store will be managed by a
> third party and not Django itself.
>
>
> On Tue, Sep 11, 2012 at 7:11 AM,  wrote:
>
>>
>>
>>> I want to ask you again, what you think about such service? Would you
>>> buy or sell apps (or paid support) out there and why?
>>>
>>>
>> If the apps are more then good enough and would spare companies time and
>> there are no better or equal opensource alternatives,
>> then yes I do believe some people might be willing to buy apps in such a
>> market place. For example there is no real outstanding e-commerce
>> application for django.
>>
>>
>> --
>> 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+unsubscribe@**
>> 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-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.
>

-- 
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.



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  wrote:

> I have it like this, with filefield, in my first question I'm just posting
>> the generated model from inspectdb and underneath I'm saying that I change
>> it to FileField..
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LYyL0YvwrVUJ.
>
> 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.
>

-- 
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.



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 AM, mapapage  wrote:

> as I say in my last reply, I include the multi part header and it doesn't
>> work! :( What else I can try?
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/NpTYlQAR80sJ.
>
> 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.
>

-- 
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.



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 doc you have to pass all relevant QueryDicts to the form
> __init__
> when you are creating a bound instance. In a nutshell make sure your doing:
>
> # The view function
> def handle_upload(request):
> # Get request logic ...
> if request.method == "POST":
> form = LicenceForm(request.POST, request.FILES)
> if form.is_valid():
>#save input data
>form.save()
>#continue with other stuff
>
> More on the docs:
> https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#handling-uploaded-files-with-a-model
>
>
>
> On Sun, Sep 9, 2012 at 5:56 PM, mapapage  wrote:
>
>> Hi! It's my first time trying to achieve the ''file upload functionality'
>> and I need your help. I'm working on a legacy db and I'm supposed to do the
>> file upload in a table that gets created this way:
>>
>> CREATE TABLE  "LICENCE"
>>( "ID" NUMBER NOT NULL ENABLE,
>>  "VEH_ID" NUMBER NOT NULL ENABLE,
>>  "DTP_ID" NUMBER NOT NULL ENABLE,
>>  "LICENCENO" VARCHAR2(50 CHAR) NOT NULL ENABLE,
>>  "ISSUEDATE" DATE,
>>  "STARTDATE" DATE,
>>  "EXPIREDATE" DATE,
>>  "DOCPATH" VARCHAR2(500 CHAR),
>>  "CHECKFLAG" NUMBER(1,0) NOT NULL ENABLE,
>>   CONSTRAINT "LIC_PK" PRIMARY KEY ("ID") ENABLE,
>>   CONSTRAINT "LIC_DTP_FK" FOREIGN KEY ("DTP_ID")
>>REFERENCES  "DOCTYPES" ("ID") ENABLE,
>>   CONSTRAINT "LIC_VEH_FK" FOREIGN KEY ("VEH_ID")
>>REFERENCES  "VEHICLES" ("ID") ENABLE
>>)
>> /
>>
>> With inspectdb, I got this table:
>>
>> class Licence(models.Model):
>>
>> id = models.DecimalField(unique=True, primary_key=True, max_digits=127, 
>> decimal_places=0)
>> veh_id = models.ForeignKey(Vehicles, db_column='veh_id')
>> dtp_id = models.ForeignKey(Doctypes, db_column='dtp_id')
>> licenceno = models.CharField(max_length=200)
>> issuedate = models.DateField(null=True, blank=True)
>> startdate = models.DateField(null=True, blank=True)
>> expiredate = models.DateField(max_length=2000, blank=True)
>> docpath = models.CharField(max_length=200)
>> checkflag = models.IntegerField()
>>
>> def __unicode__(self):
>> return self.licenceno
>>
>>
>> How should I handle the upload?My thought after reading the file upload 
>> documentation was to modify the docpath to filefield. Is that the right 
>> practice?Because I tried it, and the form doesn't validate, I get the error 
>> "No file chosen". Can anyone guide me through this?Thank you..
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/eo_e4m3hye8J.
>> 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.
>>
>
>  --
> 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.
>

-- 
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.



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
Django to use :) You *could* make it work but you may have better luck
building a solution from a smaller framework or possibly find something out
there that fits your needs better.

On Sat, Sep 8, 2012 at 4:05 PM, LuckySMack  wrote:

> I am currently starting work on a a project that is rest based. In order
> to use django as a rest based system I have to use another library on top
> of it. I've seen that there are a couple out there. But this system will be
> an advanced rest a pi that will allow me to talk to my database, and allow
> other instances of the app to talk to each other. And as cool as django
> seems to get up and running quickly, I'm not sure if its a right fit. It
> seems a bit complex. My app will likely only have one or 2 models as the
> core. And I won't be using djangos orm as I will be needing a db like
> neo4j, titan, or orientdb.
>
> Now that is the core, that will be shared by about a half dozen apps. They
> will all build on top of that. And I feel like django might be too bloated
> or big or complex. The base a pi could probably done by an experienced
> python dev in flask or bottle in a few days time. It doesn't have any ui.
> In comparison I'm also thinking about implementing it in pyramid too. But
> I'm curious as if you guys think it will work in django.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Iiuk6V4TSHQJ.
> 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.
>
>

-- 
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.



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:
> > I've developed a GUI for creating models, see
> > https://github.com/timothyclemans/django-admin-models-editor
> >
> > Would this be helpful for developers? Would it be useful for you? Should
> I
> > keep developing it? What features would you like to see added?
>
> personally, i much prefer the reverse approach:  i write the models,
> and a tool (ie. django-extensions) generates a graphical
> representation.
>
> pros:
>  - the final models are exactly what i want them to be.  even if the
> graphical tool doesn't support some obscure Django feature, i can
> still use it; it's just not shown graphically.
>
>  - i don't have to learn a different (graphical) language
>
>  - i keep fluent in the real Django language, so i don't have to
> relearn it when for any reason i don't have to use that tool.
>
> cons:
>   - less sexy than not writing code
>
> --
> 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-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.
>
>

-- 
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.



Re: Site Architecture

2012-09-07 Thread Kurtis Mullins
Tom,

I agree with you. If it's done right, it can be a very valuable design. I
believe Amazon, internally, is setup in a similar fashion; everything is a
service. They're obviously doing pretty well.

However, if it's not done right, then it's easy to run into large problems.
Just as a tiny and probably over-simplified example, if a User accesses a
Django-rendered page, which in turn accesses a web-service, which in turn
accesses a database, there's 3 points of potential failure and quite a bit
of error handling involved to make sure this works correctly or at least
notifies the user of a problem within a fashionable amount of time (e.g.
before their browser times out). Then there's always the complexity added
when trying to synchronize development among multiple systems.

I'm not saying it's a bad idea; when done right and with enough resources,
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, 2012 at 4:19 PM, Kurtis Mullins 
> wrote:
> > 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 be a great approach.
> >
> > With that said, I have accessed many APIs through Django including some
> > critical systems (such as billing systems) and have not had too much
> > trouble. Again, just make sure to check for errors and time-outs
> properly or
> > else your customers may have some weird issues that could be difficult to
> > debug.
> >
> > If at all possible, this would be the way I'd go. Of course it depends
> on if
> > the "Rest Services" are something you own.
> >
> > Database -> Django -> HTML
> >
> > While that may take quite a bit of initial work to re-do, the simplicity
> it
> > would offer could pay off in dividends.
> >
> > Good luck!
> >
>
> At $JOB we revolve around SOA - Service Oriented Architecture. Many of
> our website frontends communicate with datamart backends. Our
> downloadable documents are produced by pushing data to
> excel/powerpoint/doc/pdf rendering services. Our graphs are drawn by
> pushing data to graph services.
>
> Rather than making things complex, this massively reduces complexity.
> Each service has clearly designated boundaries, goals and KPIs, which
> increases reliability. We don't seem to have issues with latency or
> hold ups; in fact, I think everything runs slightly better in this
> model, as each website is no longer doing much heavy lifting
> particularly.
>
> With better encapsulation and separation of concerns comes better
> reliability and an understanding of where performance gains can be
> made, as well as implicitly better allowing for scale out.
>
> So, personally, I wouldn't rule out the OP's original plan for
> complexity reasons.
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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.



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 be a great approach.

With that said, I have accessed many APIs through Django including some
critical systems (such as billing systems) and have not had too much
trouble. Again, just make sure to check for errors and time-outs properly
or else your customers may have some weird issues that could be difficult
to debug.

If at all possible, this would be the way I'd go. Of course it depends on
if the "Rest Services" are something you own.

Database -> Django -> HTML

While that may take quite a bit of initial work to re-do, the simplicity it
would offer could pay off in dividends.

Good luck!

On Fri, Sep 7, 2012 at 10:51 AM, Jeff Regan  wrote:

> Thanks for the reply.
>
> I wanted to use Django for the templating engine and, in the future, some
> of the open source applications (commenting, graphing, and blogs for
> example) that were built as Django apps.  Also, I like being able to build
> my urls.
>
> After discussing the web architecture with one of the other developers at
> my company, we came up with the below.  What do you think?
>
> Database -> Services Project -> Reference to Services Project -> Django
> Views -> Django Urls -> HttpPosts to Django with jQuery -> HTML/jQuery
>
> We're debating whether the Django project should talk to the services
> project over http requests or by importing the project.  Importing the
> project allows us to have secure functionality that we don't have to worry
> about exposing to the internet.  Also, it would allow for a faster and more
> reliable connection to the backend.  Consuming data over Http requests
> gives the web application a similar architecture as the other applications
> (phones, outside apps) that do the same.  It also puts the services project
> out on it's own island.  It may seem obvious, but the other developer was
> in favor of importing the project.  I like to be consistent with the things
> I do, and was in favor of accessing resources using Http requests.
>
> Thanks,
> Jeff
>
> On Fri, Sep 7, 2012 at 4:34 AM, Babatunde Akinyanmi 
> wrote:
>
>> I'm hardly a pro but I think the answer to your question will depend
>> on why you want to add django to the stack
>>
>>
>> On 9/7/12, Jeff Regan  wrote:
>> > I'm not much of an architect and am pretty new to Django, so I was
>> hoping I
>> >
>> > could get some advice. Currently our site is html/jQuery and all the
>> data
>> > is accessed through Javascript calls to rest services.
>> > Data -> Rest Services -> HTML/jQuery
>> >
>> > I was planning on putting a Django layer between the client and the rest
>> > services.
>> > Data -> Rest Services -> Django -> HTML/jQuery
>> >
>> > I'd use jQuery to send post requests to Django urls(routed to views).
>>  The
>> > views would then call the rest layer to retrieve the data, and pass the
>> > response to the front end.
>> >
>> > Does anyone see a problem with this approach?  Is there anything I
>> should
>> > be aware of?  Are there other sites that took a similar approach?
>> >
>> > I appreciate any help.
>> >
>> > Thanks,
>> > Jeff
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/django-users/-/Cpw8-j0ZqlEJ.
>> > 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.
>> >
>> >
>>
>> --
>> Sent from my mobile device
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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.



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 going because there
> are so many dependencies.  It's hard to gather all of the right packages
> just to get through the Django tutorial.
>
>
> On Thursday, September 6, 2012 6:59:02 AM UTC-7, Demian Brecht wrote:
>
>> You *can* install Django on Linux, Mac or Windows. Choose the
>> environment that you're most accustomed to if you're just trying to
>> get things done. However, if you want to learn Linux at the same time
>> (at least, bits of it), then I fully endorse going down that path.
>>
>> On Wed, Sep 5, 2012 at 9:19 PM, ecs1749  wrote:
>> >
>> > Ok, ok.  I now have a Ubuntu/server with a Ubuntu desktop running using
>> oracle vm virtualbox.   I know almost nothing about Linux.  I don't even
>> know how to ssh to this beast sitting in front of me.  I  hope this is a
>> start...
>> >
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/1pD4k3PdhtEJ.
>
> 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.
>

-- 
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.



Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
Actually, I take that back. I did some quick reading and found this from
Selenium's FAQ (http://selenium-grid.seleniumhq.org/faq.html)

"
Selenium Grid is not designed for performance and load testing, but very
efficient web acceptance/functional testing. The main reason for this is
that conducting performance/load testing with real browser is a pretty bad
idea as it is hard/expensive to scale the load and the actual load is very
inconsistent.

For load/performance testing I would advise using tools like JMeter,
Grinder or httperf. What you can do though, is reuse your selenium tests to
record the use cases you will use for your load testing. If you really want
to conduct load testing with Selenium, check out Browser Mob.

To simulate 200 concurrent users for instance, you would need 200
concurrent browsers with a load testing framework based on Selenium Grid.
Even if you use 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 problem! Alternatively, you may have some luck with Selenium ...
> although I have no experience here and am not sure if it can be made to
> record times or any other indication of performance.
> http://seleniumhq.org/
>
>
> On Wed, Sep 5, 2012 at 2:48 PM, Larry Martell wrote:
>
>> Thanks Kurtis!
>>
>>
>> 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 from a page (for example, as part of a form),
>> here's
>> > one example solution I found:
>> >
>> http://stackoverflow.com/questions/3145178/get-contents-of-a-tags-using-python
>> > -- of course you'd want to grab the appropriate HTML Element.
>> >
>> > Here's an example of setting and getting cookies:
>> >
>> http://stackoverflow.com/questions/5606083/how-to-set-and-retrieve-cookie-in-http-header-in-python
>> >
>> > Here's some docs on the how to make the CSRF System happy:
>> > https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-works
>> >
>> > On Wed, Sep 5, 2012 at 2:38 PM, Larry Martell 
>> > wrote:
>> >>
>> >> I have no idea how that would be done (neither extracting the token
>> >> nor passing it via urllib). I'm googling this, but if you know and
>> >> want to share, that would be great.
>> >>
>> >> On Wed, Sep 5, 2012 at 1:50 PM, Kurtis Mullins <
>> kurtis.mull...@gmail.com>
>> >> 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
>> >> > token from the login page, login with a known (test) user, and
>> continue
>> >> > passing and extracting the CSRF token as needed?
>> >> >
>> >> >
>> >> > On Wed, Sep 5, 2012 at 1:06 PM, Larry Martell <
>> larry.mart...@gmail.com>
>> >> > 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:
>> >> >> >
>> >> >> > from django.contrib.auth.models import User
>> >> >> >
>> >> >> > towards the top :)
>> >> >> >
>> >> >> >
>> >> >> > On Wed, Sep 5, 2012 at 12:57 PM, Larry Martell
>> >> >> > 
>> >> >> > wrote:
>> >> >> >>
>> >> >> >> On Wed, Sep 5, 2012 at 12:21 PM, anthony tresontani
>> >> >> >>  wrote:
>> >> >> >> > We are using a middleware to enforce a user login:
>> >> >> >> >
>> >> >> >> > class AutoAuthMiddleware(object):
>> >> >> >> > """
>> >> >> >> >

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
No problem! Alternatively, you may have some luck with Selenium ...
although I have no experience here and am not sure if it can be made to
record times or any other indication of performance.
http://seleniumhq.org/

On Wed, Sep 5, 2012 at 2:48 PM, Larry Martell wrote:

> Thanks Kurtis!
>
>
> 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 from a page (for example, as part of a form),
> here's
> > one example solution I found:
> >
> http://stackoverflow.com/questions/3145178/get-contents-of-a-tags-using-python
> > -- of course you'd want to grab the appropriate HTML Element.
> >
> > Here's an example of setting and getting cookies:
> >
> http://stackoverflow.com/questions/5606083/how-to-set-and-retrieve-cookie-in-http-header-in-python
> >
> > Here's some docs on the how to make the CSRF System happy:
> > https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-works
> >
> > On Wed, Sep 5, 2012 at 2:38 PM, Larry Martell 
> > wrote:
> >>
> >> I have no idea how that would be done (neither extracting the token
> >> nor passing it via urllib). I'm googling this, but if you know and
> >> want to share, that would be great.
> >>
> >> On Wed, Sep 5, 2012 at 1:50 PM, Kurtis Mullins <
> kurtis.mull...@gmail.com>
> >> 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
> >> > token from the login page, login with a known (test) user, and
> continue
> >> > passing and extracting the CSRF token as needed?
> >> >
> >> >
> >> > On Wed, Sep 5, 2012 at 1:06 PM, Larry Martell <
> larry.mart...@gmail.com>
> >> > 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:
> >> >> >
> >> >> > from django.contrib.auth.models import User
> >> >> >
> >> >> > towards the top :)
> >> >> >
> >> >> >
> >> >> > On Wed, Sep 5, 2012 at 12:57 PM, Larry Martell
> >> >> > 
> >> >> > wrote:
> >> >> >>
> >> >> >> On Wed, Sep 5, 2012 at 12:21 PM, anthony tresontani
> >> >> >>  wrote:
> >> >> >> > We are using a middleware to enforce a user login:
> >> >> >> >
> >> >> >> > class AutoAuthMiddleware(object):
> >> >> >> > """
> >> >> >> > Middleware for testing purpose only.
> >> >> >> > Can enforce the user login.
> >> >> >> > """
> >> >> >> >
> >> >> >> > def process_request(self, request):
> >> >> >> > enforce_user = request.GET.get("enforce_user", None)
> >> >> >> > if hasattr(request, "user") and not enforce_user:
> >> >> >> > return
> >> >> >> >
> >> >> >> > user = User.objects.filter(username = enforce_user)
> >> >> >>
> >> >> >>
> >> >> >> I'm getting: 'NameError: "global name 'User' is not defined"' on
> the
> >> >> >> above line. This is the same issue I was running into when I was
> >> >> >> trying to hard code the initialization of a request.user object.
> >> >> >> Where
> >> >> >> is that defined?
> >> >> >>
> >> >> >>
> >> >> >> > if user:
> >> >> >> > backend = get_backends()[0]
> >> >> >> > user = user[0]
> >> >> >> > user.backend = "%s.%s" % (b

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
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 from a page (for example, as part of a form),
here's one example solution I found:
http://stackoverflow.com/questions/3145178/get-contents-of-a-tags-using-python
--
of course you'd want to grab the appropriate HTML Element.

Here's an example of setting and getting cookies:
http://stackoverflow.com/questions/5606083/how-to-set-and-retrieve-cookie-in-http-header-in-python

Here's some docs on the how to make the CSRF System happy:
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-it-works

On Wed, Sep 5, 2012 at 2:38 PM, Larry Martell wrote:

> I have no idea how that would be done (neither extracting the token
> nor passing it via urllib). I'm googling this, but if you know and
> 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
> > token from the login page, login with a known (test) user, and continue
> > passing and extracting the CSRF token as needed?
> >
> >
> > On Wed, Sep 5, 2012 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:
> >> >
> >> > from django.contrib.auth.models import User
> >> >
> >> > towards the top :)
> >> >
> >> >
> >> > On Wed, Sep 5, 2012 at 12:57 PM, Larry Martell <
> larry.mart...@gmail.com>
> >> > wrote:
> >> >>
> >> >> On Wed, Sep 5, 2012 at 12:21 PM, anthony tresontani
> >> >>  wrote:
> >> >> > We are using a middleware to enforce a user login:
> >> >> >
> >> >> > class AutoAuthMiddleware(object):
> >> >> > """
> >> >> > Middleware for testing purpose only.
> >> >> > Can enforce the user login.
> >> >> > """
> >> >> >
> >> >> > def process_request(self, request):
> >> >> > enforce_user = request.GET.get("enforce_user", None)
> >> >> > if hasattr(request, "user") and not enforce_user:
> >> >> > return
> >> >> >
> >> >> > user = User.objects.filter(username = enforce_user)
> >> >>
> >> >>
> >> >> I'm getting: 'NameError: "global name 'User' is not defined"' on the
> >> >> above line. This is the same issue I was running into when I was
> >> >> trying to hard code the initialization of a request.user object.
> Where
> >> >> is that defined?
> >> >>
> >> >>
> >> >> > if user:
> >> >> > backend = get_backends()[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 MIDDLEWARE_CLASSES.
> >> >> >
> >> >> > Then you can just go to any url and add ?enforce_user=
> >> >> >
> >> >> >
> >> >> >
> >> >> > On 05/09/12 17:56, Larry Martell wrote:
> >> >> >
> >> >> > On Wed, Sep 5, 2012 at 9:36 AM, Kurtis Mullins
> >> >> > 
> >> >> > wrote:
> >> >> >
> >> >> > I don't see why not.
> >> >> >
> >> >> > I've been trying to do that, but it's still complaining.
> >> >> >
> >> >> > Are you running unit tests (testing scripts) or are you
> >> >> > just using the browser for testing?
> >> >> >
> >> >> > I'm trying to do performance measuring. I have a list of all the
> urls
> >> >

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 videos to server in my
>> website.I want to use FTP.So ,how to realize it?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/f-vzQMOMSpoJ.
>
> 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.
>

-- 
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.



Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
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 token from the login page, login with a known (test) user, and
continue passing and extracting the CSRF token as needed?

On Wed, Sep 5, 2012 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:
> >
> > from django.contrib.auth.models import User
> >
> > towards the top :)
> >
> >
> > On Wed, Sep 5, 2012 at 12:57 PM, Larry Martell 
> > wrote:
> >>
> >> On Wed, Sep 5, 2012 at 12:21 PM, anthony tresontani
> >>  wrote:
> >> > We are using a middleware to enforce a user login:
> >> >
> >> > class AutoAuthMiddleware(object):
> >> > """
> >> > Middleware for testing purpose only.
> >> > Can enforce the user login.
> >> > """
> >> >
> >> > def process_request(self, request):
> >> > enforce_user = request.GET.get("enforce_user", None)
> >> > if hasattr(request, "user") and not enforce_user:
> >> > return
> >> >
> >> > user = User.objects.filter(username = enforce_user)
> >>
> >>
> >> I'm getting: 'NameError: "global name 'User' is not defined"' on the
> >> above line. This is the same issue I was running into when I was
> >> trying to hard code the initialization of a request.user object. Where
> >> is that defined?
> >>
> >>
> >> > if user:
> >> > backend = get_backends()[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 MIDDLEWARE_CLASSES.
> >> >
> >> > Then you can just go to any url and add ?enforce_user=
> >> >
> >> >
> >> >
> >> > On 05/09/12 17:56, Larry Martell wrote:
> >> >
> >> > On Wed, Sep 5, 2012 at 9:36 AM, Kurtis Mullins
> >> > 
> >> > wrote:
> >> >
> >> > I don't see why not.
> >> >
> >> > I've been trying to do that, but it's still complaining.
> >> >
> >> > Are you running unit tests (testing scripts) or are you
> >> > just using the browser for testing?
> >> >
> >> > I'm trying to do performance measuring. I have a list of all the urls
> >> > accessed over the past few months by a client, along with metrics on
> >> > their execution times. I want to run all those on a new server we've
> >> > set up and collect metrics and compare them. I have a python script
> >> > that uses urllib2 but, I can't run anything without logging in. I've
> >> > tried to login from python, but I get a 403. I also tried using the
> >> > requests module - that doesn't give me the 403, but doesn't log me in
> >> > - it just returns the login page as if the login failed.
> >> >
> >> > On Wed, Sep 5, 2012 at 11:24 AM, Larry Martell <
> larry.mart...@gmail.com>
> >> > wrote:
> >> >
> >> > On Wed, Sep 5, 2012 at 9:22 AM, Kurtis Mullins
> >> > 
> >> > wrote:
> >> >
> >> > 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!
> >> >
> >> > Yes, they do depend on a request.user object. Can I hard code the
> >> > initialization of it?
> >> >
> >> > On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell <
> larry.mart...@gmail.com>
> >> > wrote:
> >> >
> >> > We have a django app that requires the users to login. For some
> >> > testing we want to do, we want to disable this so the app can be run
>

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 interview too often :) Just my 2 cents.

On Wed, Sep 5, 2012 at 12:57 PM, Aaron C. de Bruyn wrote:

> I disagree with the "how to install" section.
> I use Nginx and uwsgi to host Django applications.
> There are other ways to deploy it too.
>
> The section makes it seem like the only 'real' way would be Apache.
>
> Lastly, it doesn't seem to touch on how a lot of people actually
> install and deploy django projects.  My workflow is pretty simple
> compared to what the install section says:
>
> apt-get install python-pip python-virtualenv virtualenvwrapper
> cd code
> mkvirtualenv some-django-project
> pip install django
> django-admin startproject somedjangoproject
> cd somedjangoproject
> python manage.py startapp app1
>
> Using virtualenv should also take care of the problem listed in
> "Remove any old versions of Django".
>
> I'd hate for someone to not get the job because they give a
> "non-textbook" answer. ;)
>
> -A
>
>
> On Tue, Sep 4, 2012 at 5:10 AM, Stephen Anto 
> wrote:
> > Hi Guys,
> >
> > I have updated Django latest interview questions and answers. It may
> cover
> > all technical requirements of the interview.
> >
> > Vist http://www.f2finterview.com/web/Django/ for latest Django interview
> > questions and answers
> >
>
> --
> 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.
>
>

-- 
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.



Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Kurtis Mullins
Looks like you just need a quick:

from django.contrib.auth.models import User

towards the top :)

On Wed, Sep 5, 2012 at 12:57 PM, Larry Martell wrote:

> On Wed, Sep 5, 2012 at 12:21 PM, anthony tresontani
>  wrote:
> > We are using a middleware to enforce a user login:
> >
> > class AutoAuthMiddleware(object):
> > """
> > Middleware for testing purpose only.
> > Can enforce the user login.
> > """
> >
> > def process_request(self, request):
> > enforce_user = request.GET.get("enforce_user", None)
> > if hasattr(request, "user") and not enforce_user:
> > return
> >
> > user = User.objects.filter(username = enforce_user)
>
>
> I'm getting: 'NameError: "global name 'User' is not defined"' on the
> above line. This is the same issue I was running into when I was
> trying to hard code the initialization of a request.user object. Where
> is that defined?
>
>
> > if user:
> > backend = get_backends()[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 MIDDLEWARE_CLASSES.
> >
> > Then you can just go to any url and add ?enforce_user=
> >
> >
> >
> > On 05/09/12 17:56, Larry Martell wrote:
> >
> > On Wed, Sep 5, 2012 at 9:36 AM, Kurtis Mullins  >
> > wrote:
> >
> > I don't see why not.
> >
> > I've been trying to do that, but it's still complaining.
> >
> > Are you running unit tests (testing scripts) or are you
> > just using the browser for testing?
> >
> > I'm trying to do performance measuring. I have a list of all the urls
> > accessed over the past few months by a client, along with metrics on
> > their execution times. I want to run all those on a new server we've
> > set up and collect metrics and compare them. I have a python script
> > that uses urllib2 but, I can't run anything without logging in. I've
> > tried to login from python, but I get a 403. I also tried using the
> > requests module - that doesn't give me the 403, but doesn't log me in
> > - it just returns the login page as if the login failed.
> >
> > 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 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!
> >
> > Yes, they do depend on a request.user object. Can I hard code the
> > initialization of it?
> >
> > On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell 
> > wrote:
> >
> > We have a django app that requires the users to login. For some
> > testing we want to do, we want to disable this so the app can be run
> > without logging in. Is there some way to easily do this? I've tried
> > commenting out all the @login_required decorations, but then I was
> > getting a 403. I tried commenting out the 'if not
> > controller.has_access' lines, but then I was getting 'Report.owner"
> > must be a "User" instance.' Before I hack up the code any more, is
> > there some way to just globally disable the need to login?
> >
> > --
> > 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.
> >
> > --
> > 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.
> >
> > --
> > You received this message because you ar

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
> 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 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!
>>
>> Yes, they do depend on a request.user object. Can I hard code the
>> initialization of it?
>>
>> >
>> > On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell > >
>> > wrote:
>> >>
>> >> We have a django app that requires the users to login. For some
>> >> testing we want to do, we want to disable this so the app can be run
>> >> without logging in. Is there some way to easily do this? I've tried
>> >> commenting out all the @login_required decorations, but then I was
>> >> getting a 403. I tried commenting out the 'if not
>> >> controller.has_access' lines, but then I was getting 'Report.owner"
>> >> must be a "User" instance.' Before I hack up the code any more, is
>> >> there some way to just globally disable the need to login?
>> >>
>> >> --
>> >> 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.
>> >>
>> >
>> > --
>> > 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.
>>
>> --
>> 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.
>>
>>
>

-- 
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.



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 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!
>
> Yes, they do depend on a request.user object. Can I hard code the
> initialization of it?
>
> >
> > On Wed, Sep 5, 2012 at 11:18 AM, Larry Martell 
> > wrote:
> >>
> >> We have a django app that requires the users to login. For some
> >> testing we want to do, we want to disable this so the app can be run
> >> without logging in. Is there some way to easily do this? I've tried
> >> commenting out all the @login_required decorations, but then I was
> >> getting a 403. I tried commenting out the 'if not
> >> controller.has_access' lines, but then I was getting 'Report.owner"
> >> must be a "User" instance.' Before I hack up the code any more, is
> >> there some way to just globally disable the need to login?
> >>
> >> --
> >> 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.
> >>
> >
> > --
> > 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.
>
> --
> 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.
>
>

-- 
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.



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 django app that requires the users to login. For some
> testing we want to do, we want to disable this so the app can be run
> without logging in. Is there some way to easily do this? I've tried
> commenting out all the @login_required decorations, but then I was
> getting a 403. I tried commenting out the 'if not
> controller.has_access' lines, but then I was getting 'Report.owner"
> must be a "User" instance.' Before I hack up the code any more, is
> there some way to just globally disable the need to login?
>
> --
> 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.
>
>

-- 
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.



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 code snippets.
>
> I'd still like to know what `if isinstance(objects, HttpResponse)` is
> doing?


All that is doing is checking to see if the object named "objects" is an
HttpResponse object.

According to this doc (
https://docs.djangoproject.com/en/dev/ref/request-response/#id4) it appears
that the objects.status_code *should* work, although I'm not sure if it
returns a number or a string. I'm not sure why this isn't working for you,
though.

-- 
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.



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:

factory_a = Factory.objects.create()
factory_b = Factory.objects.create()
factory_c = Factory.objects.create()
factory_b.customers.add(factory_a)
factory_c.suppliers.add(factory_a)

Documentation:
https://docs.djangoproject.com/en/dev/ref/models/fields/#manytomanyfield
https://docs.djangoproject.com/en/dev/topics/db/queries/#many-to-many-relationships
https://docs.djangoproject.com/en/dev/topics/db/examples/many_to_many/

On Thu, Aug 23, 2012 at 8:20 AM, Fernando Andreacci wrote:

> Hello,
>
> I'm a new Django user, and I have the following question:
>
> I have one Model called *factory, *with several fields like (name,
> address, phone, etc).
>
> Each factory can be a customer, a supplier or both.
>
> Ex:
> Factory1 is a customer of Factory2, and Factory1 is a supplier of Factory3.
>
> How can I set up the models to hold this information?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/C0KQX7HoCTUJ.
> 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.
>

-- 
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.



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.7 if it makes a difference.

Here's a reference to the file that's giving you the error:
https://github.com/django/django/blob/1.4.1/django/__init__.py

On Wed, Aug 22, 2012 at 5:00 PM, Bestrafung  wrote:

> I'm new to Django and though I've dabbled with Linux off and on for a
> decade I'm still learning so please go easy on me. I'm following this
> guideto
>  setup a Django 1.4.1 test project. So far I've setup Python 2.5 with
> MySQL-python-1.2.3 and setuptools, setup mod_wsgi, and edited
> .bash_profile. I've downloaded Django 1.4.1 (not trunk) and so far
> everything looks good. As soon as I run "django-admin.py startproject
> testproject" I receive an error and am having trouble resolving it. I
> apologize if this has come up before bet a quick search wasn't helpful.
> Thanks in advance for any assistance, the error is below:
>
> [-bash-3.2 root@server1: /home/username/sites/domain.com] #
> /home/username/sites/domain.com/django/bin/django-admin.py startproject
> testproject
> Traceback (most recent call last):
>   File "/home/username/sites/domain.com/django/bin/django-admin.py", line
> 2, in ?
> from django.core import management
>   File "/home/username/sites/domain.com/django/__init__.py", line 15
> parts = 2 if version[2] == 0 else 3
>^
> SyntaxError: invalid syntax
> [-bash-3.2 root@server1: /home/username/sites/domain.com] #
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/WszNLKVNcxcJ.
> 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.
>

-- 
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.



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

2012-08-22 Thread Kurtis Mullins
Whoops,

foo = property(get_reference, set_reference)

should be

reference = property(get_reference, set_reference)

Sorry, was reading another page to make sure I have the property code right:
http://stackoverflow.com/questions/1454727/do-properties-work-on-django-model-fields

On Wed, Aug 22, 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
> functionality you need. Just as a quick prototypical example:
>
> class ReferenceModel(Model):
> _reference = models.CharField(max_length=150)
>
> def get_reference(self):
> """
> Load the string from self._reference and use some sort of a process
> to dynamically load the object.
> e.g.
> http://stackoverflow.com/questions/547829/how-to-dynamically-load-a-python-class
> """
>
> def set_reference(self, input):
> self._reference = input
>
> foo = property(get_reference, set_reference)
>
> Anyways, just a guess at one of many ways to possibly accomplish this task.
>
>
> On Wed, Aug 22, 2012 at 5:58 PM, Michael Palumbo <
> michael.palumb...@gmail.com> wrote:
>
>> Hi,
>>
>> Do you know a custom field for a callable python object like a Class or a
>> function ?
>>
>> It could store it as a string in the DB: "module1.module2.class"  or
>> "module1.module2.function"
>> With that string, it could load it as a real python object when you get
>> it from the DB.
>>
>> For example, you could do something like that:
>>
>> from module1.module2 import testme
>> mymodel.process = testme
>> mymodel.save() => stores the string "module1.module2.testme"
>>
>> # Later...
>> ins = mymodel.objects.get(..)
>> ins.process('OK') # ins.process can be called because it has been
>> resolved to the testme function
>>
>> Thanks.
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/sHDfKCKGBmEJ.
>> 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.
>>
>
>

-- 
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.



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(Model):
_reference = models.CharField(max_length=150)

def get_reference(self):
"""
Load the string from self._reference and use some sort of a process
to dynamically load the object.
e.g.
http://stackoverflow.com/questions/547829/how-to-dynamically-load-a-python-class
"""

def set_reference(self, input):
self._reference = input

foo = property(get_reference, set_reference)

Anyways, just a guess at one of many ways to possibly accomplish this task.


On Wed, Aug 22, 2012 at 5:58 PM, Michael Palumbo <
michael.palumb...@gmail.com> wrote:

> Hi,
>
> Do you know a custom field for a callable python object like a Class or a
> function ?
>
> It could store it as a string in the DB: "module1.module2.class"  or
> "module1.module2.function"
> With that string, it could load it as a real python object when you get it
> from the DB.
>
> For example, you could do something like that:
>
> from module1.module2 import testme
> mymodel.process = testme
> mymodel.save() => stores the string "module1.module2.testme"
>
> # Later...
> ins = mymodel.objects.get(..)
> ins.process('OK') # ins.process can be called because it has been resolved
> to the testme function
>
> Thanks.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/sHDfKCKGBmEJ.
> 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.
>

-- 
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.



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> wrote:

> Dear sirs,
> I have split my Django application into two sites with different
> databases. I use OpenID (python_openid 2.2.5) for
> authetication/registration but users of ''site A'' are different from
> ''site B''.
>
> How can I do to centralize logins between apps running on different
> databases?
>
> I have seen this article by Joseph Smarr at Plaxo (
> http://www.netvivs.com/openid-recipe/) and this Stackoverflow question (
> http://stackoverflow.com/questions/4395190/how-do-stackexchange-sites-associate-user-accounts-and-openid-logins)
> but i don't know how can I do this with django.
>
> Can you help me please?
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/oHVzCzIer48J.
> 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.
>
>

-- 
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.



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_psycopg2  as my data base. When I run ./manage validate it
> returns without errors, sqlall works fine and when I syncdb it works as
> expected, the issue occurs when I run syncdb a second time I get the
> following errors:
>
> $ ./manage.py syncdb
> Creating tables ...
> Traceback (most recent call last):
>   File "./manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 196, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 232, in execute
> output = self.handle(*args, **options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 371, in handle
> return self.handle_noargs(**options)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py",
> line 110, in handle_noargs
> emit_post_sync_signal(created_models, verbosity, interactive, db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/core/management/sql.py",
> line 189, in emit_post_sync_signal
> interactive=interactive, db=db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
> line 172, in send
> response = receiver(signal=self, sender=sender, **named)
>   File
> "/usr/local/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
> line 54, in create_permissions
> auth_app.Permission.objects.bulk_create(objs)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line
> 140, in bulk_create
> return self.get_query_set().bulk_create(*args, **kwargs)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 416, in bulk_create
> self.model._base_manager._insert(objs_without_pk, fields=[f for f in
> fields if not isinstance(f, AutoField)], using=self.db)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py", line
> 203, in _insert
> return insert_query(self.model, objs, fields, **kwargs)
>   File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py",
> line 1576, in insert_query
> return query.get_compiler(using=using).execute_sql(return_id)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 910, in execute_sql
> cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/util.py", line
> 40, in execute
> return self.cursor.execute(sql, params)
>   File
> "/usr/local/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py",
> line 52, in execute
> return self.cursor.execute(query, args)
> django.db.utils.DatabaseError: value too long for type character
> varying(50)
>
> I have searched google and this list and have not been able to find any
> help. Is there a limit on the amount of classes I cam specify in the
> models.py file? Please let me know if you need any more information.
>
>
> Thanks a lot
>
> Cheers
>
> John
>
> --
> 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.
>
>

-- 
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.



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 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 be a bad name to use as the system already provides a User class
> which would be better extended by user name.
>
> Sorry that my information isn't more helpful, but you're asking for help
> with quite a complex (but somewhat obvious) task and I'm not sure how much
> of the underlying technology you fully understand at this point. Not trying
> to frown down upon you for asking by any means! I just think it might be
> more beneficial if you've got a solid understanding of the basics first.
>
> Maybe if there's a very specific question, I'd be more happy to help.
>
> Good luck!
>
>
> On Tue, Aug 21, 2012 at 4:57 PM, Nirmal Sharma wrote:
>
>>
>> --This is the model definition
>>
>> FEEDBACK_CHOICES = (
>> (1, 'FOR'),
>> (-1, 'AGAINST'),
>> (0, 'NEUTRAL'),
>> )
>>
>>
>> class user (models.Model):
>> user_name  = models.CharField(max_length=**150)
>>
>>
>> class comments (models.Model):
>> comment  = models.CharField(max_length=**1000)
>> root_comment =  models.ForeignKey('self', null=True, blank=True,
>> related_name="children")
>> user_id = models.ForeignKey(user)
>>
>>
>> class comment_feedback (models.Model):
>> feedback_user_id = models.ForeignKey(user)
>> comment_id =   models.ForeignKey(comments)
>> feedback_type_id =  models.CharField(max_length=**20,
>> choices=FEEDBACK_CHOICES)
>> class Meta:
>> unique_together = [("feedback_user_id", "info_id")]
>>
>>
>>
>> We are trying build a html page that will do the following.
>> Once a user logs in, he can write a new comment (that would result in an
>> insert into comments table)
>> Alternatively he can do one of the following:
>> select a comment of some other user and give his feedback (that would
>> result in an insert into comment_feedback table)
>> select a comment and write his own comment with a feedback on the
>> original comment (that would result in an insert into comments table with
>> root_comment as the original comment and an insert into comment_feedback
>> table for the original comment)
>>
>> We tried doing this inlineformset_factory and nested formsets. However we
>> are quite confused on how to proceed with this. Also the comment_feedback
>> table has 2 foreign keys.
>> How do we handle this at the form and template level?
>>
>> Regards
>> ~Nirmal
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/oVRPCd9uzpgJ.
>> 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.
>>
>
>

-- 
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.



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 be a bad name to use as the system already provides a User class
which would be better extended by user name.

Sorry that my information isn't more helpful, but you're asking for help
with quite a complex (but somewhat obvious) task and I'm not sure how much
of the underlying technology you fully understand at this point. Not trying
to frown down upon you for asking by any means! I just think it might be
more beneficial if you've got a solid understanding of the basics first.

Maybe if there's a very specific question, I'd be more happy to help.

Good luck!

On Tue, Aug 21, 2012 at 4:57 PM, Nirmal Sharma wrote:

>
> --This is the model definition
>
> FEEDBACK_CHOICES = (
> (1, 'FOR'),
> (-1, 'AGAINST'),
> (0, 'NEUTRAL'),
> )
>
>
> class user (models.Model):
> user_name  = models.CharField(max_length=**150)
>
>
> class comments (models.Model):
> comment  = models.CharField(max_length=**1000)
> root_comment =  models.ForeignKey('self', null=True, blank=True,
> related_name="children")
> user_id = models.ForeignKey(user)
>
>
> class comment_feedback (models.Model):
> feedback_user_id = models.ForeignKey(user)
> comment_id =   models.ForeignKey(comments)
> feedback_type_id =  models.CharField(max_length=**20,
> choices=FEEDBACK_CHOICES)
> class Meta:
> unique_together = [("feedback_user_id", "info_id")]
>
>
>
> We are trying build a html page that will do the following.
> Once a user logs in, he can write a new comment (that would result in an
> insert into comments table)
> Alternatively he can do one of the following:
> select a comment of some other user and give his feedback (that would
> result in an insert into comment_feedback table)
> select a comment and write his own comment with a feedback on the
> original comment (that would result in an insert into comments table with
> root_comment as the original comment and an insert into comment_feedback
> table for the original comment)
>
> We tried doing this inlineformset_factory and nested formsets. However we
> are quite confused on how to proceed with this. Also the comment_feedback
> table has 2 foreign keys.
> How do we handle this at the form and template level?
>
> Regards
> ~Nirmal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/oVRPCd9uzpgJ.
> 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.
>

-- 
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.



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 this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/m5g03N065jAJ.
>
> 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.
>

-- 
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.



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 up
as a 404 error?

On Tue, Aug 21, 2012 at 7:43 AM, boddireddy purnachander <
bpurnachan...@gmail.com> wrote:

> Technologies used Python Django framework (from
> https://www.djangoproject.com/) HTML table filter sort (from
> http://tablefilter.free.fr/dwn.php)
>
> While all other accompanied '.css' and '.js' files in /static/css and
> /static/js work, only 'tfAdapter.sortabletable.js' does not.
>
> No error is seen (in logs too) when I run the server. But when I try to
> open the html files which include 'tfAdapter.sortabletable.js' file it
> shows '404 file not found'.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/dyjutUdyxv4J.
> 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.
>
>

-- 
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.



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
steps to catch that state. Finally, implement it in a way that will leave
no side effects.

Possibly using a queue may be good for this. Let the user perform an action
which will attempt to use/move the funds. Then, actually try to perform the
operation behind the scenes. Finally, update the user's information so they
can see the change or any errors that occurred. This should
(hypothetically, assuming you only have one queue per user or account) make
sure that the transactions are performed in order and should also eliminate
race conditions. This would be similar in implementation to how many bank
web-sites let you transfer funds between accounts but it's typically not an
update you see immediately.

On Tue, Aug 21, 2012 at 4:18 AM, Sebastien Flory  wrote:

> That was my idea too, but using this way, the pre_save / post_save signals
> wont be triggered.
> It seems strange to me to be using the objects manager instead of the
> model instance directly, no?
>
> Seb
>
> Le mardi 21 août 2012 02:11:42 UTC+2, Thomas Orozco a écrit :
>>
>> As a followup to the suggestion of MyModel.objects.filter(**money__gte =
>> value, pk = self.pk).update(F...)
>>
>> Here's an example:
>>
>> We have testapp/models.py:
>>
>> from django.db import models
>> class TestModel(models.Model):
>> balance =  models.IntegerField()
>>
>>
>> >>> from django.db.models import F
>> >>> TestModel.objects.create(**balance = 5) #Pk will be 1 I just create
>> one.
>> >>> import logging
>> >>> l = logging.getLogger('django.db.**backends')
>> >>> l.setLevel(logging.DEBUG)
>> >>> l.addHandler(logging.**StreamHandler())
>> >>> TestModel.objects.filter(**balance__gte = 4, pk = 1).update(balance
>> = F('balance') - 4)
>> (0.001) UPDATE "testapp_testmodel" SET "balance" =
>> "testapp_testmodel"."balance" - 4 WHERE ("testapp_testmodel"."balance" >= 4
>>  AND "testapp_testmodel"."id" = 1 ); args=(4, 4, 1)
>> 1
>> >>> TestModel.objects.filter(**balance__gte = 4, pk = 1).update(balance
>> = F('balance') - 4)
>> (0.000) UPDATE "testapp_testmodel" SET "balance" =
>> "testapp_testmodel"."balance" - 4 WHERE ("testapp_testmodel"."balance" >= 4
>>  AND "testapp_testmodel"."id" = 1 ); args=(4, 4, 1)
>> 0
>>
>>
>>
>> *So this seems to generate a single SQL statement.*
>> *
>> *
>> *I'm not totally familiar with database administration though, so as** Melvyn
>> rightly pointed out, it's always better if you can get the extra security
>> of having an SQL constraint into your dabatase and wrap your queries in a
>> transaction (as you'll probably be adding a line to the statement if the
>> withdrawal succeeds).*
>> *
>> *
>>
>> 2012/8/20 Thomas Orozco 
>>
>>> A few suggestions :
>>>
>>> Circumvent the problem with smarter design: don't store the money on the
>>> object, make the user's money the sum of all their transactions (credit -
>>> debit).
>>> You get lesser performance, but you also get history!
>>>
>>> Maybe you could try (not sure about that):
>>>
>>> MyModel.objects.filter(money__**gte = value, pk = self.pk).update(F...)
>>>
>>> and inspect the return value (number of updated rows!).
>>> Now, you'd need to make sure django does that in a single statement.
>>>
>>> If that doesn't work, I think update is the way to go anyway, but it
>>> might get a bit messy.
>>>
>>> F... is an F object whose syntax I don't have off the top of my head.
>>> Le 20 août 2012 18:54, "Sebastien Flory"  a écrit :
>>>
>>> Hi everyone,

 I'm looking for the proper django way to do an update of an attribute
 on my model instance, but only if the attribute current value is checked
 agains't a condition, in an atomic way, something like this:

 def use_money(self, value):
   begin_transaction()
   real_money = F('money')
   if real_money >= value:
 self.money = F('money') - value
  self.save()
   end_transaction()

 I want to make sure that I avoid race condition so money never goes
 below 0.

 Can you help me out?

 Thanks,

 Sebastien

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit https://groups.google.com/d/**
 msg/django-users/-/**hr1fBuAcX3kJ
 .
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>  --
> You received this message b

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 try uploading any other images ?
>>
>>
>> On Mon, Aug 20, 2012 at 12:58 AM, MN TS  wrote:
>> > Hello everybody.
>> >
>> > I've problem. When i upload image and submit i got follow form error.
>> >- Upload a valid image. The file you uploaded was either not an
>> image or
>> > a corrupted image.
>> >
>> > I reinstall PIL (1.1.7) and setup.py file edit like JPEG_ROOT =
>> > '/usr/lib/i386-linux-gnu/'.
>> >
>> > Thanks
>> >
>> > --
>> > 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.
>>
>>
>>
>> --
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras.offic...@gmail.com, ad...@techstricks.com
>> Twitter - @a_myth_
>> http://techstricks.com/
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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.



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 the list you have sent me.
>
> On another note, Simone mentioned to extend the Formset in order to run my
> own dropdown solution.
>
> I was just looking at the modelformset_factory class and - surpise
> surprise - it accepts a formfield_callback parameter, which could solve my
> dilemma.
>
> I have used callbacks previously within a form to set localized to True:
>
> class CallsForm(ModelForm):
>
> def contact_date_callback(self, field, **kwargs) :
>
> return field.contact_date(localize=**True, **kwargs)
>
>
> But I have no idea how to use it from view
>
> formset_type = modelformset_factory(**SalesItem, form=SalesItemFSForm,
> extra=0, formfield_callback= )
>
>
> Do you happen to know how to use it?
>
> If I was able to set the queryset for the sales_item field in that
> callback, I wouldn't have to extend the factory at all.
>
>
> Many Thanks,
> Houman
>
>
>
>
> On 17/08/12 14:24, Melvyn Sopacua wrote:
>
>> On 17-8-2012 15:00, houmie wrote:
>>
>>  Yes, I know about overriding a widget. I could override a Charfield with
>>> a TextArea.  For simple stuff it makes sense.
>>> Against which widget do I override the existing M2M widget though?
>>>
>> If the one that Tomas linked doesn't work for you, you'll need to
>> consult the roll-your-own department or keep looking around for
>> different widgets, for example:
>> 
>> >
>>
>>
> --
> 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+unsubscribe@**
> 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-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.



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 luck queuing this up with
something like http://pypi.python.org/pypi/django-celery/

On Fri, Aug 17, 2012 at 12:41 PM, Tom  wrote:

> Hi all,
>
> I'm new to Django, but really enjoying using it so far!
>
> What I'm trying to do is to export data from an admin interface, when a
> record is created or updated. I'm calling another web service to tell it
> the data on site [A] has changed, by using signals.
>
> e.g.
>
> @receiver(post_save, sender=Poll)
> def notify_central_hub(sender, instance, created, **kwargs):
> if created:
>
> #make a string to hold the url of the request
> url = "http://www.example.com/webservice";
>
> #place POST data in a dictionary
> post_data_dictionary = kwargs
>
> #encode the POST data to be sent in a URL
> post_data_encoded = urllib.urlencode(post_data_dictionary)
>
> #make a request object to hold the POST data and the URL
> request_object = urllib2.Request(url, post_data_encoded)
>
> #make the request using the request object as an argument, store
> response in a variable
> response = urllib2.urlopen(request_object)
>
>
> I'm able to export the data this way, but I can't get the attributes of
> the full model as I would as if I was using the Django shell. Particularly
> important is the ID of an object, because without that I won't know which
> ID to update on the remote web service. That's why I'm only dealing with
> "created" objects for now.
>
> Could someone please advise me whether I'm going about this the right way,
> or if there is actually a better way of doing this? I looked into Django
> middleware but this appears to be more for changing the output at the view
> layer, not the data layer. But if there is a better way of doing this, I'd
> be keen to find out!
>
> Many thanks,
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/zystPhngbI0J.
> 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.
>
>

-- 
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.



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://docs.djangoproject.com/en/dev/topics/http/urls/#topics-http-reversing-url-namespaces

On Fri, Aug 17, 2012 at 6:23 PM, bruce  wrote:

> Tears
> thanks!
>
> But I am confused.
> For example,
> the following code needs to add single quote.
>
> {% block content %}
> Add Todo items
>
>
> Is there a link to give me detailed description?
> I want to learn it and never get stuck again.
>
> Thanks!!
>
>
>
>
> On Friday, August 17, 2012 5:37:13 PM UTC-4, Tomas Neme wrote:
>>
>> either remove the quotes from {% url 'blog.views.add_comment' %} (so it's
>> {% url blog.views.add_comment %}) or {% load url from future %}
>>
>> Loading from future is the better option, I think.
>>
>> and for future reference:
>>
>> Reverse for ''blog.views.add_comment'' with arguments '(1L,)' and keyword 
>> arguments '{}' not found.
>>
>> notice how there's two single quotes there, not a double quote? that's
>> your clue, right there
>>
>> --
>> "The whole of Japan is pure invention. There is no such country, there
>> are no such people" --Oscar Wilde
>>
>> |_|0|_|
>> |_|_|0|
>> |0|0|0|
>>
>> (\__/)
>> (='.'=)This is Bunny. Copy and paste bunny
>> (")_(") to help him gain world domination.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/QqYvLl3VNisJ.
>
> 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.
>

-- 
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.



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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 wanted to share was this:
http://docs.python.org/library/stdtypes.html#str.split

-- 
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.



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) * views'
> })
>
It shows an error, i've tried googling it but not had much luck so far


Where error are you getting?

-- 
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.



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.views.index.
> View does not exist in module polls.views.
>
> urls.py
>
> from django.conf.urls import patterns, include, url
> from django.views.generic import DetailView, ListView
> from polls.models import Poll
>
> Uncomment the next two lines to enable the admin:
>

So, first, add a # to the beginning of that line, to make it this:
# Uncomment the next two lines to enable the admin:


> from django.contrib import admin
> admin.autodiscover()
>
>
Here, you're going to make a list of patterns. Nothing wrong with that.


> urlpatterns = patterns('',
> url(r'^$',
> ListView.as_view(
> queryset = Poll.objects.order_by('-pub_date')[:5],
> context_object_name = 'latest_poll_list',
> template_name = 'polls/index.html')),
> url(r'^(?P\d+)/$',
> DetailView.as_view(
> model = Poll,
> template_name = 'polls/detail.html')),
> url(r'^(?P\d+)/results/$',
> DetailView.as_view(
> model = Poll,
> template_name = 'polls/results.html'),
> name='poll_results'),
> url(r'^(?P\d+)/vote/$', 'polls.views.vote'),
> )
>
>
Now, below, you've overridden the same URL patterns. (The previous list
should, hypothetically, be ignored at this point) This is actually reading
the urls.py file from your 'polls' module. I'm not sure if this is really
all in the same file or not. If it is, can you show us what's in your
polls/urls.py file?


> urlpatterns = patterns('',
> url(r'^polls/', include('polls.urls')),
> url(r'^admin/', include(admin.site.urls)),
> )
>
> # Uncomment the admin/doc line below to enable admin documentation:
> # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> views.py
> # Create your views here.
> from django.shortcuts import render_to_response, get_object_or_404
> from django.http import HttpResponseRedirect, HttpResponse
> from django.core.urlresolvers import reverse
> from django.template import RequestContext
> from polls.models import Choice, Poll
>
> def vote(request, poll_id):
> p = get_object_or_404 (Poll, pk = poll_id)
> try:
> selected_choice =
> p.choice_set.get(pk=request.POST['choice'])
> except (KeyError, Choice.DoesNotExist):
> return render_to_response('polls/detail.html', {
> 'poll': p,
> 'error_message': "You didn't select a choice.",
> }, context_instance = RequestContext(request))
> else:
> selected_choice.votes += 1
> selected_choice.save()
> return HttpResponseRedirect(reverse('poll_results', args =
> (p.id,)))
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/bWqxut6y_YgJ.
> 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.
>
>

-- 
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.



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/function not
exist, I don't see anywhere in your urls.py that indicates you are trying
to load or otherwise reference that method.

So as Melvyn implied, are you sure this source code you presented is
exactly the same as you're trying to run? I think he assumed you were using
a WSGI Handler -- but runserver should pick up any changes that you make up
to the structure automatically.

Can you share the traceback that your web browser shows when you try to
access your Django application? Just make sure to hide any
private/sensetive data:
http://localhost:8000 after executing 'python manage.py runserver'

On Wed, Aug 15, 2012 at 10:45 PM, Sky  wrote:

> How do I do that?
>
> I've tried the commands python manage.py syncdb followed by python
> manage.py runserver several times but they don't work.
>
>
> On Wednesday, August 15, 2012 9:45:21 PM UTC+8, Melvyn Sopacua wrote:
>>
>> On 15-8-2012 10:01, Pengfei Xue wrote:
>> > there's no function in views.py, you should define that 'index'
>> > handler
>>
>> No, he's not using it according to source.
>> Which means the source is not in sync with what is being run, typically
>> fixed by restarting the WSGI provider.
>>
>> --
>> Melvyn Sopacua
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/VTBxdWtZXTYJ.
>
> 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.
>

-- 
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.



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, Carlos Andre  wrote:

> Ok, the  quest is relative  a how that work with forms of data in
> settins.py!
> not relative to date time.
> in  real i'm want insert data in databases athroughl shell  and thi error
> is show!
>
>
> 2012/8/14 Satinderpal Singh 
>
>> On Tue, Aug 14, 2012 at 9:42 PM, Carlos Andre  wrote:
>> > hi developers i'm with a ptoblem in this date. How work?
>> > thanks!
>> Please clear your question, if you are looking for date and time at
>> your page please follow the following tutorial:
>> http://www.djangobook.com/en/2.0/chapter03/
>>
>> --
>> Satinderpal Singh
>> http://satindergoraya.blogspot.in/
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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.



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:
> json_data = json.loads(request.raw_post_data)
> except Exception, e:
> return HttpResponseBadRequest()
>
> form = forms.AttributeForm(json_data)
> if not form.is_valid():
> return render_to_json_response({
> 'success': False,
> 'errors': [(k, unicode(v[0])) for k, v in
> form.errors.items()],
> 'level': messages.DEFAULT_TAGS[messages.ERROR],
> 'data': form.data,
> })
>
> name = form.cleaned_data['name']
> ...
>
> This works for me very well. Hope it will work for you too.
>
> вторник, 14 августа 2012 г., 0:14:14 UTC+3 пользователь Kurtis написал:
>
>> 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 creating a QueryDict and sending
>> it in. Thanks for the suggestions!
>>
>> The reason I'm using a Form (specifically a ModelForm) is to make my job
>> of setting up the Validation a *whole* lot easier.
>>
>> Here's the code I basically used. Maybe there's a better way to do it?
>>
>> json_object = json.loads(request.POST['some_**json_field'])
>> q = QueryDict('')
>> q = q.copy()
>> q.update(json_object)
>> form = MyModelForm(q)
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/ZOaSBbu8xYQJ.
>
> 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.
>

-- 
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.



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 creating a QueryDict and sending it
in. Thanks for the suggestions!

The reason I'm using a Form (specifically a ModelForm) is to make my job of
setting up the Validation a *whole* lot easier.

Here's the code I basically used. Maybe there's a better way to do it?

json_object = json.loads(request.POST['some_json_field'])
q = QueryDict('')
q = q.copy()
q.update(json_object)
form = MyModelForm(q)

-- 
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.



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
> needs follow python rules for naming files.
>
>
> On Sunday, August 12, 2012 1:44:06 AM UTC-7, Melvyn Sopacua wrote:
>
> On 11-8-2012 2:14, Matthew Meyer wrote:
>>
>> Since I don't see anything wrong with your code or setup, I'm going to
>> take a stab in the dark and say that you need to loose the underscore in
>> the command.
>>
>
> Toodle-looo
> creedcode
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IyKV_xgNgOcJ.
>
> 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.
>

-- 
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.



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?affiliate=lacunza

Haha, nice usage of your affiliate link. Maybe this response was a bit
biased?

-- 
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.



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 mobile devices ) without hacking this into each
> view? MiddleWare using
>
>
> https://docs.djangoproject.com/en/dev/topics/http/middleware/?from=olddocs/#process-template-response
>
> for instance?
>
> Anyway, thanks for your input.
>
> Thomas
>
> On Thu, Aug 9, 2012 at 3:09 PM, Daniel Roseman 
> wrote:
> >> On Thursday, 9 August 2012 13:18:36 UTC+1, MrMuffin wrote:
> >>>
> >>> I need to change what template to use in a response based on type of
> >>> user-agent in request. The middleware below works ok to detect mobile
> >>> client, but I cannot get the template manipulation in the process_view
> >>> method  to work.
> >>>
> >>> The middleware:
> >>>
> >>> # Credits: http://djangosnippets.org/snippets/2001/
> >>> import re
> >>>
> >>>
> >>> class MobileDetectionMiddleware(object):
> >>> """
> >>> Useful middleware to detect if the user is
> >>> on a mobile device.
> >>> """
> >>>
> >>> def process_view(self, request, view_func, view_args, view_kwargs):
> >>> if not request.is_mobile:
> >>> return
> >>>
> >>> print vars(view_func), view_args,view_kwargs # these are
> >>> allways blank/empty
> >>> template = view_kwargs.get("template")
> >>> if template is None and view_func.func_defaults:
> >>> for default in view_func.func_defaults:
> >>> if str(default).endswith(".html"):
> >>> template = default
> >>> break
> >>>
> >>> if template is not None:
> >>> template = template.rsplit(".html", 1)[0] + ".mobile.html"
> >>> try:
> >>> get_template(template)
> >>> except TemplateDoesNotExist:
> >>> return
> >>> else:
> >>> view_kwargs["template"] = template
> >>>
> >>> return view_func(request, *view_args, **view_kwargs)
> >>>
> >>> 
> >>>
> >>>
> >>> from django.shortcuts import *
> >>>
> >>> def index(request):
> >>> return render_to_response('testapp/test.html',
> {'user':request.user})
> >>>
> >>>
> >>>
> >>> Any clues?
> >>>
> >>>
> >>> --
> >>> Mvh/Best regards,
> >>> Thomas Weholt
> >>> http://www.weholt.org
> >>
> >>
> >
> > I can't imagine how you are expecting this to work. The template in your
> > view is not a parameter, but is hard-coded into the call to
> > render_to_response. Your code appears to be wanting to access the default
> > value of a non-existent view parameter, modify it, and pass it back into
> a
> > view that isn't expecting it.
> >
> > It seems like you want to make `template` a parameter to the view, and
> then
> > your middleware could modify that.
> > --
> > DR.
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.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 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-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.



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:

> 是不是可以用异步来完成? ajax upload
>
>
> 2012/8/8 Russell Keith-Magee 
>
>> On Wed, Aug 8, 2012 at 2:42 PM, 春燕 李  wrote:
>> > Thanks !
>> >
>> > In my application, I want to upload  image files(such as *.iso) which
>> > are always large, it will take long time before the uploading
>> > completed. During this time, I cannot  send out other request on
>> > current page, because a new request will refresh the current page and
>> > make the uploading failed. My aim is that after I click the Upload
>> > button, the file uploading is processed in backend, I can send out
>> > other request  simutanously. Firstly , I tried to get the stream, and
>> > write  new handler to replace the exsiting processing. But after I
>> > read the source code , I find that the input stream got by django is
>> > activity limited,  it only can be read once, once reading is started,
>> > the current page shouldn't be refresh, or else the stream reading will
>> > be failed.
>> >
>> > Is it realizable to  uploading backend and simutanously send other
>> > request on current page, and the uploading won't interrupt because of
>> > leaving this page?
>>
>> Not really. This isn't something that's Django specific -- it's a
>> general problem with web browsers. Web browsers make requests.
>> Background requests are still requests, and they need to happen in the
>> context of a page that is in the foreground. If you change the
>> foreground page, you're going to stop any background activity that is
>> underway.
>>
>> That said, there might be something you can do by breaking the
>> background task into a large number of smaller requests using the HTTP
>> Range header, and then recombining the file on the server side from
>> all the individual chunks. That won't stop the background request from
>> being killed, but it will give you an opportunity to resume the upload
>> on a new page.
>>
>> However, this isn't something where I can point you at a simple page
>> of documentation and say "just call these three lines of Python". What
>> you're proposing isn't a simple task. You're going to need to become
>> very familiar with the HTTP specification, and work out how to put the
>> pieces together yourself.
>>
>> Yours,
>> Russ Magee %-)
>>
>> --
>> 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.
>>
>>
>  --
> 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.
>

-- 
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.



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
hand?


> models.ParentTable.objects.filter(~Q(childtable__attr1="something",
> childtable__attr2__gte=100)).count()
>

~ ( A AND B ) = ~A OR ~B

This query should (at least according to logic, I'm not sure according to
Django's ORM) give you all objects where EITHER attr1="something" is false
OR attr2 >= 100 is false.

Again, does your data set show this is true?


>
> Should return 9, however, it instead returns all ParentObjects that have
> AT LEAST ONE child where attr1 is not "something" and ALL children have
> attr2 less than 100. It seems that the ~Q() does two seperate lookups on
> childtable for attr1 and attr2 instead of comparing both with one lookup.
>
> Am I missing something?
>

I believe ... just from reading what you've posted, that you actually want
the Complement of the set of objects. Maybe something along these lines
would help you?

http://stackoverflow.com/questions/8820113/django-getting-complement-of-queryset

Anyways, Good luck!

-- 
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.



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, depending on
the complexity of the particular function/feature, I would simply roll my
own out based on what I've learned.

Another great way to go about this, since your effort could potentially be
something useful to others, is to see if the "registration plugin" is
available on github with the proper licensing and then "fork" it. You could
make all of your changes there on github and use "pip" to install your copy
(the fork you made) instead of the original author's. This would be great
because you get to share with others, have a manageable way of monitoring
your changes, and may even get some help from others.

Anyways, those are just some ideas... I'm sure others will have more!

Good luck!
- Kurtis

On Fri, Aug 3, 2012 at 3:58 PM, Steve  wrote:

> I am very new to Django but I like it a lot. I learned about the
> registration plugin and I am trying to modify it such that only the
> individuals who have and can validate an email with .org address can
> register. I was wondering if someone could point me in the right direction
> in terms of how exactly I should modify the plugin. I am reading the docs
> and I see some forms for the default strategy. For example, there is one
> form disallowing the hotmail, gmail, etc. addresses. My strategy would be
> similar to that. However, since I am new to Django and Python, I don't know
> how I should modify the app. For ex., should I download a copy and put it
> in the main project folder? Any best practices and tips would be greatly
> appreciated.
>
> Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/iaxHEo8NmWoJ.
> 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.
>
>

-- 
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.



  1   2   3   4   >