Button with save and custom action in Admin

2012-12-10 Thread Rob
In Django 1.4 I am working on a small mailing app, and in the admin change 
page I would like to add a button called "send mailing". When the user 
presses the button the model should be saved first, en then redirected to a 
custom page to view and confirm the mailing before send.

I saw lots of snippets, custom actions etc. etc. but I cannot get it 
working. 

I have add a custom change_form.html in /templates/admin/myapp and 
succesfully added a button. But how do I "tell" Django to do the two 
actions?

When I add name="_save" to the button the model is saved after pressing the 
custom button, but now I need a redirect to a custom page using the currect 
model.

-- 
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/-/_31scvnqkRsJ.
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 мастер на все руки

2012-12-10 Thread fuxter fuxter
Django russian 
group

On Monday, December 10, 2012 8:21:02 AM UTC+4, GeorgeS wrote:
>
> Нужен Django мастер на все руки:
>
>  - Опыт с Django от 4 лет
>
>  - Отличное знание серверной части
>
>  - Отличное знание Postgres
>
>  - HTML5, CSS3, JavaScript, (jQuery, Bootstrap, etc.)
>
>  - Опыт установки и настройки под LINUX
>
>  - Желателен опыт с Amazon AWS (или другими SAAS, PAAS системами)
>
>
> Если опыт с клиентской частью не ахти - ничего страшного, главное - 
> отличное знание серверной части и DB. Если что-то не знаете, тоже не 
> смертельно. Важны энергичность, заинтересованность, и желание построить 
> что-то значимое и нужное огромному числу людей.
>
>
> Вы должны быть коммуникабельны и самодостаточны . Если что-то не знаете - 
> найти и разобраться. Если требует слишком много усилий - найти человека 
> который может объяснить или сделать (их услуги будем оплачивать отдельно).
>
>
> Работа удаленная. Полная занятость. Зарплата, по российским меркам, 
> высокая.
>
>
> Если Вы знаете кого-то подходящего, перешлите пожалуйста это сообщение.
>
>
> Спасибо!
>
>

-- 
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/-/IDOcw-BLPG0J.
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:

2012-12-10 Thread Mario Gudelj
Make sure you have files 500.html and 404.html in your templates folder. If
not create them. Or use django 1.5

Mario
www.zenbookings.com
On 10 Dec, 2012 5:14 PM, "vinoth kumar renganathan" <
vinoth.vinothre...@gmail.com> wrote:

> when i start to run python manage.py runserverto start the
> DEVELOPMENT SERVER
>
> i got this trouble in my terminal
>
> like
>
>raise TemplateDoesNotExist(name)
> TemplateDoesNotExist: 500.html
>
>
> so i am new one to django someone help me to let out of this problem
>
>  --
> 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: Loading XSD file into memory ONCE

2012-12-10 Thread Tom Evans
On Sun, Dec 9, 2012 at 8:05 AM, Dwayne Ghant  wrote:
> Hello All,
>
> I will be short and sweet.  I have a simple (well at least I think it's
> simple) question.  First let me explain,  I'm writing a RESTful webservice
> that uses validates xml submissions using an xsd (440kb in size),
> pre-defined, schema.  I would, idealistically, like to bootstrap the schema
> into memory so that it's not being requested every time the web service is
> requested.  What's the best way to do this?  A brief google search yielded
> the results below
> (http://stackoverflow.com/questions/11159077/python-load-2gb-of-text-file-to-memory):
>
> import mmap
>
> with open('dump.xml', 'rb') as f:
>   # Size 0 will read the ENTIRE file into memory!
>   m = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) #File is open read-only
>
>   # Proceed with your code here -- note the file is already in memory
>   # so "readine" here will be as fast as could be
>   data = m.readline()
>   while data:
> # Do stuff
> data = m.readline()
>
>
> Will this work? Will this make the file only load once into memory?
>

No - not if you run that code on every (applicable) request. Ignore
the cost of reading it from disk - if you read a file from disk
repeatedly, even the worst OS should start to cache that file - the
actual cost is repeatedly re-parsing the XML document.

What you want to do is cache the resulting object, the parsed XML
document. An easy way to do this is by using a global:

__xsd_cache = None
def get_xsd():
  global __xsd_cache
  if __xsd_cache is None:
__xsd_cache = parse_xsd()
  return __xsd_cache

def parse_xsd():
  ...

The only problem with caching is that eventually, what is cached is no
longer correct. You will need to think about how and when you will/can
invalidate the cache.

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.



Re: Loading XSD file into memory ONCE

2012-12-10 Thread Ludwig Kraatz
Hi Dwayne,

I would suggest just use the django cache api:

https://docs.djangoproject.com/en/dev/topics/cache/#the-low-level-cache-api

Memcache is able to store 1mb Value.

https://docs.djangoproject.com/en/dev/topics/cache/#memcached

If you don't have / want a memcache instance, you can use local memory 
caching. ( providing a local memory cache for every process running your 
system. )

https://docs.djangoproject.com/en/dev/topics/cache/#local-memory-caching

Then easily do 

current_xsd = cache.get(xsd_id)

if not current_xsd:
   current_xsd =*load xsd from disk?*
   cache.set(xsd_id, current_xsd)


best regards

ludwig

Am Sonntag, 9. Dezember 2012 09:05:05 UTC+1 schrieb Dwayne Ghant:
>
> Hello All,
>
> I will be short and sweet.  I have a simple (well at least I think it's 
> simple) question.  First let me explain,  I'm writing a RESTful webservice 
> that uses validates xml submissions using an xsd (440kb in size), 
> pre-defined, schema.  I would, idealistically, like to bootstrap the schema 
> into memory so that it's not being requested every time the web service is 
> requested.  What's the best way to do this?  A brief google 
> search yielded the results below (
> http://stackoverflow.com/questions/11159077/python-load-2gb-of-text-file-to-memory
> ): 
>
> import mmap
> with open('dump.xml', 'rb') as f:
>   # Size 0 will read the ENTIRE file into memory!
>   m = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) #File is open read-only
>
>   # Proceed with your code here -- note the file is already in memory
>   # so "readine" here will be as fast as could be
>   data = m.readline()
>   while data:
> # Do stuff
> data = m.readline()
>
>
> Will this work? Will this make the file only load once into memory?
>
>

-- 
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/-/e0qb_d1qFk8J.
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: Button with save and custom action in Admin

2012-12-10 Thread Rob
I found a snippet which does everything I want (in case anybody runs into 
the same problem):
http://djangosnippets.org/snippets/2005/

-- 
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/-/2PnTxMJubekJ.
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 make django-registration use Chinese as username?

2012-12-10 Thread Tomas Neme
I *think* it should work OK, data-wise. Try changing the
login/registration forms so chinese characters pass the verification
process. You can start by trying with a simple CharField with no
verification and see if it works.

On Sun, Dec 9, 2012 at 7:49 AM, Scarl  wrote:
> I am a chinese user. I want to use django-registration to make a
> user-registration application.
> But I find django-registration only support english username. And its
> help_text are also english.
> I need to use Chinese as username.
> What should I do?
>
> --
> 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/-/sM6wldu7pvwJ.
> 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.



-- 
"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 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 Celery FIFO ORDER

2012-12-10 Thread psychok7


So I have this 2 applications connected with a REST API (json messages). 
One written in Django and the other in Php. I have an exact database 
replica on both sides (using mysql).

When i press "submit" on one of them, i want that data to be saved on the 
current app database, and start a cron job with celery/redis to update the 
remote database for the other app using rest.

*My question is, how do i attribute the same worker to my tasks in order to 
keep a FIFO order?*

I need my data to be consistent and FIFO is really important.

-- 
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/-/1JR6HYArsgQJ.
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: [JOB] Urgent - PHP/Python Developer needed

2012-12-10 Thread Mohamed Bouzahir
Hi Mr,

I have a great skills in php and i'm leanring pythion a ruby on rails is
there a position for me in your company?
BTW i'm from morocco i speak english, arabic and french.

*Mohamed Bouzahir*
*web engineer*
*+212664058422*

On Tue, May 1, 2012 at 3:13 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Leeming

-- 
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-MongoDb deployment at production servert

2012-12-10 Thread Chuck James
Hi,

I am developing a website using Django and MongoDb 
(http://django-mongodb.org/). I have read lots of forums and posts but 
still not able to figure it out what is the best way or default way to 
deploy Django project on web. So I have couple of questions related to 
this, it will be great if some one can guide me.

> Do I need a dedicated servers to implement Django with MongoDb if yes 
then what is the min/max requirement for them. What all controls and 
permissions I need for those servers. 
> What is the default way to deploy it (Django project with MongoDb), what 
is the best way to deploy it. 
> Can we deploy it without using apache or nginx. Like some kind of server 
in python best to deploy Django project and I don't need to install any 
other web server for it.

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/-/hwOS-VXpQlgJ.
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.



background task without celery

2012-12-10 Thread leonardo
Hi,

I'm deploying a project to validation purpose in Heroku and not worth 
paying for a worker to execute background task.
Is there a way to execute background task without celery + rabbitmq ?

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/-/zRrd_MT-mMUJ.
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.



Datastructure using django.

2012-12-10 Thread Subhodip Biswas
Hi all,

I am trying to implement a tree structure using django. There are two
packages I am looking at mptt and treebeard. Treebeard seems easy.

I have however two questions:

1. With mptt I found that if you have moved one child to another parent
both db and instance is updated but you need to reload or reregister every
time you call such action.Is there a better way of doing this?

2. If my child have more than one parent, the structure does not remain a
tree anymore. It becomes a graph i guess, How do you handle such situation.

3. How do I add treebeard or mptt into django admin. If I have one field
name and I register it in admin.py. I get error regarding depth,path,
numchild and name should be present. How do I handle this situation.

Apologies for asking so many questions.


-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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: background task without celery

2012-12-10 Thread Bill Freeman
On Mon, Dec 10, 2012 at 12:44 PM, leonardo wrote:

> Hi,
>
> I'm deploying a project to validation purpose in Heroku and not worth
> paying for a worker to execute background task.
> Is there a way to execute background task without celery + rabbitmq ?
>
> Thanks,
>

Another way to do this is with a cron task to runs a management command.
That still takes a separate task, however, if that costs money on heroku
(I'm unfamiliar with heroku).  You could spawn a thread at some point,
making sure that there is just one, and let it sleep for a fixed time (or
set the equivalent alarm signal), waking up to see if it has any work to do
(this can be hard to get right, and hard to debug).

-- 
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 Celery FIFO ORDER

2012-12-10 Thread Nikolas Stevenson-Molnar
You could use a separate queue for these tasks, and set up a single
worker for that queue.

_Nik

On 12/10/2012 8:20 AM, psychok7 wrote:
>
> So I have this 2 applications connected with a REST API (json
> messages). One written in Django and the other in Php. I have an exact
> database replica on both sides (using mysql).
>
> When i press "submit" on one of them, i want that data to be saved on
> the current app database, and start a cron job with celery/redis to
> update the remote database for the other app using rest.
>
> /*My question is, how do i attribute the same worker to my tasks in
> order to keep a FIFO order?*/
>
> I need my data to be consistent and FIFO is really important.
>
> -- 
> 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/-/1JR6HYArsgQJ.
> 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: background task without celery

2012-12-10 Thread Nikolas Stevenson-Molnar
You can configure a celery worker on the the same server you run
everything else on. Then you can still use celery (which is useful if
you ever want to scale to a separate worker machine down the road.

_Nik

On 12/10/2012 10:36 AM, Bill Freeman wrote:
>
>
> On Mon, Dec 10, 2012 at 12:44 PM, leonardo  > wrote:
>
> Hi,
>
> I'm deploying a project to validation purpose in Heroku and not
> worth paying for a worker to execute background task.
> Is there a way to execute background task without celery + rabbitmq ?
>
> Thanks,
>
>
> Another way to do this is with a cron task to runs a management
> command.  That still takes a separate task, however, if that costs
> money on heroku (I'm unfamiliar with heroku).  You could spawn a
> thread at some point, making sure that there is just one, and let it
> sleep for a fixed time (or set the equivalent alarm signal), waking up
> to see if it has any work to do (this can be hard to get right, and
> hard to debug).
> -- 
> 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: Django Celery FIFO ORDER

2012-12-10 Thread Nuno Khan
my problem is exactly setting up 1 worker.. can u provide some code please?


On Mon, Dec 10, 2012 at 6:48 PM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  You could use a separate queue for these tasks, and set up a single
> worker for that queue.
>
> _Nik
>
> On 12/10/2012 8:20 AM, psychok7 wrote:
>
> So I have this 2 applications connected with a REST API (json messages).
> One written in Django and the other in Php. I have an exact database
> replica on both sides (using mysql).
>
> When i press "submit" on one of them, i want that data to be saved on the
> current app database, and start a cron job with celery/redis to update the
> remote database for the other app using rest.
>
> *My question is, how do i attribute the same worker to my tasks in order
> to keep a FIFO order?*
>
> I need my data to be consistent and FIFO is really important.
> --
> 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/-/1JR6HYArsgQJ.
> 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.
>



-- 
Nuno Khan
Software Engineer
Cellphone : (+351) 962826983
Email: nun...@gmail.com
Url: http://www.linkedin.com/pub/nuno-khan/29/132/6b2

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



Implementing a monitoring system with django.

2012-12-10 Thread Marc Aymerich
Hi,
I'm considering to implement a simple monitorization system that
basically gathers some data from a set of nodes (<1000 nodes). The
gathered data should be stored in order to let users perform some
queries and maybe also generate some graphs.

I'm looking for advice in what components are best suited for each of
the following parts:

1) Storage: maybe something nonsql like MongoDB? or perhaps RRD?
2) Data gathering: celery periodic tasks?
3) Graphs: rrd? or some java script framework for graphing?

thanks for your comments!!
-- 
Marc

-- 
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 Celery FIFO ORDER

2012-12-10 Thread Nikolas Stevenson-Molnar
Use the manage.py command described here:
http://pypi.python.org/pypi/django-celery to start the worker (I use
supervisord to manage the process). If you only start the worker on a
single machine, then you'll only have one worker. This can be the same
machine that runs your webserver.

_Nik

On 12/10/2012 11:39 AM, Nuno Khan wrote:
> my problem is exactly setting up 1 worker.. can u provide some code
> please?
>
>
> On Mon, Dec 10, 2012 at 6:48 PM, Nikolas Stevenson-Molnar
> mailto:nik.mol...@consbio.org>> wrote:
>
> You could use a separate queue for these tasks, and set up a
> single worker for that queue.
>
> _Nik
>
> On 12/10/2012 8:20 AM, psychok7 wrote:
>>
>> So I have this 2 applications connected with a REST API (json
>> messages). One written in Django and the other in Php. I have an
>> exact database replica on both sides (using mysql).
>>
>> When i press "submit" on one of them, i want that data to be
>> saved on the current app database, and start a cron job with
>> celery/redis to update the remote database for the other app
>> using rest.
>>
>> /*My question is, how do i attribute the same worker to my tasks
>> in order to keep a FIFO order?*/
>>
>> I need my data to be consistent and FIFO is really important.
>>
>> -- 
>> 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/-/1JR6HYArsgQJ.
>> 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.
>
>
>
>
> -- 
> Nuno Khan
> Software Engineer
> Cellphone : (+351) 962826983
> Email: nun...@gmail.com 
> Url: http://www.linkedin.com/pub/nuno-khan/29/132/6b2
>
>
> -- 
> 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: Django-MongoDb deployment at production servert

2012-12-10 Thread Chuck James
Really no one  have Answer for this post, how people running big website 
using django, if no body knows how to deploy it.


On Monday, December 10, 2012 12:32:29 PM UTC-5, Chuck James wrote:
>
> Hi,
>
> I am developing a website using Django and MongoDb (
> http://django-mongodb.org/). I have read lots of forums and posts but 
> still not able to figure it out what is the best way or default way to 
> deploy Django project on web. So I have couple of questions related to 
> this, it will be great if some one can guide me.
>
> > Do I need a dedicated servers to implement Django with MongoDb if yes 
> then what is the min/max requirement for them. What all controls and 
> permissions I need for those servers. 
> > What is the default way to deploy it (Django project with MongoDb), what 
> is the best way to deploy it. 
> > Can we deploy it without using apache or nginx. Like some kind of server 
> in python best to deploy Django project and I don't need to install any 
> other web server for it.
>
> 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/-/ANxss7BBQrMJ.
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: background task without celery

2012-12-10 Thread John DeRosa
On Dec 10, 2012, at 9:44 AM, leonardo  wrote:

> Hi,
> 
> I'm deploying a project to validation purpose in Heroku and not worth paying 
> for a worker to execute background task.
> Is there a way to execute background task without celery + rabbitmq ?
> 

I investigated alternatives to Celery, and came up with a handful of worthy 
alternatives. See my blog posts at 
http://seeknuance.com/2012/08/09/my-requirements-for-replacing-celery/ and 
http://seeknuance.com/2012/08/14/alternatives-to-using-celery/, they might help 
your search.

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.



Re: IOError, Permission Denied using Amazon s3 w/ django-storage?

2012-12-10 Thread Mario Gudelj
I suspect you're on a Mac and your jpglib is not compiled properly. If you
are on Mac make sure you look into that.

Cheers,

mario
www.zenbookings.com
On 10 Dec, 2012 4:20 PM, "easypie"  wrote:

> Yeah. It's uploaded and by using django-filebrowser I can upload image,
> create folder and move them around but I am not able to use those image in
> posts. I am using Mezzanine btw. I put up a post over at their user group:
> https://groups.google.com/forum/?fromgroups=#!topic/mezzanine-users/SMHtMX1YgBY
>
> On Sunday, December 9, 2012 3:50:45 PM UTC-8, Chris Cogdon wrote:
>>
>> If you're using ImageField, that by default verifies that what you've
>> uploaded is in fact an image. It uses PIL (python image library, aka
>> python-imaging) to do that. make sure you have PIL installed and it is
>> working.
>>
>> On Sunday, December 9, 2012 12:40:22 AM UTC-8, easypie wrote:
>>>
>>> I got it working by granting 775 permission for that fold and its
>>> sub-folder where the files had to be created and lacked enough privilege to
>>> do so. Now everything works! ...I just need to figure out why the uploads
>>> won't accept .jpg files =\
>>>
>>> On Saturday, December 8, 2012 11:18:25 PM UTC-8, easypie wrote:

 I encountered an error where whenever I go to upload a file, it tells
 me that a folder doesn't have enough permission. What kind of permission do
 we give these folders? I use Apache server. Do I change the whole project
 folder to group www-data? Then set chmod to 775 to the project folder and
 all files in the project recursively? Here is my traceback error log:
 http://dpaste.org/5KUMf/!

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



[ANNOUNCE] Security releases (Django 1.3.5, Django 1.4.3, Django 1.5 beta 2)

2012-12-10 Thread James Bennett
Django 1.3.5, Django 1.4.3 and Django 1.5 beta 2 have just been issued
in response to security issues.

Details are available here:

https://www.djangoproject.com/weblog/2012/dec/10/security/

-- 
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 ajax HTTP 500 when trying to access request.GET

2012-12-10 Thread Loai Ghoraba
Hi all

I am trying to write a simple ajax that tries to know whether the username 
already exist before registering.
Whenever I try to access the request.GET in my view function, a HTTP 500 
error is raised, if the view function doesn't access it and only use hard 
coded values-for test- it works.

Any help ?

My code is :
jquery:

function checkUserNameUnique()
{
$.ajax({url:"/ajax/",
data:{username:$("input.username").val()},
success: function(result){
$("span#usernameMessage").text(result);
}
}
);
}
view:
def ajax(request):
username=request.GET["username"]
msg=""
try:
user=User.objects.get(username=username)
msg="username is okay"
except User.DoesNotExist:
msg="username already exists"
return HttpResponse(msg);

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



Possible Bug with GenericRelation and values_list

2012-12-10 Thread Skylar Saveland
I may have found a bug. I made a test case here:

https://github.com/skyl/django/commit/556df1c46146c2fc9c4022d838fa23f652f0ea8d

The final assertion fails. Is this a bug or do I misunderstand how this 
should work?

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/-/FcwARKk-EswJ.
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.



Project path

2012-12-10 Thread Lachlan Musicman
Hola,

I've got a split settings set up for my prod/dev sites, and in all the
hints I've  seen over the years, I've most appreciated the line at the
top of the settings file that goes like this (there are variations to
the theme):

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

But almost all of the docs that I grab this info from are pre
Django1.4, and I believe it was 1.4 where the structure changed
slightly - settings are now in

path/proj/proj/settings.py
path/proj/app1
path/proj/app2

I would like BASE_DIR to be path/proj/ so I can use it in
STATICFILES_DIRS for instance, but it's coming out as path/proj/proj/

I am thinking about:

SETTINGS_DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = os.path.join(SETTINGS_DIR, '..')

But it seems a bit convoluted or horrible.

Does anyone have a better solution they could share?

cheers
L.


--
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: IOError, Permission Denied using Amazon s3 w/ django-storage?

2012-12-10 Thread easypie
This is on Ubuntu. I am using Mezzanine framework built on top of Django. 
'pip install mezzanine' helps grab all the dependencies like Pillow (PIL). 
I'm not sure if this is what's causing the problem but thank you. I'll take 
a look at this.

On Monday, December 10, 2012 1:35:02 PM UTC-8, somecallitblues wrote:
>
> I suspect you're on a Mac and your jpglib is not compiled properly. If you 
> are on Mac make sure you look into that.
>
> Cheers,
>
> mario
> www.zenbookings.com
> On 10 Dec, 2012 4:20 PM, "easypie" > 
> wrote:
>
>> Yeah. It's uploaded and by using django-filebrowser I can upload image, 
>> create folder and move them around but I am not able to use those image in 
>> posts. I am using Mezzanine btw. I put up a post over at their user group: 
>> https://groups.google.com/forum/?fromgroups=#!topic/mezzanine-users/SMHtMX1YgBY
>>
>> On Sunday, December 9, 2012 3:50:45 PM UTC-8, Chris Cogdon wrote:
>>>
>>> If you're using ImageField, that by default verifies that what you've 
>>> uploaded is in fact an image. It uses PIL (python image library, aka 
>>> python-imaging) to do that. make sure you have PIL installed and it is 
>>> working.
>>>
>>> On Sunday, December 9, 2012 12:40:22 AM UTC-8, easypie wrote:

 I got it working by granting 775 permission for that fold and its 
 sub-folder where the files had to be created and lacked enough privilege 
 to 
 do so. Now everything works! ...I just need to figure out why the uploads 
 won't accept .jpg files =\

 On Saturday, December 8, 2012 11:18:25 PM UTC-8, easypie wrote:
>
> I encountered an error where whenever I go to upload a file, it tells 
> me that a folder doesn't have enough permission. What kind of permission 
> do 
> we give these folders? I use Apache server. Do I change the whole project 
> folder to group www-data? Then set chmod to 775 to the project folder and 
> all files in the project recursively? Here is my traceback error log: 
> http://dpaste.org/5KUMf/!
>
  -- 
>> 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/-/Drz7gK3Zxz8J.
>> 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/-/V5NQ660_A0sJ.
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 1.5 b1 django-admin.py error

2012-12-10 Thread Sultan Imanhodjaev
It worked for me too but I don't understand why it works this way.

On Tuesday, 4 December 2012 10:53:21 UTC+6, Aapo Rista wrote:
>
> keskiviikko, 28. marraskuuta 2012 16.53.15 UTC+2 Sultan Imanhodjaev 
> kirjoitti:
>
>> I use OSX Lion, virtualenv version 1.7.2, python 2.7.1. I just created a 
>> new virtualenv, downloaded and install Django 1.5 b1.
>>
>
> I had the same problem: Mac OS X 10.8.2, Python 2.7.3 is installed with 
> MacPorts, just downloaded Django-1.5b1.tar.gz, created virtualenv with 
> command
>
> virtualenv ~/Documents/workspace/virtualenv/myproject-1.5
>
> activated it:
>
> source ~/Documents/workspace/virtualenv/myproject-1.5/bin/activate
>
> and then tried to run django-admin.py help. This produced ImportError: 
> Could not import settings blaa blaa blaa.
>
> However, when I unset env variable DJANGO_SETTINGS_MODULE with command:
>
> export DJANGO_SETTINGS_MODULE=
>
> django-admin runs without complaints. You can verify if this variable is 
> set by issuing command:
>
> env | grep DJANGO_SETTINGS_MODULE
>
>
>

-- 
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/-/B0YxD_jfIMcJ.
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 Bug with GenericRelation and values_list

2012-12-10 Thread Karen Tracey
On Mon, Dec 10, 2012 at 8:52 PM, Skylar Saveland
wrote:

> I may have found a bug. I made a test case here:
>
>
> https://github.com/skyl/django/commit/556df1c46146c2fc9c4022d838fa23f652f0ea8d
>
> The final assertion fails. Is this a bug or do I misunderstand how this
> should work?
>
>
Answered on django-developers:
http://groups.google.com/group/django-developers/msg/b5a4c5bdc2577f3f

Karen
-- 
http://tracey.org/kmt/

-- 
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 ajax HTTP 500 when trying to access request.GET

2012-12-10 Thread Loai Ghoraba
the problem is solved now, seems rebooting sometimes works :) !

On Tue, Dec 11, 2012 at 2:04 AM, Loai Ghoraba  wrote:

> Hi all
>
> I am trying to write a simple ajax that tries to know whether the username
> already exist before registering.
> Whenever I try to access the request.GET in my view function, a HTTP 500
> error is raised, if the view function doesn't access it and only use hard
> coded values-for test- it works.
>
> Any help ?
>
> My code is :
> jquery:
>
> function checkUserNameUnique()
> {
> $.ajax({url:"/ajax/",
>  data:{username:$("input.username").val()},
> success: function(result){
> $("span#usernameMessage").text(result);
>  }
> }
> );
> }
> view:
> def ajax(request):
> username=request.GET["username"]
> msg=""
> try:
> user=User.objects.get(username=username)
> msg="username is okay"
> except User.DoesNotExist:
> msg="username already exists"
> return HttpResponse(msg);
>
> --
> 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/-/Acr4kmnJtSYJ.
> 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.