Security design questions

2011-11-27 Thread Mike Dewhirst

Can someone please help me with a design dilemma?

The scenario is multiple companies each with their own users to edit 
corporate information. Companies have divisions each with their own 
assets and associated information.


I'm envisaging at least one corporate admin who can adjust anything for 
a company but there must also be divisional users who can edit only 
divisional information. Some divisional users must be able to edit 
information for more than one division.


I can see how to provide pages with the target information for users via 
a view. But I can't see how to prevent access to logged in users who can 
figure out the URLs for information they aren't supposed to access.


1. Do I have to create many-to-many relationships and before serving a 
page make sure the user making the request is "permitted" to see it?


2. Would it be better to establish named auth.groups and create the 
many-to-many relationships between them and the divisions?


I have been thinking about naming users or groups to include the company 
domain name and/or division "sub-domain" names to avoid extra database 
lookups.


3. What is the purpose of Django object permissions? Is that an existing 
framework for the sort of many-to-many relationships I think I need.


This must have all been done before. Is there a design pattern someone 
can point me to?


Thanks for reading this far. Any hints appreciated.

Mike

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



thank you South

2011-11-27 Thread kenneth gonsalves
hi,

although I have been using django for many years, I had always refused
to look at South as I believed that schema migration in production was
too delicate a matter to be left to a tool, and also felt that the tool
would never be able to handle cases like adding a not null field.
Recently I had to work on a project where South was installed and was
pleasantly surprised at the ease of use and the elegant way it solves
most migrations. Saves a lot of time. A hearty thanks to the authors
(and apologies for doubting them). One thing, I find that the
convert_to_south command does not seem to be necessary for adding South
to an existing project.
-- 
regards
Kenneth Gonsalves

-- 
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: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Nathan McCorkle
using guest on rabbitMQ, installed django-celery using pip... my task
returns true/false if it succeeds/fails... otherwise it does a lot of
database R/W

Its currently processing a file via the worker, and I'm able to
refresh the web browser on a page that shows how many genes have been
processed for a dataset... every refresh the number of genes is
increasing... so I guess there aren't any DB clash problems!
(hopefully)

now to implement a javascript/AJAX progress bar to start after the
upload finishes!

On Sun, Nov 27, 2011 at 11:49 PM, Brian Schott  wrote:
> What are your settings?  Using carrot?  Kombu?  RabbitMQ?
>
> Does your task try to return a value?
>
> Sent from my iPhone
>
> On Nov 27, 2011, at 11:22 PM, Nathan McCorkle  wrote:
>
>> P.S. the printGene function works... printing the messages on the
>> celeryd console terminal... the processXLS1 function doesn't even
>> print anything at all
>>
>> On Sun, Nov 27, 2011 at 11:21 PM, Nathan McCorkle  wrote:
>>> Yeah I've seen the djcelery solution before... I've tried implementing
>>> it, but I'm getting an error on the celeryd console:
>>> TypeError: processXLS1() got an unexpected keyword argument 'task_is_eager'
>>>
>>> when I try running processXLS1.delay(dataObjectID=someInteger) from a
>>> function in views.py
>>>
>>> here's what's in my tasks.py:
>>> "
>>> from celery.decorators import task
>>> from enzymeFilter.models import *
>>> from django.db import transaction
>>>
>>> @task
>>> def printGene(y):
>>>        print "ppp"
>>>        fil=open('/var/www/media/testFile','w')
>>>        fil.write('coming from background')
>>>        fil.close()
>>>
>>>        print Gene.objects.get(id=y+1)
>>>        return True
>>>
>>> @task
>>> @transaction.commit_manually
>>> def processXLS1(datasetObjectID):
>>>        print "processing XLS as task"
>>>        datasetObject = Dataset.objects.get(id=datasetObjectID)
>>>        try:
>>>            ... more processing code
>>> "
>>>
>>> thanks
>>> -Nathan
>>>
>>> On Sun, Nov 27, 2011 at 9:52 PM, Brian Schott  wrote:
 You really should look at django-celery and RabbitMQ.  The upload submit 
 can initiate a task that is defined in tasks.py.  There are separate 
 worker processes that pick up the task from the message queue and do the 
 actual work.  These workers don't even have to be on the same machine with 
 rabbitMQ so you get instant scalability.   Then your AJAX job status view 
 can poll a job status table that is updated by the task and you don't have 
 to worry about threads.
 https://github.com/ask/django-celery

 Brian Schott
 bfsch...@gmail.com



 On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:

> I'm using Django 1.3 and am processing 3 files into genes, proteins,
> and genomes for a tool I built... this processing usually takes
> between 5 minutes to a few hours, depending on the genome size.
>
> After uploading the files (10-100 MB), the upload view begins
> processing the files, without returning for a long time (causing my
> browser to ask me if I want to kill the plupload script).
>
> For the user of this app, they don't know if their upload failed or is
> processing, etc... so I'd think forking the processing function (or
> making it a new thread) is what needs to happen, then the view can
> return to the user, and the upload page can start doing AJAX requests
> to check to processing progress.
>
> I feel like I want to do this:
> http://www.artfulcode.net/articles/threading-django/
> but am scared of crashing because I've heard Django isn't threadsafe
> with transactions. (and my processing function is making DB
> transactions)
>
> --
> 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.


>>>
>>>
>>>
>>> --
>>> Nathan McCorkle
>>> Rochester Institute of Technology
>>> College of Science, Biotechnology/Bioinformatics
>>>
>>
>>
>>
>> --
>> Nathan McCorkle
>> Rochester Institute of Technology
>> College of Science, Biotechnology/Bioinformatics
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-user

Re: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Brian Schott
What are your settings?  Using carrot?  Kombu?  RabbitMQ?  

Does your task try to return a value?  

Sent from my iPhone

On Nov 27, 2011, at 11:22 PM, Nathan McCorkle  wrote:

> P.S. the printGene function works... printing the messages on the
> celeryd console terminal... the processXLS1 function doesn't even
> print anything at all
> 
> On Sun, Nov 27, 2011 at 11:21 PM, Nathan McCorkle  wrote:
>> Yeah I've seen the djcelery solution before... I've tried implementing
>> it, but I'm getting an error on the celeryd console:
>> TypeError: processXLS1() got an unexpected keyword argument 'task_is_eager'
>> 
>> when I try running processXLS1.delay(dataObjectID=someInteger) from a
>> function in views.py
>> 
>> here's what's in my tasks.py:
>> "
>> from celery.decorators import task
>> from enzymeFilter.models import *
>> from django.db import transaction
>> 
>> @task
>> def printGene(y):
>>print "ppp"
>>fil=open('/var/www/media/testFile','w')
>>fil.write('coming from background')
>>fil.close()
>> 
>>print Gene.objects.get(id=y+1)
>>return True
>> 
>> @task
>> @transaction.commit_manually
>> def processXLS1(datasetObjectID):
>>print "processing XLS as task"
>>datasetObject = Dataset.objects.get(id=datasetObjectID)
>>try:
>>... more processing code
>> "
>> 
>> thanks
>> -Nathan
>> 
>> On Sun, Nov 27, 2011 at 9:52 PM, Brian Schott  wrote:
>>> You really should look at django-celery and RabbitMQ.  The upload submit 
>>> can initiate a task that is defined in tasks.py.  There are separate worker 
>>> processes that pick up the task from the message queue and do the actual 
>>> work.  These workers don't even have to be on the same machine with 
>>> rabbitMQ so you get instant scalability.   Then your AJAX job status view 
>>> can poll a job status table that is updated by the task and you don't have 
>>> to worry about threads.
>>> https://github.com/ask/django-celery
>>> 
>>> Brian Schott
>>> bfsch...@gmail.com
>>> 
>>> 
>>> 
>>> On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:
>>> 
 I'm using Django 1.3 and am processing 3 files into genes, proteins,
 and genomes for a tool I built... this processing usually takes
 between 5 minutes to a few hours, depending on the genome size.
 
 After uploading the files (10-100 MB), the upload view begins
 processing the files, without returning for a long time (causing my
 browser to ask me if I want to kill the plupload script).
 
 For the user of this app, they don't know if their upload failed or is
 processing, etc... so I'd think forking the processing function (or
 making it a new thread) is what needs to happen, then the view can
 return to the user, and the upload page can start doing AJAX requests
 to check to processing progress.
 
 I feel like I want to do this:
 http://www.artfulcode.net/articles/threading-django/
 but am scared of crashing because I've heard Django isn't threadsafe
 with transactions. (and my processing function is making DB
 transactions)
 
 --
 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.
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Nathan McCorkle
>> Rochester Institute of Technology
>> College of Science, Biotechnology/Bioinformatics
>> 
> 
> 
> 
> -- 
> Nathan McCorkle
> Rochester Institute of Technology
> College of Science, Biotechnology/Bioinformatics
> 
> -- 
> 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: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Nathan McCorkle
On Sun, Nov 27, 2011 at 11:21 PM, Nathan McCorkle  wrote:
> Yeah I've seen the djcelery solution before... I've tried implementing
> it, but I'm getting an error on the celeryd console:
> TypeError: processXLS1() got an unexpected keyword argument 'task_is_eager'

I couldn't find anything on this error via google... but once I
removed the manual transaction stuff (I was trying to speed things up
by doing transactions only after I did a bunch of database operations)
including the decorator above the function, it started working.


>
> when I try running processXLS1.delay(dataObjectID=someInteger) from a
> function in views.py
>
> here's what's in my tasks.py:
> "
> from celery.decorators import task
> from enzymeFilter.models import *
> from django.db import transaction
>
> @task
> def printGene(y):
>        print "ppp"
>        fil=open('/var/www/media/testFile','w')
>        fil.write('coming from background')
>        fil.close()
>
>        print Gene.objects.get(id=y+1)
>        return True
>
> @task
> @transaction.commit_manually
> def processXLS1(datasetObjectID):
>        print "processing XLS as task"
>        datasetObject = Dataset.objects.get(id=datasetObjectID)
>        try:
>            ... more processing code
> "
>
> thanks
> -Nathan
>
> On Sun, Nov 27, 2011 at 9:52 PM, Brian Schott  wrote:
>> You really should look at django-celery and RabbitMQ.  The upload submit can 
>> initiate a task that is defined in tasks.py.  There are separate worker 
>> processes that pick up the task from the message queue and do the actual 
>> work.  These workers don't even have to be on the same machine with rabbitMQ 
>> so you get instant scalability.   Then your AJAX job status view can poll a 
>> job status table that is updated by the task and you don't have to worry 
>> about threads.
>> https://github.com/ask/django-celery
>>
>> Brian Schott
>> bfsch...@gmail.com
>>
>>
>>
>> On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:
>>
>>> I'm using Django 1.3 and am processing 3 files into genes, proteins,
>>> and genomes for a tool I built... this processing usually takes
>>> between 5 minutes to a few hours, depending on the genome size.
>>>
>>> After uploading the files (10-100 MB), the upload view begins
>>> processing the files, without returning for a long time (causing my
>>> browser to ask me if I want to kill the plupload script).
>>>
>>> For the user of this app, they don't know if their upload failed or is
>>> processing, etc... so I'd think forking the processing function (or
>>> making it a new thread) is what needs to happen, then the view can
>>> return to the user, and the upload page can start doing AJAX requests
>>> to check to processing progress.
>>>
>>> I feel like I want to do this:
>>> http://www.artfulcode.net/articles/threading-django/
>>> but am scared of crashing because I've heard Django isn't threadsafe
>>> with transactions. (and my processing function is making DB
>>> transactions)
>>>
>>> --
>>> 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.
>>
>>
>
>
>
> --
> Nathan McCorkle
> Rochester Institute of Technology
> College of Science, Biotechnology/Bioinformatics
>



-- 
Nathan McCorkle
Rochester Institute of Technology
College of Science, Biotechnology/Bioinformatics

-- 
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: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Nathan McCorkle
P.S. the printGene function works... printing the messages on the
celeryd console terminal... the processXLS1 function doesn't even
print anything at all

On Sun, Nov 27, 2011 at 11:21 PM, Nathan McCorkle  wrote:
> Yeah I've seen the djcelery solution before... I've tried implementing
> it, but I'm getting an error on the celeryd console:
> TypeError: processXLS1() got an unexpected keyword argument 'task_is_eager'
>
> when I try running processXLS1.delay(dataObjectID=someInteger) from a
> function in views.py
>
> here's what's in my tasks.py:
> "
> from celery.decorators import task
> from enzymeFilter.models import *
> from django.db import transaction
>
> @task
> def printGene(y):
>        print "ppp"
>        fil=open('/var/www/media/testFile','w')
>        fil.write('coming from background')
>        fil.close()
>
>        print Gene.objects.get(id=y+1)
>        return True
>
> @task
> @transaction.commit_manually
> def processXLS1(datasetObjectID):
>        print "processing XLS as task"
>        datasetObject = Dataset.objects.get(id=datasetObjectID)
>        try:
>            ... more processing code
> "
>
> thanks
> -Nathan
>
> On Sun, Nov 27, 2011 at 9:52 PM, Brian Schott  wrote:
>> You really should look at django-celery and RabbitMQ.  The upload submit can 
>> initiate a task that is defined in tasks.py.  There are separate worker 
>> processes that pick up the task from the message queue and do the actual 
>> work.  These workers don't even have to be on the same machine with rabbitMQ 
>> so you get instant scalability.   Then your AJAX job status view can poll a 
>> job status table that is updated by the task and you don't have to worry 
>> about threads.
>> https://github.com/ask/django-celery
>>
>> Brian Schott
>> bfsch...@gmail.com
>>
>>
>>
>> On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:
>>
>>> I'm using Django 1.3 and am processing 3 files into genes, proteins,
>>> and genomes for a tool I built... this processing usually takes
>>> between 5 minutes to a few hours, depending on the genome size.
>>>
>>> After uploading the files (10-100 MB), the upload view begins
>>> processing the files, without returning for a long time (causing my
>>> browser to ask me if I want to kill the plupload script).
>>>
>>> For the user of this app, they don't know if their upload failed or is
>>> processing, etc... so I'd think forking the processing function (or
>>> making it a new thread) is what needs to happen, then the view can
>>> return to the user, and the upload page can start doing AJAX requests
>>> to check to processing progress.
>>>
>>> I feel like I want to do this:
>>> http://www.artfulcode.net/articles/threading-django/
>>> but am scared of crashing because I've heard Django isn't threadsafe
>>> with transactions. (and my processing function is making DB
>>> transactions)
>>>
>>> --
>>> 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.
>>
>>
>
>
>
> --
> Nathan McCorkle
> Rochester Institute of Technology
> College of Science, Biotechnology/Bioinformatics
>



-- 
Nathan McCorkle
Rochester Institute of Technology
College of Science, Biotechnology/Bioinformatics

-- 
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: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Nathan McCorkle
Yeah I've seen the djcelery solution before... I've tried implementing
it, but I'm getting an error on the celeryd console:
TypeError: processXLS1() got an unexpected keyword argument 'task_is_eager'

when I try running processXLS1.delay(dataObjectID=someInteger) from a
function in views.py

here's what's in my tasks.py:
"
from celery.decorators import task
from enzymeFilter.models import *
from django.db import transaction

@task
def printGene(y):
print "ppp"
fil=open('/var/www/media/testFile','w')
fil.write('coming from background')
fil.close()

print Gene.objects.get(id=y+1)
return True

@task
@transaction.commit_manually
def processXLS1(datasetObjectID):
print "processing XLS as task"
datasetObject = Dataset.objects.get(id=datasetObjectID)
try:
... more processing code
"

thanks
-Nathan

On Sun, Nov 27, 2011 at 9:52 PM, Brian Schott  wrote:
> You really should look at django-celery and RabbitMQ.  The upload submit can 
> initiate a task that is defined in tasks.py.  There are separate worker 
> processes that pick up the task from the message queue and do the actual 
> work.  These workers don't even have to be on the same machine with rabbitMQ 
> so you get instant scalability.   Then your AJAX job status view can poll a 
> job status table that is updated by the task and you don't have to worry 
> about threads.
> https://github.com/ask/django-celery
>
> Brian Schott
> bfsch...@gmail.com
>
>
>
> On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:
>
>> I'm using Django 1.3 and am processing 3 files into genes, proteins,
>> and genomes for a tool I built... this processing usually takes
>> between 5 minutes to a few hours, depending on the genome size.
>>
>> After uploading the files (10-100 MB), the upload view begins
>> processing the files, without returning for a long time (causing my
>> browser to ask me if I want to kill the plupload script).
>>
>> For the user of this app, they don't know if their upload failed or is
>> processing, etc... so I'd think forking the processing function (or
>> making it a new thread) is what needs to happen, then the view can
>> return to the user, and the upload page can start doing AJAX requests
>> to check to processing progress.
>>
>> I feel like I want to do this:
>> http://www.artfulcode.net/articles/threading-django/
>> but am scared of crashing because I've heard Django isn't threadsafe
>> with transactions. (and my processing function is making DB
>> transactions)
>>
>> --
>> 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.
>
>



-- 
Nathan McCorkle
Rochester Institute of Technology
College of Science, Biotechnology/Bioinformatics

-- 
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 testing. random test order with some 'dependency constraints'

2011-11-27 Thread Russell Keith-Magee
On Mon, Nov 28, 2011 at 9:39 AM, Gelonida N  wrote:
> I'd like to create some unit tests whch should be executed in random order.
>
>
> However some tests could benefit from results of some predecessor tests.
>
> Therefore they should be executed only after certain tests.

Unit tests are supposed to be isolated. They shouldn't depend on
execution order, or have any pre-requisite other than those specified
as part of the setUp()/teardown() methods. As a result, you won't find
a whole lot of documentation on how to do what you're describing.

The right way to approach this is to identify the required
preconditions for each test, and either construct those preconditions
in the setUp() method, or use Django's test fixtures to install test
data.

This is all covered in the documentation for Django's testing system;
most notably in the section on fixtures.

[1] https://docs.djangoproject.com/en/1.3/topics/testing/#fixture-loading

More broadly, you might want to dig into the documentation for
Python's unittest module, which is what Django's unit test framework
is built on.

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.



Re: Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Brian Schott
You really should look at django-celery and RabbitMQ.  The upload submit can 
initiate a task that is defined in tasks.py.  There are separate worker 
processes that pick up the task from the message queue and do the actual work.  
These workers don't even have to be on the same machine with rabbitMQ so you 
get instant scalability.   Then your AJAX job status view can poll a job status 
table that is updated by the task and you don't have to worry about threads.
https://github.com/ask/django-celery

Brian Schott
bfsch...@gmail.com



On Nov 27, 2011, at 8:54 PM, Nathan McCorkle wrote:

> I'm using Django 1.3 and am processing 3 files into genes, proteins,
> and genomes for a tool I built... this processing usually takes
> between 5 minutes to a few hours, depending on the genome size.
> 
> After uploading the files (10-100 MB), the upload view begins
> processing the files, without returning for a long time (causing my
> browser to ask me if I want to kill the plupload script).
> 
> For the user of this app, they don't know if their upload failed or is
> processing, etc... so I'd think forking the processing function (or
> making it a new thread) is what needs to happen, then the view can
> return to the user, and the upload page can start doing AJAX requests
> to check to processing progress.
> 
> I feel like I want to do this:
> http://www.artfulcode.net/articles/threading-django/
> but am scared of crashing because I've heard Django isn't threadsafe
> with transactions. (and my processing function is making DB
> transactions)
> 
> -- 
> 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.



Need to process uploaded files into database entries(takes hours), how do I return a progress bar?

2011-11-27 Thread Nathan McCorkle
I'm using Django 1.3 and am processing 3 files into genes, proteins,
and genomes for a tool I built... this processing usually takes
between 5 minutes to a few hours, depending on the genome size.

After uploading the files (10-100 MB), the upload view begins
processing the files, without returning for a long time (causing my
browser to ask me if I want to kill the plupload script).

For the user of this app, they don't know if their upload failed or is
processing, etc... so I'd think forking the processing function (or
making it a new thread) is what needs to happen, then the view can
return to the user, and the upload page can start doing AJAX requests
to check to processing progress.

I feel like I want to do this:
http://www.artfulcode.net/articles/threading-django/
but am scared of crashing because I've heard Django isn't threadsafe
with transactions. (and my processing function is making DB
transactions)

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



django testing. random test order with some 'dependency constraints'

2011-11-27 Thread Gelonida N
I'd like to create some unit tests whch should be executed in random order.


However some tests could benefit from results of some predecessor tests.

Therefore they should be executed only after certain tests.

Did anybody try to implement such a test setup with Django's default
unit tests?

Are there any 'recomended' ways / hooks of changing the order of tests?
Do many test cases depend on a certain order of test??
If yes, then I had to know how to exclude these tests from shuffling.

Are there any recommendations of how to describe dependencies?

Are there any recommended ways of how to carry data between different
tests? (e.g. make them member of the same TestCase class)


Thanks a lot for some feedback / suggestions.




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



django tests. where to create users

2011-11-27 Thread Gelonida N
Hi,

I'd like to run some django tests, which use the test client and which
should check, that certain users can only access certain contents.

Where would you create this users / passwords.
- With a fixture
- as part of a test class in the SetUp section and tear
 it down afterwards?

- create a custom test runner with a setup phase ?

Is there any other recommended code section, which could do the setup
prior to running tests.

Ideally I'd like to avoid fixtures.
Of course I could create a script to generate certain fixtures and run
only then the tests, but I'd prefer, the user data is created ad part of
the test procedure.


-- 
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: [ date and null value ]

2011-11-27 Thread Lord Goosfancito

El 27/11/11 02:00, Anoop Thomas Mathew escribió:

Hi,
Try this
*fechaProyecto = models.DateField(verbose_name=**'Ingresó a la 
subdirección de Proyecto', blank=True, null=True)*

Thanks,
Anoop
atm
___
Life is short, Live it hard.




On 27 November 2011 05:22, Lord Goosfancito > wrote:


Hello.

I have problem when i declared field with "blank" the admin django
show this error:

(1048, "Column 'fechaProyecto' cannot be null")

in my models.py:

fechaProyecto = models.DateField(verbose_name='Ingresó a la
subdirección de Proyecto')
fechaProyecto.blank = True

What is the problem?

Thank's

Gustavo.

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

good! thanks' all

--
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: Bulk import of data

2011-11-27 Thread Andre Terra
This should be run asynchronously (i.e. celery) when importing large files.

If you have a lot of categories/subcategories, you will need to bulk insert
them instead of looping through the data and just using get_or_create. A
single, long transaction will definitely bring great improvements to speed.

One tool is DSE, which I've mentioned before.

Good luck!


Cheers,
AT

On Sat, Nov 26, 2011 at 8:44 PM, Petr Přikryl  wrote:

>
> >>> import csv
> >>> data = csv.reader(open('/path/to/csv', 'r'), delimiter=';')
> >>> for row in data:
> >>> category = Category.objects.get_or_create(name=row[0])
> >>> sub_category = SubCategory.objects.get_or_create(name=row[1],
> >>> defaults={'parent_category': category})
> >>> product = Product.objects.get_or_create(name=row[2],
> >>> defaults={'sub_category': sub_category})
>
> There are few potential problems with the cvs as used here.
>
> Firstly, the file should be opened in binary mode.  In Unix-based
> systems, the binary mode is technically similar to text mode.
> However, you may once observe problems when you move
> the code to another environment (Windows).
>
> Secondly, the opened file should always be closed -- especially
> when building application (web) that may run for a long time.
> You can do it like this:
>
> ...
> f = open('/path/to/csv', 'rb')
> data = csv.reader(f, delimiter=';')
> for ...
> ...
> f.close()
>
> Or you can use the new Python construct "with".
>
> P.
>
> --
> 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 do some additional process while saving a django flatpage

2011-11-27 Thread Swaroop Shankar V
Well Daniel, I tried this but i am not able to see the function being
called while saving any flatpage page. Is it possible to give me a step by
step instruction on how to achieve the same? I read through the signals
documents but i am kind of confused on where to include the signal related
statements since the document do not give much details about it. I am still
not able to completely understand the signal's system in django. So I would
request for a step by step instruction, if its possible. Thanks

Regards,
Swaroop Shankar V



On Mon, Oct 3, 2011 at 9:22 PM, Swaroop Shankar V wrote:

> Thanks a lot Daniel, I guess this is exactly what I require. Will check it
> and revert back.
>
> Thanks and Regards,
> Swaroop Shankar V
>
>
>
> On Mon, Oct 3, 2011 at 4:21 PM, Daniel Roseman wrote:
>
>> On Sunday, 2 October 2011 15:03:12 UTC+1, Swaroop Shankar wrote:
>>>
>>> Hi,
>>> I am trying to build a menu system which can be controlled at the admin
>>> area. For the content management purpose i am using django flatpage. So
>>> when a page is getting saved i need to insert the page title and url in the
>>> menu table i have created. So i guess a flatpage signal is the best way to
>>> go, but after searching a lot i could not find any such signals available
>>> for flatpage. So which is the best approach to implement whatever i had
>>> described above. Thanks
>>> Regards,
>>>
>>> Swaroop Shankar V
>>>
>>>
>> You don't need a specific flatpages signal. You can just use the normal
>> pre-save signal and attach the listener to flatpages only.
>>
>> from django.db.models.signals import pre_save
>> from django.dispatch import receiver
>> from django.contrib.flatpages.models import FlatPage
>>
>> @receiver(pre_save, sender=FlatPage)
>> def my_handler(sender, **kwargs):
>>...
>>
>>
>> https://docs.djangoproject.com/en/1.3/topics/signals/#connecting-to-signals-sent-by-specific-senders
>>
>> --
>> 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/-/-xs77MXmBh0J.
>>
>> 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: Installation of Django

2011-11-27 Thread william ratcliff
I've recommended:
http://www.amazon.com/Beginning-Python-Professional-Magnus-Hetland/dp/159059519X

To people with good success.


Best,
William

On Sun, Nov 27, 2011 at 8:46 AM, JJ Zolper  wrote:

> Sounds Great!
>
> I started yesterday.
>
> JJ
>
>
> On Nov 27, 2011, at 5:10 AM, Timothy Makobu 
> wrote:
>
> Read that Python tutorial first, It will answer all your questions . You
> need to read the WHOLE thing.
>
> http://docs.python.org/tutorial/index.html
>
>
>
> On Sun, Nov 27, 2011 at 3:52 AM, JJ Zolper  wrote:
>
>> Tim,
>>
>> Does our system include a Python Interpreter?
>>
>> "
>>
>> The interpreter’s line-editing features usually aren’t very
>> sophisticated. On Unix, whoever installed the interpreter may have enabled
>> support for the GNU readline library, which adds more elaborate interactive
>> editing and history features. Perhaps the quickest check to see whether
>> command line editing is supported is typing Control-P to the first Python
>> prompt you get. If it beeps, you have command line editing; see Appendix
>> *Interactive Input Editing and History 
>> Substitution*
>>  for
>> an introduction to the keys. If nothing appears to happen, or if ^P is
>> echoed, command line editing isn’t available; you’ll only be able to use
>> backspace to remove characters from the current line.
>>
>> "
>>
>> JJ
>>
>> On Sat, Nov 26, 2011 at 6:55 PM, JJ Zolper  wrote:
>>
>>> So you feel that that documentation of Python is the best reference? I'm
>>> sure it is just wanted to ask.
>>>
>>> JJ
>>>
>>>
>>> On Sat, Nov 26, 2011 at 2:20 PM, Timothy Makobu <
>>> makobu.mwambir...@gmail.com> wrote:
>>>
 But first, all of this http://docs.python.org/tutorial/index.html


 On Sat, Nov 26, 2011 at 10:19 PM, Timothy Makobu <
 makobu.mwambir...@gmail.com> wrote:

> Nice. Now read ALL of this http://djangobook.com/en/2.0/
>
>
> On Sat, Nov 26, 2011 at 9:55 PM, JJ Zolper  wrote:
>
>> Looks like I am in good shape!
>>
>> Thanks so much man!
>>
>> http://madtrak.com/success.png
>>
>> JJ
>>
>>
>> On Sat, Nov 26, 2011 at 1:51 PM, JJ Zolper  wrote:
>>
>>> Thanks! Yes sounds like something from my UNIX class. I have now
>>> added it.
>>>
>>> What will django-admin.py do for me? Oh are you just saying I can
>>> run it from anywhere now? Any of the commands I want to work with
>>> python/django?
>>>
>>> JJ
>>>
>>>
>>> On Sat, Nov 26, 2011 at 12:56 AM, Timothy Makobu <
>>> makobu.mwambir...@gmail.com> wrote:
>>>
 Yes, iPython is installed now. But now you need to add  
 C:\Python27\Scripts
 to your PATH variable, so you wont have to keep going there to run 
 things.
 After you add it, you can run django-admin.py, easy_install, iPython 
 ...
 from any directory in cmd.exe

 This link shows you how:
 http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx




 On Sat, Nov 26, 2011 at 12:49 AM, JJ Zolper wrote:

> Tim,
>
> Okay I was able to get something to go there.
>
> At first I saw warnings so I wasn't sure but here are the images.
>
> http://madtrak.com/ipython1.png
>
> http://madtrak.com/ipython2.png
>
> Do you think I am in good shape with ipython?
>
> To perform the easy install of django would i execute: 
> easy_install.exe
> django?
>
> And if so would that just overwrite what I have already installed,
> like would it be good to do it a second time even though I think it 
> worked
> the first. Honestly, I'd probably leave it for now just wanted your
> thoughts on easy install.
>
> Thanks!
>
> JJ
>
> On Fri, Nov 25, 2011 at 1:20 PM, Timothy Makobu <
> makobu.mwambir...@gmail.com> wrote:
>
>> Hi, you're welcome.
>>
>> Easy install is usually in C:\Python27\Scripts
>>
>> you can go there from within cmd.exe and run "easy_install.exe
>> ipython"  It should work.
>>
>>
>> On Fri, Nov 25, 2011 at 7:56 PM, JJ Zolper wrote:
>>
>>> Tim,
>>>
>>> I had a confirmation from William that I installed Django but
>>> you said
>>> iPython would be helpful and since I don't remember much Python
>>> I was
>>> hoping to make that work.
>>>
>>> Thanks so much for taking the time to help me get started you're
>>> a
>>> life saver! : )
>>>
>>> JJ
>>>
>>> On Nov 24, 11:56 pm, Timothy Makobu >> >
>>> wrote:
>>> >- Install setup

Re: Installation of Django

2011-11-27 Thread JJ Zolper
Sounds Great!

I started yesterday.

JJ


On Nov 27, 2011, at 5:10 AM, Timothy Makobu  wrote:

> Read that Python tutorial first, It will answer all your questions . You need 
> to read the WHOLE thing.
> 
> http://docs.python.org/tutorial/index.html
> 
> 
> 
> On Sun, Nov 27, 2011 at 3:52 AM, JJ Zolper  wrote:
> Tim,
> 
> Does our system include a Python Interpreter? 
> 
> "
> 
> The interpreter’s line-editing features usually aren’t very sophisticated. On 
> Unix, whoever installed the interpreter may have enabled support for the GNU 
> readline library, which adds more elaborate interactive editing and history 
> features. Perhaps the quickest check to see whether command line editing is 
> supported is typing Control-P to the first Python prompt you get. If it 
> beeps, you have command line editing; see Appendix Interactive Input Editing 
> and History Substitution for an introduction to the keys. If nothing appears 
> to happen, or if ^P is echoed, command line editing isn’t available; you’ll 
> only be able to use backspace to remove characters from the current line.
> 
> "
> 
> JJ
> 
> On Sat, Nov 26, 2011 at 6:55 PM, JJ Zolper  wrote:
> So you feel that that documentation of Python is the best reference? I'm sure 
> it is just wanted to ask.
> 
> JJ
> 
> 
> On Sat, Nov 26, 2011 at 2:20 PM, Timothy Makobu  
> wrote:
> But first, all of this http://docs.python.org/tutorial/index.html
> 
> 
> On Sat, Nov 26, 2011 at 10:19 PM, Timothy Makobu 
>  wrote:
> Nice. Now read ALL of this http://djangobook.com/en/2.0/
> 
> 
> On Sat, Nov 26, 2011 at 9:55 PM, JJ Zolper  wrote:
> Looks like I am in good shape!
> 
> Thanks so much man!
> 
> http://madtrak.com/success.png
> 
> JJ
> 
> 
> On Sat, Nov 26, 2011 at 1:51 PM, JJ Zolper  wrote:
> Thanks! Yes sounds like something from my UNIX class. I have now added it.
> 
> What will django-admin.py do for me? Oh are you just saying I can run it from 
> anywhere now? Any of the commands I want to work with python/django?
> 
> JJ
> 
> 
> On Sat, Nov 26, 2011 at 12:56 AM, Timothy Makobu 
>  wrote:
> Yes, iPython is installed now. But now you need to add  C:\Python27\Scripts 
> to your PATH variable, so you wont have to keep going there to run things. 
> After you add it, you can run django-admin.py, easy_install, iPython ... from 
> any directory in cmd.exe 
> 
> This link shows you how: 
> http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
> 
> 
> 
> 
> On Sat, Nov 26, 2011 at 12:49 AM, JJ Zolper  wrote:
> Tim,
> 
> Okay I was able to get something to go there.
> 
> At first I saw warnings so I wasn't sure but here are the images.
> 
> http://madtrak.com/ipython1.png
> 
> http://madtrak.com/ipython2.png
> 
> Do you think I am in good shape with ipython?
> 
> To perform the easy install of django would i execute: easy_install.exe 
> django?
> 
> And if so would that just overwrite what I have already installed, like would 
> it be good to do it a second time even though I think it worked the first. 
> Honestly, I'd probably leave it for now just wanted your thoughts on easy 
> install.
> 
> Thanks!
> 
> JJ
> 
> On Fri, Nov 25, 2011 at 1:20 PM, Timothy Makobu  
> wrote:
> Hi, you're welcome. 
> 
> Easy install is usually in C:\Python27\Scripts
> 
> you can go there from within cmd.exe and run "easy_install.exe ipython"  It 
> should work.
> 
> 
> On Fri, Nov 25, 2011 at 7:56 PM, JJ Zolper  wrote:
> Tim,
> 
> I had a confirmation from William that I installed Django but you said
> iPython would be helpful and since I don't remember much Python I was
> hoping to make that work.
> 
> Thanks so much for taking the time to help me get started you're a
> life saver! : )
> 
> JJ
> 
> On Nov 24, 11:56 pm, Timothy Makobu 
> wrote:
> >- Install setup toolshttp://pypi.python.org/pypi/setuptools/0.6c11
> >- Go to the command line (cmd.exe) and type
> >   - easy_install django
> >   - easy_install ipython (not needed by django, but very useful, as you
> >   will see when you come to running "python manage.py shell"
> >
> > That's all!
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Nov 25, 2011 at 3:59 AM, JJ Zolper  wrote:
> > > Okay just so everyone knows!
> >
> > > I was able to extract the .tar file and I now see the files.
> >
> > > In order to import these files correctly should I place these files in the
> > > install directory of Python 2.7 and then attempt the commands?
> >
> > > Or is the location of Django just arbitrary can I place it wherever I like
> > > and then work from the Python prompt?
> >
> > > JJ
> >
> > > On Thu, Nov 24, 2011 at 11:58 AM, Ivo Brodien  wrote:
> >
> > >> windows users have extracted your command will look like this: ...
> > >> to execute the .tar file.
> >
> > >> as tom mentioned, you have to use 7zip two times.
> >
> > >> the tar file is another archive (like .zip, .gz ) which you have to
> > >> decompress and then you have the django directory and you can go on with
> > >> the tutoria

startproject

2011-11-27 Thread veva...@yandex.ru
Hi !
Command django-admin.py startproject stopped work on my computer (it
worked well in the past), I get:
Usage: django-admin.py subcommand [options] [args]
etc.
I found it was because I have set another Python version last week. At
first I got such a message:

Traceback (most recent call last):
  File "C:\python26\lib\site-packages\django\bin\django-admin.py",
line 2, in 
from django.core import management
ImportError: No module named django.core

Then I removed the 2nd Python version. Now I get the message I wrote
on the top.
I can not fix this problem.
I use Windows 7, Python 2.6.6, Django 1.3.
PATH=C:\python26\lib\site-packages\django\bin\;
PYTHONPATH=C:\python26
There was similar question
https://groups.google.com/group/django-users/browse_thread/thread/6fbeaa486de657a8/9295d515ce9f79ae?hl=ru&lnk=gst&q=startproject#9295d515ce9f79ae
I think there was no satisfactory answer.
This is a copy of my screen:
c:\DjangoMySites>django-admin.py startproject newsite
Usage: django-admin.py subcommand [options] [args]
Options:
  -v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal
output,
2=all output
  --settings=SETTINGS   The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't
provided, the
DJANGO_SETTINGS_MODULE environment variable
will be
used.
  --pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
  --traceback   Print traceback on exception
  --version show program's version number and exit
  -h, --helpshow this help message and exit
Type 'django-admin.py help ' for help on a specific
subcommand.
Available subcommands:
  cleanup
  compilemessages
...
  startproject
  syncdb
  test
  testserver
  validate

DJANGO_SETTINGS_MODULE , I think, is not wrong:
c:\DjangoMySites>DJANGO_SETTINGS_MODULE
"DJANGO_SETTINGS_MODULE" is not internal or external command,
executable program or a batch 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.



Re: [ date and null value ]

2011-11-27 Thread Daniel Molina Wegener
On Saturday 26 November 2011,
Lord Goosfancito  wrote:

> Hello.
> 
> I have problem when i declared field with "blank" the admin django show
> this error:
> 
> (1048, "Column 'fechaProyecto' cannot be null")
> 
> in my models.py:
> 
>  fechaProyecto = models.DateField(verbose_name='Ingresó a la
> subdirección de Proyecto')
>  fechaProyecto.blank = True
> 
> What is the problem?

  You must define:

  _fecha_proyecto_label = u'Ingresó a la subdirección de Proyecto'
  fechaProyecto = models.DateField(verbose_name=_fecha_proyecto_label,
   blank=True,
   null=True)

  Also, camel case is not used in Python and Django standards. Please
read the Style Guide and the Zen of Python to have a better approach
on Python coding:

  Style Guide:
  http://www.python.org/dev/peps/pep-0008/

  Zen of Python:
  http://www.python.org/dev/peps/pep-0020/

> 
> Thank's
> 
> Gustavo.


Best regards,
-- 
Daniel Molina Wegener 
System Programmer & Web Developer
Phone: +56 (2) 979-0277 | Blog: http://coder.cl/

-- 
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: filesystem path in settings.py

2011-11-27 Thread TANYA
I read it but after following all steps in it the error still remains.

 '/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg',
 '/usr/lib/python2.6',
 '/usr/lib/python2.6/plat-linux2',
 '/usr/lib/python2.6/lib-tk',
 '/usr/lib/python2.6/lib-old',
 '/usr/lib/python2.6/lib-dynload',
 '/usr/local/lib/python2.6/dist-packages',
 '/usr/lib/python2.6/dist-packages',
 '/usr/lib/python2.6/dist-packages/PIL',
 '/usr/lib/pymodules/python2.6',
 '/usr/lib/pymodules/python2.6/gtk-2.0',
 '/usr/lib/python2.6/dist-packages/wx-2.6-gtk2-unicode'

I did symlink to /usr/bin/local but still get path error. Please help.


On Fri, Nov 25, 2011 at 4:44 AM, Timothy Makobu  wrote:

> And this too http://www.djangobook.com/en/2.0/
>
>
> On Fri, Nov 25, 2011 at 7:41 AM, Timothy Makobu <
> makobu.mwambir...@gmail.com> wrote:
>
>> Hi,
>>
>> Please read this whole thing
>> https://docs.djangoproject.com/en/dev/howto/static-files/
>>
>>
>> On Fri, Nov 25, 2011 at 6:28 AM, TANYA  wrote:
>>
>>> # Absolute filesystem path to the directory that will hold user-uploaded
>>> files.
>>> # Example: "/home/media/media.lawrence.com/media/"
>>> MEDIA_ROOT = ''
>>>
>>> I want to upload css files and images so must I put them in /home/media
>>> or /home/my/media/path/ ? Should the filesystem path in settings.py be
>>> changed or should MEDIA_ROOT be left empty?
>>>
>>> --
>>> TANYA
>>>
>>> --
>>> 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.
>



-- 
TANYA

-- 
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: Installation of Django

2011-11-27 Thread Timothy Makobu
Read that Python tutorial first, It will answer all your questions . You
need to read the WHOLE thing.

http://docs.python.org/tutorial/index.html



On Sun, Nov 27, 2011 at 3:52 AM, JJ Zolper  wrote:

> Tim,
>
> Does our system include a Python Interpreter?
>
> "
>
> The interpreter’s line-editing features usually aren’t very sophisticated.
> On Unix, whoever installed the interpreter may have enabled support for the
> GNU readline library, which adds more elaborate interactive editing and
> history features. Perhaps the quickest check to see whether command line
> editing is supported is typing Control-P to the first Python prompt you
> get. If it beeps, you have command line editing; see Appendix *Interactive
> Input Editing and History 
> Substitution*
>  for
> an introduction to the keys. If nothing appears to happen, or if ^P is
> echoed, command line editing isn’t available; you’ll only be able to use
> backspace to remove characters from the current line.
>
> "
>
> JJ
>
> On Sat, Nov 26, 2011 at 6:55 PM, JJ Zolper  wrote:
>
>> So you feel that that documentation of Python is the best reference? I'm
>> sure it is just wanted to ask.
>>
>> JJ
>>
>>
>> On Sat, Nov 26, 2011 at 2:20 PM, Timothy Makobu <
>> makobu.mwambir...@gmail.com> wrote:
>>
>>> But first, all of this http://docs.python.org/tutorial/index.html
>>>
>>>
>>> On Sat, Nov 26, 2011 at 10:19 PM, Timothy Makobu <
>>> makobu.mwambir...@gmail.com> wrote:
>>>
 Nice. Now read ALL of this http://djangobook.com/en/2.0/


 On Sat, Nov 26, 2011 at 9:55 PM, JJ Zolper  wrote:

> Looks like I am in good shape!
>
> Thanks so much man!
>
> http://madtrak.com/success.png
>
> JJ
>
>
> On Sat, Nov 26, 2011 at 1:51 PM, JJ Zolper  wrote:
>
>> Thanks! Yes sounds like something from my UNIX class. I have now
>> added it.
>>
>> What will django-admin.py do for me? Oh are you just saying I can run
>> it from anywhere now? Any of the commands I want to work with 
>> python/django?
>>
>> JJ
>>
>>
>> On Sat, Nov 26, 2011 at 12:56 AM, Timothy Makobu <
>> makobu.mwambir...@gmail.com> wrote:
>>
>>> Yes, iPython is installed now. But now you need to add  
>>> C:\Python27\Scripts
>>> to your PATH variable, so you wont have to keep going there to run 
>>> things.
>>> After you add it, you can run django-admin.py, easy_install, iPython ...
>>> from any directory in cmd.exe
>>>
>>> This link shows you how:
>>> http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
>>>
>>>
>>>
>>>
>>> On Sat, Nov 26, 2011 at 12:49 AM, JJ Zolper wrote:
>>>
 Tim,

 Okay I was able to get something to go there.

 At first I saw warnings so I wasn't sure but here are the images.

 http://madtrak.com/ipython1.png

 http://madtrak.com/ipython2.png

 Do you think I am in good shape with ipython?

 To perform the easy install of django would i execute: easy_install.exe
 django?

 And if so would that just overwrite what I have already installed,
 like would it be good to do it a second time even though I think it 
 worked
 the first. Honestly, I'd probably leave it for now just wanted your
 thoughts on easy install.

 Thanks!

 JJ

 On Fri, Nov 25, 2011 at 1:20 PM, Timothy Makobu <
 makobu.mwambir...@gmail.com> wrote:

> Hi, you're welcome.
>
> Easy install is usually in C:\Python27\Scripts
>
> you can go there from within cmd.exe and run "easy_install.exe
> ipython"  It should work.
>
>
> On Fri, Nov 25, 2011 at 7:56 PM, JJ Zolper wrote:
>
>> Tim,
>>
>> I had a confirmation from William that I installed Django but you
>> said
>> iPython would be helpful and since I don't remember much Python I
>> was
>> hoping to make that work.
>>
>> Thanks so much for taking the time to help me get started you're a
>> life saver! : )
>>
>> JJ
>>
>> On Nov 24, 11:56 pm, Timothy Makobu 
>> wrote:
>> >- Install setup toolshttp://
>> pypi.python.org/pypi/setuptools/0.6c11
>> >- Go to the command line (cmd.exe) and type
>> >   - easy_install django
>> >   - easy_install ipython (not needed by django, but very
>> useful, as you
>> >   will see when you come to running "python manage.py shell"
>> >
>> > That's all!
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Nov 25, 20