Force exception raising when transaction fails

2012-11-20 Thread Isaac XXX

Hi everybody,

I run into a weird scenario, caused by a complex code involving threads 
and so on.


The problem arised in some point, with a DatabaseError exception, saying:

/current transaction is aborted, commands ignored until end of 
transaction block/


Obviously, the line which arises that error is the next one after 
transaction is corrupted. So, my question is: how do I can force django 
to raise exceptions when a given transaction fail?


An example is the following

func1()
func2() <-- Here, a db transaction fails, making all next calls raise 
that DatabaseError exception

func3() <-- Here DatabaseError is raised

I just want that func2 notice me that there is an error with its 
transaction.


Thank you in advance

Vyrphan


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



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

2012-10-30 Thread Isaac XXX

Hi there,

maybe you're right, but I'm not really worried about RAM footprint, or 
resources consumption. I'm concerned now on architecture, setting a 
right scalable system, and a right cluster of systems, without lacks of 
communications between them.


Underlaying technologies can be easily replaced (say apache-mod_wsgi for 
gunicorn or uwsgi), and some performance improvements can be made, but 
this is not what I'm looking for. I'm looking for the tools to generate 
a robust system, balancing requests through several systems, and 
allowing increase the size of this system (adding more servers) without 
trouble.


Cheers,

Isaac

On 10/29/2012 05:18 PM, Some Developer wrote:

On 29/10/2012 16:03, Isaac XXX wrote:

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I 
lack the exact information about how to join systems, and what I was 
looking for was a source of cohesive information on all systems. At 
least, when I finish to build that system, I will write this tutorial.


For someone who can help me, I will describe here what I thought it 
can be this structure:


- 1 nginx, as a reverse proxy on frontend, serving static/media and 
redirecting content to apache clusters

- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac


Why not just ditch Apache entirely and just use Nginx for serving all 
media (both static and dynamic)? You can then save quite a few 
resources as you only need to run one HTTP server rather than two.


Using Nginx to serve Django content works well. Just serve your Django 
application via FastCGI or uWSGI and you'll significantly simplify 
your configuration and reduce RAM usage on your servers as well.




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



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

2012-10-30 Thread Isaac XXX
Thank you so much for tips. I will keep them when I start to test 
environment for performance.


Cheers

Isaac

On 10/29/2012 06:44 PM, Cal Leeming [Simplicity Media Ltd] wrote:

Hi Isaac,

If there is one thing I have learnt about scaling apps, it's about 
trying things out for yourself.


Sure there are some best practice guidelines (i.e. serving files from 
nginx, or using apache's X-SendFile rather than streaming out via the 
webapp), but if someone comes along and tells you to use X instead of 
Y, then you don't get the advantages of learning "the hard way".


Another important note is that scaling rarely goes up on a 1:1 ratio, 
i.e. the configuration and resources required to handle X number of 
requests/sec, may be completely different if you need to handle Y 
number of requests/sec.


And often what works for one person, won't work for another (scaling 
is entirely dependant on your application, despite what any of these 
cloud providers might tell you!)


In my own experience, I've found that;

* SSDs with Percona MySQL, resolves a LOT of performance problems - 
but don't abuse it

* Lots and lots and lots of query tuning and InnoDB tuning
* New Relic to identify bottlenecks
* IO contention is a big thing
* Snowball prevention (i.e. you set max clients to X, your backend 
can't handle it, your requests stack up, the load balancer forces time 
out, and your database gets smashed - or you set max memory too high, 
server goes into swap etc).

* uWSGI + nginx is amazing
* Identify where your bottlenecks are (in my own experience, IO/memory 
tends to come up more often than CPU)


Sadly I haven't tried PSQL so I can't offer any advice on this - 
Percona are dragging MySQL kicking and screaming into the 21st century 
and really doing some amazing things, but it's by no means perfect!


The above has helped us grow past 8k-12k requests/minute, the largest 
database we manage is around 1.1 billion rows weighing in at 160GB+, 
and we maintain around 60+ servers.


I should reiterate, the above is purely based on my own experience and 
use cases - I am by no means an expert on the subject and I'm still 
learning approaches on a daily basis - so this is really meant as 
"food for thought" rather than a "this is how you should do things".


Hope this helps a bit!

Cal

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com 
<mailto:vyrp...@gmail.com>> wrote:


Hi folks,

I'm developing a new application that should get high traffic.
Right now, I've other projects with the follow architecture:

Nginx on front: serving static content and redirecting to apache
for dynamic data
Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single
frontend/backend (1 nginx, 1 apache, 1 postgresql). The
requirements for this new project are really large, and I think I
will need to scale all system. Can anyone suggest me an all-in-one
tutorial, discussing the main points on scale a system?

I know there are different alternatives for DB (master-slave,
clustering...), nginx can serve as a reverse proxy or not... and I
need to merge all this information in a single scalable system,
but I can't find an unified source of information.

Can anyone help me on it?

-- 
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
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
<mailto:django-users%2bunsubscr...@googlegroups.com>.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


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



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

2012-10-30 Thread Isaac XXX

Hi Tom,

you're right, I was not really explicit about what were my lacks of 
information. Right now, the following points are the ones I can't found 
a howto for the desired deployment:


- Create a master-slave system on postgresql, maintaining all systems up 
to date, distributing reads, and centralizing writes
- How to configure a cluster of reverse proxies (a single reverse proxy 
can not be enought, and I need to plan to deploy more than 1 load balancers)


The rest (configure apache with mod_wsgit, configure nginx to serve 
static content and so on), is now solved on my current deployments, so 
it should not be a problem on a distributed environment.


Cheers,

Isaac

On 10/29/2012 05:23 PM, Tom Evans wrote:

On Mon, Oct 29, 2012 at 4:03 PM, Isaac XXX <vyrp...@gmail.com> wrote:

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I lack the
exact information about how to join systems, and what I was looking for was
a source of cohesive information on all systems. At least, when I finish to
build that system, I will write this tutorial.

For someone who can help me, I will describe here what I thought it can be
this structure:

- 1 nginx, as a reverse proxy on frontend, serving static/media and
redirecting content to apache clusters
- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac


I'm confused about what you are confused about - you seem to grasp
precisely what is required.

IE, which of the following Qs are you stuck at:

How to configure nginx to reverse proxy and balance to other http servers?
How to configure apache, mod_wsgi and django?
How to configure pgsql in a master/multiple slave environment?
How to configure django to issue write requests to the write master,
and distribute reads to read-only slaves?


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: Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX

Hi there,

thank you for response Tom.

Actually, I've a complete idea at how to build this system, but I lack 
the exact information about how to join systems, and what I was looking 
for was a source of cohesive information on all systems. At least, when 
I finish to build that system, I will write this tutorial.


For someone who can help me, I will describe here what I thought it can 
be this structure:


- 1 nginx, as a reverse proxy on frontend, serving static/media and 
redirecting content to apache clusters

- n apache servers, with mod_wsgi, serving dynamic data
- m postgresql servers, in a master-slave flavour

Cheers,

Isaac

On 10/29/2012 04:23 PM, Tom Evans wrote:

On Mon, Oct 29, 2012 at 2:42 PM, Isaac XXX <vyrp...@gmail.com> wrote:

Hi folks,

I'm developing a new application that should get high traffic. Right now,
I've other projects with the follow architecture:

Nginx on front: serving static content and redirecting to apache for dynamic
data
Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single frontend/backend (1
nginx, 1 apache, 1 postgresql). The requirements for this new project are
really large, and I think I will need to scale all system. Can anyone
suggest me an all-in-one tutorial, discussing the main points on scale a
system?

I know there are different alternatives for DB (master-slave,
clustering...), nginx can serve as a reverse proxy or not... and I need to
merge all this information in a single scalable system, but I can't find an
unified source of information.

Can anyone help me on it?


There is unlikely to be one authoritative source that will explain
precisely how to scale an app - part of this is it is domain specific
what "scale" and "app" mean!

So first off, "scale". You can scale up, or out. Scaling up means
running everything on faster hardware. Due to how IT progresses, every
18 months you can replace your server with something twice as fast.
Scale out means running everything over more boxes. Scale up is
trivial, just spend more money, scale out can be harder.

Most parts of the stack are easy to scale, because HTTP itself is
stateless and therefore easy to scale. Eg, if you have a nginx
frontend, serving static files and proxying to backend servers for
static content, and the nginx server is overloaded, it is easy to add
a balancer to route HTTP requests to multiple nginx servers.

The same is true for dynamic content - need more workers, add more
machines, and tell nginx to talk to more machines.

The only tricky aspect of scale out is database. Most databases do not
have a simple 'scale out' option. With postgres, you can setup
master-slave trees, but this only expands your read capacity, all
writes have to go through one server (and then all the slaves, making
it more expensive the more slaves you add).

The only true way of scaling out with database servers is to shard
your data, splitting it up by some arbitrary algorithm (usually on
user), but sharding isn't easy, you will have to design your database
and app around it. There are some very good videos, docs and talks
from the likes of Facebook and the like, sharding is not a panacea and
requires a lot of work.

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.



Scaling django (nginx + apache + mod_wsgi + postgresql)

2012-10-29 Thread Isaac XXX

Hi folks,

I'm developing a new application that should get high traffic. Right 
now, I've other projects with the follow architecture:


Nginx on front: serving static content and redirecting to apache for 
dynamic data

Apache+mod_wsgi: serving dynamic pages
PostgreSQL: backend for data storage (RDBM)
Memcache: for caching purposes :)

All my deployments use a single server, with single frontend/backend (1 
nginx, 1 apache, 1 postgresql). The requirements for this new project 
are really large, and I think I will need to scale all system. Can 
anyone suggest me an all-in-one tutorial, discussing the main points on 
scale a system?


I know there are different alternatives for DB (master-slave, 
clustering...), nginx can serve as a reverse proxy or not... and I need 
to merge all this information in a single scalable system, but I can't 
find an unified source of information.


Can anyone help me on it?

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



Video conference on django app

2012-01-16 Thread Isaac XXX

Hi folks,

I know that it's not mainly django topic, but I know here's is a well 
documented community through several areas.


I need to set a video conference (1 on 1) feature for a project in 
django. Can you provide me some hints about open-source (or 
free-royalty) apps, or frameworks, to get a simple videochat running in 
my nginx-apache-django environment?


I don't care if I need to install aditional server (like red5), but will 
be helpful if you provide some tutorial about how to deploy it along app.


Thanks a lot!

Isaac

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



Alternatives to celery

2012-01-15 Thread Isaac XXX

Hi folks,

I need a solution to create cron-like jobs into my django projects. I've 
a server with several projects.


I've testes celery, and it seems to work well with only 1 project, but 
when I need to set up several projects with celery support, I can't 
figure how to do it (because daemonization of celeryd process, described 
here 
http://celery.readthedocs.org/en/latest/cookbook/daemonizing.html#daemonizing 
only describes how to start workers for a single process because this 
directive CELERYD_CHDIR="/opt/Myproject/").


Well, my question is the following:

Is there any good tutorial about deploying django with celery on several 
projects, sharing celery support? if not, is there any alternative 
viable to celery for django?


I've found APScheduler, that seems to be a good scheduler for python, 
but integration with django seems a bit tricky. Is it a good alternative?


I will be pleased to read all your feedback about it.

Thanks in advance,

Isaac

--
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: Showing per-user information in admin

2011-08-13 Thread Isaac XxX
Thanks a lot derek! It's just all I was looking for :)

On Fri, Aug 12, 2011 at 4:03 PM, Derek  wrote:

> On Aug 12, 1:29 pm, Isaac  wrote:
> > Hi dudes,
> >
> > I'm having trouble at finding a solution for my problem. All I want to
> > do is tune django admin to show, for a given user an a given model, only
> > instance related to that user.
> >
> > my pseudocode
> >
> > class User
> >  ...
> > class A
> >  foreign_key User
> >
> > A1 related to User1
> > A2 related to User1
> > A3 related to User2
> >
> > then, I want that User1 was only be able to see A1 and A2, and User2 was
> > only be able to see A3.
> > I know that I can create filters to allow user to filter instances, but
> > all I want is not to allow user to make that decision, it will be only
> > able to see what its related.
> >
> > Any clue about how to use admin in this way?
> >
> > Thanks in advance
>
> See:
>
> http://lincolnloop.com/static/slides/2010-djangocon/customizing-the-admin.html#slide45
> for an example of this. Note how the default queryset is now filtered
> per user.
>
> --
> 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.



Problem with layout

2011-05-31 Thread Isaac XxX
Hi friends,

recently I upgraded my django installed version to 1.3.

To test it, i got a free html/css template from a page, and started a little
web. The surprise came when I open development webserver, with all static
files configured properly, and the resulting website (without any
modification, only serving the same web template from django instead of
filesystem) is wider, and some parts are malformed.

I used the same html template (without modifications), and the same images
and CSS (CSS only modified to get properly routes).

Then, i set the same index.html and served from django server as static file
(without using django routes, only servinc static html file). This file is
malformed too, at the same way as serving as django page. The last test was
to open that html file, from the same browsers, but this time from
filesystem, instead of from django. File display correctly all layout.

Any idea about what is happening?

Thanks in advance

-- 
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: E-Commerce - Payment

2011-04-06 Thread Isaac XxX
Thank you a lot for your explanation. These concepts are really new for me,
and now seems to be some light on this issue.

On Wed, Apr 6, 2011 at 9:04 AM, Kenneth Gonsalves <law...@thenilgiris.com>wrote:

> On Wed, 2011-04-06 at 08:56 +0200, Isaac XxX wrote:
> > And then, some advice at how to manage "credit card gateways"? or some
> > information source about it?
>
> basically a credit card gateway is a company (usually a very big
> company) which will process your credit cards for you. All you need to
> do is to pass them the information like bill amount. The customer will
> interact with them and pay to them. They will then intimate you as to
> the success or failure of the payment and return the customer to your
> site. You then proceed. Usually integration with the gateway is done
> through an integration kit which the company gives you. Basically a few
> scripts written in php or jsp or whatever. They will also give you some
> sort of password and an url to send the info to. If you check the
> archives of this list, you will find any number of recommendations of
> gateways to use. The important thing is that the contract with the
> gateway will be between them and your client, and neither you nor your
> client will ever be held liable for mistakes. (of course if you are
> dealing in leaked cables, the gateway may suddenly ditch you).
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: E-Commerce - Payment

2011-04-06 Thread Isaac XxX
Thanks for advice and responses, I will take a look at payment gateway
solutions, looking for one well fit to me

On Wed, Apr 6, 2011 at 8:56 AM, Mike Ramirez <gufym...@gmail.com> wrote:

> On Tuesday, April 05, 2011 11:25:12 pm Isaac XxX wrote:
> > Hi folks,
> >
>
> > Paypal seems to be clear at how to manage, but
>
> Use a gateway service, much easier and less costly.
>
> >I don't know really how to  manage credit card data:? can be stored?
>
> Yes but the infrastructure is important on how all this is handled, I
> worked
> for a comapny that channeled its cc payments to an internal oracle server
> which there passed the data to the cc service.  The cc data was routed
> through
> webserver to the internal network, to the app, to the oracle server. all
> over
> an encrypted channel.  From there it was processed and payment
> made/recieved.
> This is the only place oracle existed on the network, the site was driven
> by
> mysql clusters.  The reason for choosing oracle was transaction support,
> they
> were using mysql 4.x. This was in 2004/05. This is also a large company
> with
> lots of resources.
>
> Note, the oracle server was well defended and locked down.
>
> You would want to store everything encrypted and have only trusted folks in
> charge of it. Data security companies have had breeches in security, most
> these being caused by the employees of the data center. This is just the
> tip
> of the iceburg so to speak. It's just easier to use a gateway service.
>
> this recent thread has good information on them with django:
> http://groups.google.com/group/django-
>
> users/browse_frm/thread/45794a54c2e3f466/16288a41d7e628ce?hl=en=gst=Payment+Gateway
>
>
> Mike
>
>
> --
> "A great many people think they are thinking when they are merely
> rearranging
> their prejudices."
> -- William James
>
> --
> 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: E-Commerce - Payment

2011-04-06 Thread Isaac XxX
And then, some advice at how to manage "credit card gateways"? or some
information source about it?

Sorry if this is a beginner question, but is my first e-commerce
application, and had never deal with payments and credit card information.

On Wed, Apr 6, 2011 at 8:37 AM, Kenneth Gonsalves <law...@thenilgiris.com>wrote:

> On Wed, 2011-04-06 at 08:25 +0200, Isaac XxX wrote:
> > Paypal seems to be clear at how to manage, but I don't know really how
> > to
> > manage credit card data: can be stored? shall I transfer directly that
> > ssl
> > channeled data to my bank? shall I manage it handly?
>
> are you *sure* you want to handle credit cards by your self? I think
> such things stopped somewhere in the last century - the safest way is to
> use some credit card gateway.
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.org/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



E-Commerce - Payment

2011-04-06 Thread Isaac XxX
Hi folks,

after some time spent in investigating django solutions for shopping carts,
i got satchmo as my one. I've developed a custom shopping cart, and this app
is ready to be published. The problem arised when I started to look for some
information about how to manage payments: all information is abstract and
nothing concise. By now, I only want to manage credit card payments
directly, bank transfers and maybe a paypal alternative.

Paypal seems to be clear at how to manage, but I don't know really how to
manage credit card data: can be stored? shall I transfer directly that ssl
channeled data to my bank? shall I manage it handly?
A good documentation source is really wellcome.

I know it is a transversal issue to django, but by now I don't know where to
ask it.

Thanks in advance

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



Selecting a shopping cart

2011-03-21 Thread Isaac XxX
Hi there,

Recently I decided to develop a project that will involve some shopping cart
capabilities (we will sell some products, mainly by using credit card
payment methods).

I've been checking some packages - frameworks, and I can decide wich is
better fit for me. By now, I visited the following:

- LFS: Not a bad choices, but I found it a bit hard to be customized.
- Satchless: Maybe an early stage
- Satchmore: Seems a good choice, but still beign a framework. Maybe an app
is better fitted for me.
- DjangoShop: Seems that people are developing it to be a django built-in,
and it can be an interesting point to use it. However, there is not good
documentation / examples about its use and capabilities

By the way, I wish that selected package offer me a really deep level of
customization, but giving an inicial ready-to-use base to be started from.
Something like LFS do (only install framework and initialize db, and then
you have a shop ready), but being able to customize it in the way I want
(use or not portlets, use custom templates for whole / part of web, activate
shopping cart only in parts of the given web site...)

Thanks in advance,

Greetings

-- 
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 work with views like classes

2011-03-17 Thread Isaac XxX
Thanks for your responses.

The problem here is that there are some "dirty" solutions to this problem,
but i'm sure there is a good way to proceed with it.

This issue should be really simple to resolve if django make use of classes
instead of functions for views, and then, template would be benefited
receiving that class as parameter, using all provided data from that class
(and its superclasses).

Anyway, I think the django solution to accomplish it is to use middleware
nowadays, like i18n or authentication django plugins do.

On Thu, Mar 17, 2011 at 12:52 PM, Daniel Roseman wrote:

> On Thursday, March 17, 2011 11:35:55 AM UTC, chubz wrote:
>>
>> What I've found as a solution, though I don't know how much it is
>> recommended as a programming practice is to have your variable defined in a
>> "custom" request context and then use that request context instead of the
>> default one.
>>
>> You create you request context and based on the default context then just
>> set it up in settings to be used for the whole site.
>> You can star of on this link than expand to other sites:
>>
>> http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors
>>
>> I'm still in the process of gathering all the information, and would like
>> to see a response from a more experienced and versed py/django programmer on
>> this matter.
>>
>> What's the trade off. I know it comes down to : "We're all conseting
>> adults here" so don't do bad stuff or bad stuff will be done unto you. But
>> still, is there any other concerns with this solution?
>>
>> hope this helps.
>>
>
> Why should there be concerns? This is the proper way to define data that
> needs to be sent to every template.
>
> The alternative is to define custom templatetags in the base templates that
> get their own data from wherever they need to get it from.
> --
> DR.
>

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



How to work with views like classes

2011-03-16 Thread Isaac XxX
Hi folks,

Currently i'm getting trouble with a single feature in django. When i've
some inheritance in templates, like the following

TemplateA

TemplateB inherits A

TemplateC inherits B
TemplateD inherits B

If I need to define something depending on provided data in TemplateA or
TemplateB, then all views that render TemplateC and TemplateD should provide
the needed data. For example

Template A
...
{% my_var %}
...

How can define "my_var" as global variable for all views that would render
an inherited template of A (or B, or whatelse needed) without recurring to
middlewares?

I've have programmed many time in RoR, and is really simple to define global
vars, or complex inheritance patterns to share common data.

BTW, I though about decorators, implement some "pre-post" processment, but
it's not as clean as i want, because I should get the specific context
(normally RequestContext, but it can be another one in other projects)
rendered by view.

Thanks in advance

-- 
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: i18n issue with compilemessages

2011-01-15 Thread Isaac XxX
The problem seems to come from your python path, that is not well defined.

Try to define path in an absolute (not realtive) fashion.

import os

os.environ['PYTHONPATH'] = '/path/to/myproject'
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'

and then, apache should be able to execute compile messages

Greetings,

Isaac

On Fri, Jan 14, 2011 at 7:48 AM, Akash  wrote:

> Following are the environment I am working on:
> 1. Django 1.2.3
> 2. Python 2.4
> 3. wsgi
> 4. Centos 5.4
>
> From apache, I can run makemessage command, and it works. It creates
> the *.po files.
> I use the following statement for this.
> os.system("django-admin.py makemessages -l hi")
>
> But I am unable to do compilemessages from apache. Following are the
> steps which I tried out:
>
> os.system("django-admin.py compilemessages") AND
> subprocess.Popen(["django-admin.py", "compilemessages"])
>
> The command works fine from command line though, when run from project
> location.
> $django-admin.py compilemessages.
>
> but when I do python manage.py shell and then try to run it using
> os.system, I get the following error:
> 
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> commands/compilemessages.py", line 52, in handle
>compile_messages(locale)
>  File "/usr/lib/python2.4/site-packages/django/core/management/
> commands/compilemessages.py", line 10, in compile_messages
>basedirs.extend(settings.LOCALE_PATHS)
>  File "/usr/lib/python2.4/site-packages/django/utils/functional.py",
> line 276, in __getattr__
>self._setup()
>  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
> line 40, in _setup
>self._wrapped = Settings(settings_module)
>  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py",
> line 74, in __init__
>raise ImportError("Could not import settings '%s' (Is it on
> sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE,
> e))
> ImportError: Could not import settings
> 'igp_distribution_manager.settings' (Is it on sys.path? Does it have
> syntax errors?): No module named igp_distribution_manager.settings
> 256
>
> So I am not sure If I should be using os.system for this,  or if there
> is another way to run it from apache.
>
> I am sure I am doing something wrong out here.
> If someone have faced this before and have got some solution, then
> please guide me to get through it.
>
> Regards,
> Akash
>
> --
> 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.



Problem with translations

2011-01-03 Thread Isaac XxX
Recently, i've found a problem with i18n translations in Django.

All my translations are located inside views functions, templates and some
of them are in a file called forms.py (where i store some of my forms).

The problem arise when I render that forms. First render time, seems that
locale is applied, but next times the same locale is displayed again,
without beign able to change it through locale selector. The rest of
translations are behaving correctly. Any clue about what's happening with
translations outside of views and templates files?

Thank you in advance

Isaac

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 admin and changes

2010-12-12 Thread Isaac XxX
Hi mates,

i'm having trouble using django admin. Currently, i've finished a project,
and it is the only issue i've open.

When i add or update something through django admin interface, the rest of
the web does not notice it. I need to restart server, and then all behaves
in the normal way (new records are displayed).

I'm not using any cache, so cache is not the problem. I will deploy my
project in a production environment soon, and this is an issue that must be
arranged before this last step.

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: ANN: django-currencies 0.2.2

2010-12-03 Thread Isaac XxX
Nice app!

I will keep an eye to it, maybe it can be useful for one of my projects

On Fri, Dec 3, 2010 at 11:17 AM, Panos Laganakos
wrote:

> Description:
>
> django-currencies allows you to define different currencies, and
> includes template tags/filters to allow easy conversion between them.
>
> Download: http://pypi.python.org/pypi/django-currencies/0.2.2
> Documentation: http://packages.python.org/django-currencies/
> Source Code: https://launchpad.net/django-currencies
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.