Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Andre Lopes
Hi all,

I'm stuck with Django hosting. I've A2hosting but the Django hosting
is not good at all.

They use FCGI and Passenger and both have a problem.

If I'm more than 15min without doing a request to the site, the first
request is very slow and most of the time will do an Internal Server
Error.

There is any Django hosting on the cheap that works without this kind
of problems? The website have 5/10 visits a day.

I wait for reply.

Best Regards,

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


Re: Reliable and cheap hosting for simple webapp in Django

2013-09-10 Thread Andre Lopes
I'm visiting the Heroku webpage. I can get freehosting there. Any
experience on what can I get from Heroku freehosting. The website have
5/10 visits a day.

On Tue, Sep 10, 2013 at 10:57 PM, Avraham Serour <tovm...@gmail.com> wrote:
> try webfaction or digitalocean
>
>
> On Wed, Sep 11, 2013 at 12:55 AM, Andre Lopes <lopes80an...@gmail.com>
> wrote:
>>
>> Hi all,
>>
>> I'm stuck with Django hosting. I've A2hosting but the Django hosting
>> is not good at all.
>>
>> They use FCGI and Passenger and both have a problem.
>>
>> If I'm more than 15min without doing a request to the site, the first
>> request is very slow and most of the time will do an Internal Server
>> Error.
>>
>> There is any Django hosting on the cheap that works without this kind
>> of problems? The website have 5/10 visits a day.
>>
>> I wait for reply.
>>
>> Best Regards,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.

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


Django-Registration compatible with 1.5.2?

2013-09-08 Thread Andre Lopes
Hi,

I need to user a registration app for Django 1.5.2. I'm a little bit
confused on what app to use.

Currently 
django-registration(https://bitbucket.org/ubernostrum/django-registration)
is compatible with Django 1.5.2?

If not, what app should I use?


Best Regards,

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


How to retrieve an object from a custom template tag?

2013-03-16 Thread Andre Lopes
Hi all,

I'm trying to retrieve an object from a custom template tag. This is possible?

I explain here with details what I'm expecting to do?

http://stackoverflow.com/questions/15450003/django-how-to-retrieve-an-object-from-a-custom-template-tag

Any clues? What is the best way to avhieve this?


Best Regards,

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




Re: How can use the prepare method?

2013-03-13 Thread Andre Lopes
Sorry,

I've forgot to mention that this is related with Haystack.



On Wed, Mar 13, 2013 at 1:16 PM, Andre Lopes <lopes80an...@gmail.com> wrote:
> Hi,
>
> I'm trying to use the prepare method on the index to loop a related
> model. But I just can't get it to the "Text" field of the index.
>
> Here is the code: http://dpaste.org/c3b1z/
>
> I'm doing somethinf wrong?
>
> Best Regards,

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




How can use the prepare method?

2013-03-13 Thread Andre Lopes
Hi,

I'm trying to use the prepare method on the index to loop a related
model. But I just can't get it to the "Text" field of the index.

Here is the code: http://dpaste.org/c3b1z/

I'm doing somethinf wrong?

Best Regards,

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




Designing the email processing system. What path should I follow?

2013-02-15 Thread Andre Lopes
Hi all,

I'm building a Django website. Currently I'm searching for the best
way to design the email processing system.

The website is a Ads site. I need to send emails in a regular basis to
the users. I'm looking for 20 or 30 e-mails hour for now.

In other projects, I've been using a database table to handle the
e-mail processing. But when I started to develop in Django I have read
some articles about Celery/RabbitMQ. What I want to know is if adding
Celery/RabbitMQ to the e-mail processing system is a must or I adding
this I will only add another layer of complexity.

The solution that I've designed in another project uses a database
table and a cronjob running every 5 or 10 minutes to handle this. The
Database table is very simple. Looks like this:

[code]
CREATE TABLE "atem_emails_envios" (
"id_email_envio" int4 NOT NULL,
"id_email_msg" varchar(20) NOT NULL,
"dat_inserted" timestamp NOT NULL,
"dat_sended" timestamp,
"try_number" int4,
"max_tries" int4 NOT NULL,
"email_from" varchar(500) NOT NULL,
"email_to" varchar(500) NOT NULL,
"email_cc" varchar(500),
"email_bcc" varchar(500),
"email_subject" varchar(500) NOT NULL,
"email_msg" text NOT NULL,
"error_msg" text,
"i_started" timestamp,
"pid" int4,
"coment" varchar(2000),
"id_utiliz_ins" varchar(45),
"id_utiliz_upd" varchar(45),
"data_ult_actual" timestamp,
  PRIMARY KEY("id_email_envio"),
  CONSTRAINT "Ref_atem_emails_envios_to_atem_mensagens_email" FOREIGN
KEY ("id_email_msg")
REFERENCES "atem_mensagens_email"("id_email_msg")
MATCH SIMPLE
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE
);
[/code]

When an e-mail is being processed I just store the PID to the table to
avoid collisions.

My question goes in this direction. I've been using this table to
process e-mails in a website with low traffic, and works well. What
advantages I have using a Queue manager like Celery and a broker like
RabbitMQ? What benefits I will gain using a solution like
Celery/RabbitMQ?

Please give me some clues.

Best Regards,

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




Upload multiple files using Ajax

2013-01-22 Thread Andre Lopes
Hi,

I need to develop a form to upload multiple files.

I was thinking in using an Ajax uploader. I have google some options
but there are to many and I don't know which one to choose.

Any recommendations about this subject?


Best Regards,
André.

-- 
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 Formsets - How to build a formset correctly and validade it?

2013-01-11 Thread Andre Lopes
Hi all,

I'm struggling with Formsets. I've read the documentation and lots of
information on the web, but I'm experiencing some difficulties on get
them working.

I've wrote a StackOverflow question that explains my difficulties.

http://stackoverflow.com/questions/14280875/django-formsets-how-to-build-a-formset-correctly-and-validade-it

Can you give me some help on this one?

Best regards,
André

-- 
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 get self.id when saving a new object?

2013-01-09 Thread Andre Lopes
Hi,

I'm without a clue on how to get the sef.id when creating a new object
in Django. I've created a question in StackOverflow. Can someone give
me a clue on this subject?

Please read the question:
http://stackoverflow.com/questions/14234917/django-how-to-get-self-id-when-saving-a-new-object

Any clues?


Best Regards,

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



How to call a database function from Django?

2012-11-08 Thread Andre Lopes
Hi all,

I need to run a script once a day. The script basically will call a
postgresql function. I've google and I found a solution just like
this. The problem is that does not work.

[code]
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from myapp.models import *

MyModelClass.objects.raw("select materialize('some', 't_some_table');")
[/code]

I've created a file with the code above, but the RAW does not run the
function "materialize".

There is a better way to call a function using the Django environment?



Best Regards,

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



Re: Which IDE should I use for Django?

2011-12-19 Thread Andre Lopes
PyDev also works well. It is an Eclipse Plugin.



On Mon, Dec 19, 2011 at 11:19 AM, Ankit Rai  wrote:
> pycharm +1
>
>
> On Mon, Dec 19, 2011 at 4:41 PM, Thomas Weholt 
> wrote:
>>
>> Pycharm +1
>>
>>
>>
>> On Mon, Dec 19, 2011 at 11:35 AM, Zhukov Pavel  wrote:
>> > PyCharm?
>> >
>> > On Mon, Dec 19, 2011 at 2:34 PM, Alec Taylor 
>> > wrote:
>> >> I'm looking for a Django IDE which incorporates the following features:
>> >> - Syntax-highlighting
>> >> - Projects (all code file of the project shown separated by directory
>> >> in a sidebar)
>> >> - Tabs (with close buttons on tab)
>> >> - Code-completion (with good introspection)
>> >> - Text-zoom support
>> >> - Start/stop Django server
>> >> - Run+restart Django server shell (manage.py shell) in project (i.e.
>> >> below code)
>> >>
>> >> I program on Windows and Linux, so it would be great if the IDE is
>> >> supported on both platforms.
>> >>
>> >> Previously I was using Editra, but I requested an automatic import
>> >> into embedded interpreter feature in April, which they still haven't
>> >> integrated. So I am looking at alternatives :)
>> >>
>> >> Thanks for all suggestions,
>> >>
>> >> Alec Taylor
>> >>
>> >> --
>> >> 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.
>> >
>>
>>
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
>
> Ankit Rai
>
>
>
> --
> 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 deploy new code to the Production Server?

2011-12-02 Thread Andre Lopes
Thanks for the replies,

I'm using Nginx + Gunicorn + Supervisor + Virtualenv

My goal is to deploy the code to the Production in a One Click Step. I
think I will read on Fabric to achieve this.

More read also about Pip, I don't know how Pip Freeze works.

If you have some more clues, you are welcome.


Best Regards,



On Fri, Dec 2, 2011 at 10:08 AM, kenneth gonsalves
<law...@thenilgiris.com> wrote:
> On Fri, 2011-12-02 at 09:00 +0000, Andre Lopes wrote:
>> How can I have the two environments(Development and Production) in
>> Git? Should I use two new Branches(Development and Production). Please
>> give me a clue on this.
>
> have two branches (and do not put settings.py under version control)
>>
>> Other question... when I finish to upload/push the code to the
>> Production server I need to restart the Gunicorn(serves Django
>> website). How can I do this?
>
> use supervisord
>>
>> And the most important question... Should I use Git to do this or I
>> have better options?
>
> I personally prefer mercurial - bitbucket rocks.
> --
> 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.
>
>

-- 
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 deploy new code to the Production Server?

2011-12-02 Thread Andre Lopes
Hi,

I'm new to Django. I need to setup Git to deploy a Django website to
the production server. My question here is to know what is the best
way of doing this.

By now I only have a Master branch. My problem here is that
Development environment is not equal to the Production environment.
How can I have the two environments(Development and Production) in
Git? Should I use two new Branches(Development and Production). Please
give me a clue on this.

Other question... when I finish to upload/push the code to the
Production server I need to restart the Gunicorn(serves Django
website). How can I do this?

And the most important question... Should I use Git to do this or I
have better options?

Best Regards,

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



Website Statistics - What should I use to have Google Analytics in Django?

2011-11-30 Thread Andre Lopes
Hi,

I need to track visitors with Google Analytics. What should I use to
get Google Analytics working on Django?

What is my best choice?

Best Regards,

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



Re: Process management with Supervisord

2011-11-30 Thread Andre Lopes
Thank you for the reply.

Best Regards,


On Wed, Nov 30, 2011 at 2:51 PM, DrBloodmoney <drbloodmo...@gmail.com> wrote:
> On Wed, Nov 30, 2011 at 9:35 AM, Andre Lopes <lopes80an...@gmail.com> wrote:
>> Hi,
>>
>> I'm serving to production a Django website with Nginx + Gunicorn with
>> virtualenv.
>>
>> My dumb question is: I must to install supervisord in my virtualenv or
>> outside my virtualenv?
>
> You should just install supervisord to your system python install
> (easy_install). I run it as root manage it with upstart on Ubuntu so
> it'll restart/start properly (run nginx workers and gunicorn as
> non-root (servers) - this example is for uwsgi but it'll be very
> similar for gunicorn):
>
> # supervisord.conf
> # put this directive at the bottom of your /etc/supervisord.conf
>
> [program:uwsgi_example]
> command=/usr/local/sbin/uwsgi
>  --pythonpath "/home/servers/www/example.com/app/example"
>  --virtualenv "/home/servers/virtualenvs/example"
>  --socket 127.0.0.1:9000
>  --module example.django_wsgi
> user=servers
> autostart=true
> autorestart=true
> stdout_logfile=/home/servers/www/example.com/logs/uwsgi.log
> redirect_stderr=true
>
> 
>
> # Upstart init
> # copy or symlink to /etc/init/supervisord.conf
> # /etc/init/supervisord.conf
>
> # supervisord script for upstart
>
> description    "Supervisor"
>
> start on runlevel [2345]
> stop on runlevel [!2345]
>
> # --nodaemon: Run supervisord in the foreground
> exec /usr/local/bin/supervisord --nodaemon
>
> --
> 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.



Process management with Supervisord

2011-11-30 Thread Andre Lopes
Hi,

I'm serving to production a Django website with Nginx + Gunicorn with
virtualenv.

My dumb question is: I must to install supervisord in my virtualenv or
outside my virtualenv?


Best Regards,

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



Nginx - How to configure the virtual.conf to serve a Django application

2011-11-29 Thread Andre Lopes
I'm trying to serve a Django application to production. I have
installed Gunicorn and now I need to setup a Nginx Virtual Host. I'm
kind of lost on how to configure the "virtual.conf" from Nginx. I just
want to use Nginx as proxy, I don't want to configure deplyment
scripts for now.

I have this layout taken from here(http://senko.net/en/django-nginx-gunicorn/):

[code]
server {
listen   80;
server_name example.com;
# no security problem here, since / is alway passed to upstream
root /path/to/test/hello;
# serve directly - analogous for static/staticfiles
location /media/ {
# if asset versioning is used
if ($query_string) {
expires max;
}
}
location /admin/media/ {
# this changes depending on your python version
root /path/to/test/lib/python2.6/site-packages/django/contrib;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 10;
proxy_read_timeout 10;
proxy_pass http://localhost:8000/;
}
# what to serve if upstream is not available or crashes
error_page 500 502 503 504 /media/50x.html;
}
[/code]

To put things working I should replace:

[code]
root /path/to/test/hello;
[/code]

For the path where I have my Django Project?

I have Django and all other Python scripts installed in a virtualenv.

Can someone give me some gidelines to get Django working with Gunicorn
with Nginx as proxy?

Best Regards,

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



Re: What server configuration should I use for a Django site like this?

2011-11-29 Thread Andre Lopes
Hi Tiago,

Thanks for the reply. What alternatives I have? Can you send me a few
hosts that you consider cheap and good?

I have some bad experiences with shared hosting...

Best Regards,


On Tue, Nov 29, 2011 at 2:39 PM, Tiago Almeida
<tiago.b.alme...@gmail.com> wrote:
> Does it need to be a vps? there are much cheaper shared hosting
> alternatives for django.
> I don't recommend going forward with apache with so few ram, use nginx
> or lightppd.
> Best regards,
>
> On Nov 28, 4:30 pm, Andre Lopes <lopes80an...@gmail.com> wrote:
>> I need to put in production a Django website, but I don't know what
>> machine I should use... this is not a commercial project, probably the
>> monetary return will be very very little in ads...
>>
>> I have:
>> -Django
>> -PostgreSQL
>> -Solr
>>
>> Do you think that will be enough a linode with 512mb ram?
>>
>> - Visitors day expected at the end of the first year, 1000 day.
>> - Size of the database at the end of the first year, 20gb.
>>
>> How well will do a linode with 512mb? Any clues?
>>
>> Best Regards,
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



What server configuration should I use for a Django site like this?

2011-11-28 Thread Andre Lopes
I need to put in production a Django website, but I don't know what
machine I should use... this is not a commercial project, probably the
monetary return will be very very little in ads...

I have:
-Django
-PostgreSQL
-Solr

Do you think that will be enough a linode with 512mb ram?

- Visitors day expected at the end of the first year, 1000 day.
- Size of the database at the end of the first year, 20gb.

How well will do a linode with 512mb? Any clues?

Best Regards,

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



Haystack and date facets, anyone knows how it works?

2011-11-07 Thread Andre Lopes
Hi,

I'm trying to do a date facet with Haystack using Solr. The thing is
that I have no clue on how to use the results that I get from Haystack
and how to put this results in a Django template.

I have made a post in stackoverflow, but until now I have no clues on
how to achieve this. Can you guys give me a clue on this?

http://stackoverflow.com/questions/8041459/django-haystack-how-can-i-display-a-date-facet-in-a-template

Best Regards,

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



Re: django-registration-template

2011-11-04 Thread Andre Lopes
Great! I will test your templates. I'm new to Django and I have
searched a lot for this. The templates look awesome.

Best Regards,


On Fri, Nov 4, 2011 at 4:11 AM, Ezequiel Bertti  wrote:
> Hi,
> I just release a project on github with bootstrap from twitter v1.4 form
> django-registration.
> Is a simple use of bootstrap just using template for render with css. No
> python code need.
> Its is perfect sample for designers to know how to use bootstrap without
> asking to programmer to do some fix in their code.
> https://github.com/ebertti/django-registration-bootstrap
> It is my first of many github public projects.
> --
> Ezequiel Bertti
> E-Mail: eber...@gmail.com
> From Brazil
>
> --
> 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: Which is the best way of query a database view(no from Django model)

2011-11-03 Thread Andre Lopes
Hi Daniel, thanks for the reply.

I have tested to "inspectdb" but I think the schema is to complex, for
example... for the table "tdir_files_context" (djangoinspectdb.JPG
"image in attachment") I got this model:

[code]
class TdirFilesContext(models.Model):
id_category = models.ForeignKey(TdirCategories, db_column='id_category')
id_file_context = models.CharField(max_length=20)
n_file_context = models.CharField(max_length=150)
coment = models.CharField(max_length=2000)
id_user_db_ins = models.CharField(max_length=45)
id_user_db_upd = models.CharField(max_length=45)
id_user_sys_ins = models.CharField(max_length=45)
id_user_sys_upd = models.CharField(max_length=45)
date_ins = models.DateTimeField()
date_last_upd = models.DateTimeField()
class Meta:
db_table = u'tdir_files_context'
[/code]

This database table have Two primary keys and One foreign key. The
Django Model handle this kind of database tables?


Best Regards,




>> I'm a new to Django...
>>
>> I have a database schema that stores me information that I want to
>> show in a Django website. This database schema have nothing to do with
>> a Django App...
>>
>> Which is the best way of doing this in Django? I have read the
>> documentation and seems to me that I will need to use "custom SQL
>>
>> directly"(https://docs.djangoproject.com/en/1.3/topics/db/sql/#executing-custom-sql-directly),
>> right?
>>
>> If this is correct, where should I put the SQL queries, in "views.py"?
>>
>> Best Regards,
>
> Is there any reason why you can't create models from your existing schema?
> See https://docs.djangoproject.com/en/1.3/howto/legacy-databases/
> --
> 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/-/khJaBBbvxfIJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, 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.

<>

Which is the best way of query a database view(no from Django model)

2011-11-03 Thread Andre Lopes
Hi,

I'm a new to Django...

I have a database schema that stores me information that I want to
show in a Django website. This database schema have nothing to do with
a Django App...

Which is the best way of doing this in Django? I have read the
documentation and seems to me that I will need to use "custom SQL
directly"(https://docs.djangoproject.com/en/1.3/topics/db/sql/#executing-custom-sql-directly),
right?

If this is correct, where should I put the SQL queries, in "views.py"?


Best Regards,

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



Re: What I am missing is this Django "logout"?

2011-08-23 Thread Andre Lopes
Hi, thanks your your reply.

And what should be the right way of doing this?

Best Regards,



On Sun, Aug 21, 2011 at 5:00 AM, Subhranath Chunder
<subhran...@gmail.com> wrote:
> No, it's working is not a mistake by itself. Because now, the regular
> expression is extracting an absolute path, and not a relative url path.
> But, you are surely using things "the wrong way". :)
>
> On Sun, Aug 21, 2011 at 4:57 PM, Andre Lopes <lopes80an...@gmail.com> wrote:
>>
>> Hi,
>>
>> Thanks for the reply.
>>
>> I have discovered that If I use this:
>>
>> [code]
>> Welcome {{ request.user.username }}. Logout
>> [/code]
>>
>> Instead of:
>>
>> [code]
>> Welcome {{ request.user.username }}. Logout
>> [/code]
>>
>> I got the code working as expected. The thing is that I got an URL
>> like this: http://localhost:8080/logout//directorio//
>>
>> This should be working like this, or this is just a mistake that works?
>>
>>
>> PS: Sorry my english.
>>
>> On Sat, Aug 20, 2011 at 10:35 PM, Subhranath Chunder
>> <subhran...@gmail.com> wrote:
>> >> Welcome {{ request.user.username }}. Logout
>> > This part of your code is generating a logout URL like this in your
>> > template: "/logout/directorio"
>> > Now, your urls.py has the pattern:
>> > url(r'^logout/(?P.*)/$',
>> > 'django.contrib.auth.views.logout', name='auth_logout_next'),
>> >
>> > This makes, the variable 'next_page' assign the value after the slash
>> > 'login/' section. i.e. next_page = 'directorio'
>> > Now, the logout view is invoked and it's code gets executed. But since
>> > you
>> > provided a relative url value to this view, a http 302 is issued to the
>> > client to fetch the new url. Formed as a result of joining you current
>> > url
>> > and the relative path. i.e. '/login/directorio/directorio'. Which is
>> > basically again matching with the last url pattern. So, this whole thing
>> > keeps on going in a loop where:
>> > '/logout/directorio' is requested the first time. In response, the
>> > client is
>> > requested to fetch url,
>> > '/logout/directorio/directorio' the second time...
>> > '/logout/directorio/directorio/directorio/directorio' the third time...
>> > and so on and on in a loop.
>> > This is why you never see the expected output in the page. The actual
>> > logout
>> > is done in the first request only.
>> > So, when you refresh the page, you are basically pre-empting your
>> > browser
>> > client to break the initial loop, and manually requesting for the new
>> > fetch
>> > request.
>> > I hope I was able to clear the reason behind the outcome you were
>> > experiencing.
>> >
>> >
>> > On Sat, Aug 20, 2011 at 2:39 PM, Andre Lopes <lopes80an...@gmail.com>
>> > wrote:
>> >>
>> >> I am new to Django, and I am trying to put the logout to work...
>> >>
>> >> I have installed the an App called, Django-Registration.
>> >>
>> >> My problem is that I can do the logout, but the page does not get
>> >> refreshed, I must to press F5 after the logout to see the page for not
>> >> logged users.
>> >>
>> >> What I have done is the following:
>> >>
>> >> urls.py, added to urlpatterns:
>> >> [code]
>> >> url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page':
>> >> '/'}, name='auth_logout'),
>> >> url(r'^logout/(?P.*)/$',
>> >> 'django.contrib.auth.views.logout', name='auth_logout_next'),
>> >> [/code]
>> >>
>> >> In the template I have this code:
>> >> [code]
>> >> {% if request.user.is_authenticated %}
>> >>    Welcome {{ request.user.username }}. Logout
>> >> {% else %}
>> >>    Welcome. Please login or > >> href="/accounts/register/">register
>> >> {% endif %}
>> >> [/code]
>> >>
>> >> When I click Logout I dont see this in the screen:
>> >> [code]
>> >> Welcome. Please login or > >> href="/accounts/register/">register
>> >> [/code]
>> >>
>> >> I only see this text if I use F5 to refresh the page.
>> >>
>> >> What I am missing here?
>> >>
>> >> Please give me a clue.
>> >>
>> &

Re: What I am missing is this Django "logout"?

2011-08-21 Thread Andre Lopes
Hi,

Thanks for the reply.

I have discovered that If I use this:

[code]
Welcome {{ request.user.username }}. Logout
[/code]

Instead of:

[code]
Welcome {{ request.user.username }}. Logout
[/code]

I got the code working as expected. The thing is that I got an URL
like this: http://localhost:8080/logout//directorio//

This should be working like this, or this is just a mistake that works?


PS: Sorry my english.

On Sat, Aug 20, 2011 at 10:35 PM, Subhranath Chunder
<subhran...@gmail.com> wrote:
>> Welcome {{ request.user.username }}. Logout
> This part of your code is generating a logout URL like this in your
> template: "/logout/directorio"
> Now, your urls.py has the pattern:
> url(r'^logout/(?P.*)/$',
> 'django.contrib.auth.views.logout', name='auth_logout_next'),
>
> This makes, the variable 'next_page' assign the value after the slash
> 'login/' section. i.e. next_page = 'directorio'
> Now, the logout view is invoked and it's code gets executed. But since you
> provided a relative url value to this view, a http 302 is issued to the
> client to fetch the new url. Formed as a result of joining you current url
> and the relative path. i.e. '/login/directorio/directorio'. Which is
> basically again matching with the last url pattern. So, this whole thing
> keeps on going in a loop where:
> '/logout/directorio' is requested the first time. In response, the client is
> requested to fetch url,
> '/logout/directorio/directorio' the second time...
> '/logout/directorio/directorio/directorio/directorio' the third time...
> and so on and on in a loop.
> This is why you never see the expected output in the page. The actual logout
> is done in the first request only.
> So, when you refresh the page, you are basically pre-empting your browser
> client to break the initial loop, and manually requesting for the new fetch
> request.
> I hope I was able to clear the reason behind the outcome you were
> experiencing.
>
>
> On Sat, Aug 20, 2011 at 2:39 PM, Andre Lopes <lopes80an...@gmail.com> wrote:
>>
>> I am new to Django, and I am trying to put the logout to work...
>>
>> I have installed the an App called, Django-Registration.
>>
>> My problem is that I can do the logout, but the page does not get
>> refreshed, I must to press F5 after the logout to see the page for not
>> logged users.
>>
>> What I have done is the following:
>>
>> urls.py, added to urlpatterns:
>> [code]
>> url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page':
>> '/'}, name='auth_logout'),
>> url(r'^logout/(?P.*)/$',
>> 'django.contrib.auth.views.logout', name='auth_logout_next'),
>> [/code]
>>
>> In the template I have this code:
>> [code]
>> {% if request.user.is_authenticated %}
>>    Welcome {{ request.user.username }}. Logout
>> {% else %}
>>    Welcome. Please login or > href="/accounts/register/">register
>> {% endif %}
>> [/code]
>>
>> When I click Logout I dont see this in the screen:
>> [code]
>> Welcome. Please login or > href="/accounts/register/">register
>> [/code]
>>
>> I only see this text if I use F5 to refresh the page.
>>
>> What I am missing here?
>>
>> Please give me a clue.
>>
>> Best Regards,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Thanks,
> Subhranath Chunder.
> www.subhranath.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



What I am missing is this Django "logout"?

2011-08-20 Thread Andre Lopes
I am new to Django, and I am trying to put the logout to work...

I have installed the an App called, Django-Registration.

My problem is that I can do the logout, but the page does not get
refreshed, I must to press F5 after the logout to see the page for not
logged users.

What I have done is the following:

urls.py, added to urlpatterns:
[code]
url(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page':
'/'}, name='auth_logout'),
url(r'^logout/(?P.*)/$',
'django.contrib.auth.views.logout', name='auth_logout_next'),
[/code]

In the template I have this code:
[code]
{% if request.user.is_authenticated %}
Welcome {{ request.user.username }}. Logout
{% else %}
Welcome. Please login or register
{% endif %}
[/code]

When I click Logout I dont see this in the screen:
[code]
Welcome. Please login or register
[/code]

I only see this text if I use F5 to refresh the page.

What I am missing here?

Please give me a clue.

Best Regards,

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



Re: Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Thanks Kev,

It was exactly what I needed.

Regards,


On Thu, Aug 18, 2011 at 10:45 PM, Kev Dwyer <kevin.p.dw...@gmail.com> wrote:
> Andre Lopes wrote:
>
>> Hi,
>>
>> I am new to Django... I have made a logout link, but now I am in doubt
>> on which the best way to show/hide this template tag:
>>
>> [code]
>> Logout
>> [/code]
>>
>> Which is the best way of show/hide this link?
>>
>> Sorry if it is a basic question.
>>
>>
>> Best Regards,
>>
>
> I use
>
> {% if user.is_authenticated %}
>
> to condition my logout link's appearance.
>
> See https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-data-
> in-templates
>
> Cheers,
>
> Kev
>
> --
> 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.



Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Hi,

I am new to Django... I have made a logout link, but now I am in doubt
on which the best way to show/hide this template tag:

[code]
Logout
[/code]

Which is the best way of show/hide this link?

Sorry if it is a basic question.


Best Regards,

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



Re: How to Layout a Django Application?

2011-08-17 Thread Andre Lopes
Obrigado André(Thank you André),

I have read about the templates. Seems easy.

Continue with the learning...

Regards,


On Tue, Aug 16, 2011 at 2:04 PM, Andre Terra <andrete...@gmail.com> wrote:
> There are no particular layouts, but sometimes writing an inclusion tag[1]
> can help with abstracting some of the logic from the template (especially in
> the case of side columns that can vary based on context).
>
> What I usually do:
>
> Write a base.html file with some "default" data, including dummy content
> text wrapped around something like a context block, eg.
>
> 
> {% block content %}
>   No content yet.
> {% endblock %}
>
> 
> {% extends 'base.html' %}
>
> {% block content %}
>   My content
> {% endbock %}
>
>
> I also have blocks for javascript, styles and extrahead, which usually are
> called with {{ block.super }} in a specific template, so that I can append
> more scripts to a section of the site rather than having to rewrite the
> entire block.
>
> Let us know if you need more help!
>
>
> Cheers,
> AT
>
> [1]
> https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags-inclusion-tags
>
>
> On Tue, Aug 16, 2011 at 2:46 PM, Andre Lopes <lopes80an...@gmail.com> wrote:
>>
>> Hi, another question from a Django beginner.
>>
>> I have played with views and templates a little bit, but now I want to
>> make a real layout(Header, Side Column and Footer). There are any
>> guides on layouts that I should follow? There are Apps that will help
>> me with that task?
>>
>> Please le me know.
>>
>> Best Regards,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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-Registration, How can a beginner work with this 3rd party App?

2011-08-16 Thread Andre Lopes
Thanks for your reply. I will follow this tutorial.

Best Regards,

On Tue, Aug 16, 2011 at 4:36 PM, shacker  wrote:
> See also:
>
> django-profiles: The Missing Manual
> http://birdhouse.org/blog/2009/06/27/django-profiles/
>
> (django-profiles and django-registration are close cousins; I always
> use them in combination with one another).
>
> ./s
>
> --
> 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.



How to Layout a Django Application?

2011-08-16 Thread Andre Lopes
Hi, another question from a Django beginner.

I have played with views and templates a little bit, but now I want to
make a real layout(Header, Side Column and Footer). There are any
guides on layouts that I should follow? There are Apps that will help
me with that task?

Please le me know.

Best Regards,

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



Django-Registration, How can a beginner work with this 3rd party App?

2011-08-15 Thread Andre Lopes
Hi, another question from a beginner.

I am getting some trouble to get Django-Registration working. The
on-line 
documentation(http://readthedocs.org/docs/django-registration/en/latest/)
is not for a beginner like me, there are many steps that I don't know
how to do them. For example the creation of the templates (login.html,
registration_form.html, etc) I have must to search them on Goggle, and
I found out examples on how to do this templates
(http://www.lightbird.net/dbe/forum3.html).

My question is, there are any tutorial on Django-Registration that
will help a beginner like me to get this wonderful App working?

Best Regards,

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



Re: 3rd party Apps in Django

2011-08-15 Thread Andre Lopes
Thanks for your replies.Now I understand the differences.

Best Regards,


On Mon, Aug 15, 2011 at 2:17 PM, william ratcliff
<william.ratcl...@gmail.com> wrote:
> Generally, I tend to create a local cache of dependencies (ex. beautiful
> soup, django-registration, etc.) and then use pip to install them to the
> python site-packages directory.   The reason I use pip is because uninstall
> can be a pain.  It's only when there are 3rd party apps that I need to
> modify (which I try to avoid :p) that I include them in an "external_apps"
> folder under the project directory.   I suppose some of this is a matter of
> personal preference.  I use pip instead of easy_install because it keeps a
> record of which packages are installed and allows for uninstall.     You
> might also want to investigate virtual-env.   I think the main goal for me
> is to try to keep things as decoupled as possible and to keep packages
> locally in case their source somehow vanishes online, or if I depend on the
> particulars of a given version...
> Best,
> William
>
> On Mon, Aug 15, 2011 at 9:11 AM, Thomas Weholt <thomas.weh...@gmail.com>
> wrote:
>>
>> Hmmm...
>>
>> Using pip will take care of requirements the package might have and
>> install it in the right python lib folder so several projects can use
>> it among other things.
>>
>> Are there good reasons NOT to use pip/easy_install or at least python
>> setup.py install?
>>
>> Thomas
>>
>>
>>
>> On Mon, Aug 15, 2011 at 2:59 PM, Andre Lopes <lopes80an...@gmail.com>
>> wrote:
>> > Hi, I have put this question in StackOverflow, but no response untill
>> > now... This is an important question to me to understand how Django
>> > works
>> >
>> > I am new to Django.
>> >
>> > I have some doubts about installing 3rd party Apps in Django.
>> >
>> > A specific example. The "django-registration" App in
>> > https://bitbucket.org/ubernostrum/django-registration/src. Reading the
>> > instructions the doc tell us to install this app with PIP(pip install
>> > django-registration), doing this the App will be installed in Python
>> > Site-packages, right?
>> >
>> > My question is: The App must to be installed in that way? Why not put
>> > the 'django-registration' folder in our Project as an App?
>> >
>> > PS: This is a starter Django Question.
>> >
>> > Best Regards,
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>> >
>>
>>
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



3rd party Apps in Django

2011-08-15 Thread Andre Lopes
Hi, I have put this question in StackOverflow, but no response untill
now... This is an important question to me to understand how Django
works

I am new to Django.

I have some doubts about installing 3rd party Apps in Django.

A specific example. The "django-registration" App in
https://bitbucket.org/ubernostrum/django-registration/src. Reading the
instructions the doc tell us to install this app with PIP(pip install
django-registration), doing this the App will be installed in Python
Site-packages, right?

My question is: The App must to be installed in that way? Why not put
the 'django-registration' folder in our Project as an App?

PS: This is a starter Django Question.

Best Regards,

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



Re: Authentication App to use?

2011-08-15 Thread Andre Lopes
Thanks for the reply.

Django-Registration
(http://djangopackages.com/packages/p/django-registration/) have the
Social Auth (Google, Yahoo, OpenId, etc)?

Best Regards,



On Mon, Aug 15, 2011 at 10:11 AM, Reinout van Rees <rein...@vanrees.org> wrote:
> On 15-08-11 11:01, Andre Lopes wrote:
>>
>> My question. There are others Apps I can research to take a decision
>> on what App should I use?
>
> A handy list:
>
> http://djangopackages.com/grids/g/authentication/
>
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org             http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"
>
> --
> 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.



Authentication App to use?

2011-08-15 Thread Andre Lopes
Hi, I am new to Django, and I have been reading about authentication
and authorization in Django. Due to the complexity of this subject I
was thinking to use a 3rd party developed App for this.

I have found this App: https://github.com/pennersr/django-allauth

My question. There are others Apps I can research to take a decision
on what App should I use?

Best Regards,

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



Re: How to order "links" in the Admin?

2011-08-11 Thread Andre Lopes
Thanks for the reply. What I need is a snipped like this one:
http://djangosnippets.org/snippets/1053/

Thanks a lot for your help.

Best Regards,

On Wed, Aug 10, 2011 at 9:01 AM, Eric Hutchinson
<eric.hutchin...@burgopakusa.com> wrote:
> This is a meta option.
>
> 
> from django.db import models
> import datetime
> class Directory(models.Model):
>  website_name = models.CharField(max_length=200)
>  website_url = models.CharField(max_length=200)
>  website_position = models.IntegerField()
>  pub_date = models.DateTimeField('date published')
>
>    class Meta:
>        ordering=['website_position']
> 
>
> see: https://docs.djangoproject.com/en/1.3/ref/models/options/#ordering
>
> On Aug 10, 4:25 am, Andre Lopes <lopes80an...@gmail.com> wrote:
>> Hi,
>>
>> Thanks for the reply.
>>
>> I use the field "website_position" to control the position of the url,
>> this is an Integer field.
>>
>> The model I use is this:
>> 
>> from django.db import models
>> import datetime
>>
>> class Directory(models.Model):
>>   website_name = models.CharField(max_length=200)
>>   website_url = models.CharField(max_length=200)
>>   website_position = models.IntegerField()
>>   pub_date = models.DateTimeField('date published')
>> 
>>
>> Now I will populate the database with data:
>>
>> 
>> website_name | website_url                    | website_position | pub_date
>> Google           |http://www.google.com   | 1                      |
>> 10-08-2011
>> Yahoo            |http://www.yahoo.com    | 2                      |
>> 10-08-2011
>> Altavista         |http://www.altavista.com | 3
>> | 10-08-2011
>> 
>>
>> The output of this will be: Google, Yahoo, Altavista
>>
>> Another example: (Here I will reorder the links positions)
>>
>> 
>> website_name | website_url                    | website_position | pub_date
>> Google           |http://www.google.com   | 3                      |
>> 10-08-2011
>> Yahoo            |http://www.yahoo.com    | 2                      |
>> 10-08-2011
>> Altavista         |http://www.altavista.com | 1
>> | 10-08-2011
>> 
>>
>> Ant the output will be: Altavista, Yahoo, Google
>>
>> The thing here is that I control the positions of the links in Django
>> Admin with integers in the field "website_position". I'd like to know
>> if Django Admin have a better way to deal with this. There is possible
>> to control this with arrows to change the position of links, I click
>> in the up arrow and the link go up... I click in a down arrow and the
>> link goes down... This is possible in the Django Admin?
>>
>> Best Regards,
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Aug 9, 2011 at 6:43 PM, Jian Chang <changjia...@gmail.com> wrote:
>> > you should figure out what it is based on to order these urls.
>>
>> > i use time stamp to order them.
>>
>> > 2011/8/10 Andre Lopes <lopes80an...@gmail.com>
>>
>> >> Hi,
>>
>> >> I'm testing Django for my first project using it.
>>
>> >> I have a model like this:
>> >> 
>> >> from django.db import models
>> >> import datetime
>>
>> >> class Directory(models.Model):
>> >>   website_name = models.CharField(max_length=200)
>> >>   website_url = models.CharField(max_length=200)
>> >>   website_position = models.IntegerField()
>> >>   pub_date = models.DateTimeField('date published')
>> >> 
>>
>> >> Basicaly this model is for storing URL's, but I need to order them,
>> >> and for that I use "website_position" to control if the link will be
>> >> at the top or at the end or in the middles...
>>
>> >> My question is, there is a better way to control the positions of the
>> >> links? Django Admin have any feature that could help to deal with this
>> >> specific case?
>>
>> >> Please let me know.
>>
>> >> Best Regards,
>>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >>http://groups.google.com/group/dja

Re: How to order "links" in the Admin?

2011-08-10 Thread Andre Lopes
Hi,

Thanks for the reply.

I use the field "website_position" to control the position of the url,
this is an Integer field.

The model I use is this:

from django.db import models
import datetime

class Directory(models.Model):
  website_name = models.CharField(max_length=200)
  website_url = models.CharField(max_length=200)
  website_position = models.IntegerField()
  pub_date = models.DateTimeField('date published')


Now I will populate the database with data:


website_name | website_url| website_position | pub_date
Google   | http://www.google.com| 1  |
10-08-2011
Yahoo| http://www.yahoo.com | 2  |
10-08-2011
Altavista | http://www.altavista.com  | 3
| 10-08-2011


The output of this will be: Google, Yahoo, Altavista

Another example: (Here I will reorder the links positions)


website_name | website_url| website_position | pub_date
Google   | http://www.google.com| 3  |
10-08-2011
Yahoo| http://www.yahoo.com | 2  |
10-08-2011
Altavista | http://www.altavista.com  | 1
| 10-08-2011


Ant the output will be: Altavista, Yahoo, Google

The thing here is that I control the positions of the links in Django
Admin with integers in the field "website_position". I'd like to know
if Django Admin have a better way to deal with this. There is possible
to control this with arrows to change the position of links, I click
in the up arrow and the link go up... I click in a down arrow and the
link goes down... This is possible in the Django Admin?


Best Regards,



On Tue, Aug 9, 2011 at 6:43 PM, Jian Chang <changjia...@gmail.com> wrote:
> you should figure out what it is based on to order these urls.
>
> i use time stamp to order them.
>
>
> 2011/8/10 Andre Lopes <lopes80an...@gmail.com>
>>
>> Hi,
>>
>> I'm testing Django for my first project using it.
>>
>> I have a model like this:
>> 
>> from django.db import models
>> import datetime
>>
>> class Directory(models.Model):
>>   website_name = models.CharField(max_length=200)
>>   website_url = models.CharField(max_length=200)
>>   website_position = models.IntegerField()
>>   pub_date = models.DateTimeField('date published')
>> 
>>
>> Basicaly this model is for storing URL's, but I need to order them,
>> and for that I use "website_position" to control if the link will be
>> at the top or at the end or in the middles...
>>
>> My question is, there is a better way to control the positions of the
>> links? Django Admin have any feature that could help to deal with this
>> specific case?
>>
>> Please let me know.
>>
>> Best Regards,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 order "links" in the Admin?

2011-08-09 Thread Andre Lopes
Hi,

I'm testing Django for my first project using it.

I have a model like this:

from django.db import models
import datetime

class Directory(models.Model):
   website_name = models.CharField(max_length=200)
   website_url = models.CharField(max_length=200)
   website_position = models.IntegerField()
   pub_date = models.DateTimeField('date published')


Basicaly this model is for storing URL's, but I need to order them,
and for that I use "website_position" to control if the link will be
at the top or at the end or in the middles...

My question is, there is a better way to control the positions of the
links? Django Admin have any feature that could help to deal with this
specific case?

Please let me know.

Best Regards,

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



Re: Django for a front end designer

2011-08-03 Thread Andre Lopes
If you want to start with a PHP Framework, consider CodeIgniter. It is
the easier Framework for a starter.


On Tue, Aug 2, 2011 at 3:46 PM, paulo couto  wrote:
> Ok thanks for the clarifications :
> I guess i'll go to PHP for now and when i have more prog. experience i'll
> try python and django to be able to build my own stuff from scratch.
> Now i only need to find where to start in PHP :)
> Thanks all for your time.
>
> 2011/8/2 webcomm 
>>
>> On Aug 2, 4:57 pm, "biofob...@gmail.com"  wrote:
>> > Thank you all for the advices/sugestions.
>> > For what i read most of you advice on PHP + framework and i can
>> > understand that. I looked at django and rails as a option for me to
>> > have. My PHP knowledge is very limited, and sometimes i need some
>> > functionality on a wordpress site or on a textpattern one but my
>> > knowledge doest allow me to do much. Thats when i "feel" i need to
>> > learn some programing language in order to be able to do what i have
>> > in mind.
>>
>> Writing a WordPress plugin might be a good initial goal for you.  It's
>> been a while since I wrote one, but it's fairly easy if I remember
>> right.  Though nothing's perfectly easy when you're just getting
>> started.
>>
>> If you're going to start with a little PHP -- or regardless of the
>> language you start with -- I would go to a physical bookstore, look
>> through some books until you find something that makes sense to you,
>> buy it, and then work up to writing a WordPress plugin (if you go
>> PHP).
>>
>> Like I said, ultimately I think python may be a cut above PHP, but I
>> think it would be a steep climb for various reasons not related to the
>> language itself, and you wouldn't get much satisfaction for a while.
>> And it wouldn't help you do custom work in WordPress, of course.
>>
>> If you do want to try Python at some point, I'd urge you to install
>> Ubuntu (linux) on your computer and get comfortable with that first.
>> It's much easier to do Python work in linux.  Plus, it's a great
>> operating system.  I tried working with python on Windows XP for a
>> long time, and that slowed me down a lot.  For PHP, I don't think the
>> operating system matters quite as much.  If you want to do PHP in OSX,
>> get XAMPP: http://www.apachefriends.org/en/xampp-macosx.html
>>
>> -Ryan
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



It is possible to list data from a database view in Django?

2011-07-19 Thread Andre Lopes
Hi,

I'm new to Django. I'm in the process of test the features of Django
to move a site from PHP to Python/Django.

I have a database view that is the result of many joints between
tables, I only do SELECTs to this view, the data is inserted via a
Script that will populate the various tables. I only need to show the
data in this view, how Django handles the listings of data in views? I
have to define the view in the model?

Please give me a clue.

Best Regards,

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



Re: How to install psycopg2 using Pip?

2011-03-24 Thread Andre Lopes
I have solved.

I just edited "setup.cfg" on the psycopg2 and added:

pg_config=C:\Program Files\PostgreSQL\8.4\bin\pg_config.exe

Thanks for the help.

Best Regards,



On Mar 24, 3:49 pm, Shawn Milochik  wrote:
> This actually has nothing to do with Python -- I'm talking about your
> PATH, not your PYTHONPATH.
>
> Short version: Type 'which pg_config' at the command line. If it is
> found, then it's on your PATH. Otherwise, it's not, which appears to
> be the case.
>
> If you want to just do a temporary fix, you can follow these steps:
>
>     Run this:
>     find / -name pg_config 2>>/dev/null
>
>     #let's assume the result of the previous command is this:
> /usr/lib/postgresql/8.4/bin/pg_config
>
>     Add that path to your PATH temporarily
>
>     export PATH=$PATH:/usr/lib/postgresql/8.4/bin
>
> You should then be able to do the pip install.
>
> If that doesn't work because pg_config isn't found on your system at
> all then see Jacob's suggestions.
>
> Shawn

-- 
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 install psycopg2 using Pip?

2011-03-24 Thread Andre Lopes
Thanks for the reply.

How can I do that? I'm new to Python, I'm not aware of what is Python
path.

Best Regards,


On Mar 24, 3:10 pm, Shawn Milochik  wrote:
> Ensure that pg_config is on your PATH and it should work.

-- 
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 install psycopg2 using Pip?

2011-03-24 Thread Andre Lopes
Hi,

This question is not directly related with Django, but with Python.

I have installed "virtualenv" to have a virtual environment. Now I
need to instal "psycopg2" in my virtual environment, but I have not
successfully installed.

My steps:

[quote]
pip install
http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
[/quote]

And I got this message with an error:

[quote]
Downloading/unpacking
http://pypi.python.org/packages/source/p/psycopg2/psycopg2
-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
  Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded
  Running setup.py egg_info for package from
http://pypi.python.org/packages/sou
rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

python setup.py build_ext --pg-config 
/path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info

creating pip-egg-info\psycopg2.egg-info

writing pip-egg-info\psycopg2.egg-info\PKG-INFO

writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt

writing dependency_links to 
pip-egg-info\psycopg2.egg-info\dependency_links.txt

writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'

warning: manifest_maker: standard file '-c' not found

Error: pg_config executable not found.



Please add the directory containing pg_config to the PATH

or specify the full executable path with the option:



python setup.py build_ext --pg-config /path/to/pg_config build 
...



or with the pg_config option in 'setup.cfg'.


Command python setup.py egg_info failed with error code 1
Storing complete log in C:\Documents and Settings\anlopes\Application
Data\pip\p
ip.log
[/quote]

My question:

How can I tell to "pip" where is my pg_config?

Best Regards,

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



Should I use Python 2.6 with Django 1.3?

2011-03-24 Thread Andre Lopes
Hi,

I'm new to Django. In my system I have Python 2.6 and Python 2.7
installed, but due to some inconsistencies in Python Path I will
uninstall the Python versions and install again.

What I need to know is if Python 2.6 will work without problems with Django 1.3

Best Regards,

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



Re: How does localization work in Django?

2011-03-23 Thread Andre Lopes
Hi,

Thanks for the reply.

I have installed getttext on windows. What more details do you need to
get the cause of the error? I'm using Django 1.3

Best Regards,



On Mar 23, 4:46 pm, Andre Terra <andrete...@gmail.com> wrote:
> This has more to do with how you setup your python environment than with the
> localization/internationalization itself.
>
> I suggest using virtualenv and virtualenvwrapper to easily setup your django
> environment. Using virtualenv is pretty much the standard amongst developers
> nowadays.
>
> You can use manage.py rather than django-admin.py, but you need to have the
> correct PYTHONPATH setup and xgettext installed. This is harder to do in
> windows than in linux, like most things in the django/python world.
>
> Please 
> seehttp://docs.djangoproject.com/en/dev/topics/i18n/localization/#gettex...
> instructions on how to setup gettext on windows. I must stress my
> recommendation that you use virtualenv. Don't forget to add the relevant
> paths to gettext or other utilities in virtualenv should you decide to use
> it. There's documentation on that around the web too.
>
> Sincerely,
> Andre Terra
>
> On Wed, Mar 23, 2011 at 1:03 PM, Andre Lopes <lopes80an...@gmail.com> wrote:
> > Hi,
>
> > I have reading some topics of
> >http://docs.djangoproject.com/en/1.3/topics/i18n/localization/
>
> > But have not understand what I need to do.
>
> > First what I intend to do...
>
> > I have created a new App, called "directorio", and now I need to have
> > the capability of translate the data inside some database columns.
>
> > my models.py
>
> > [quote]
> >        from django.utils.translation import ugettext as _
>
> >        GENDERS = (('male', _('MALE')), ('female', _('FEMALE')))
>
> >        class Genders(models.Model):
> >                n_gender = models.CharField(max_length= 60, choices=
> > GENDERS)
> > [/quote]
>
> > After doing this I think I need to do the *.po an *.mo files inside my
> > App directory... I have tried to do:
>
> > [quote]
> >    django-admin.py makemessages -l pt
> > [/quote]
>
> > But is not working, I got this error:
>
> > [quote]
> >        Traceback (most recent call last):
> >          File "C:\Python27\Lib\site-packages\djan
> >        odule>
> >                from django.core import management
> >        ImportError: No module named django.core
>
> >        C:\xampp\htdocs\djangodir\directorio>djang
> >        Traceback (most recent call last):
> >          File "C:\Python27\Lib\site-packages\djan
> >        odule>
> >                from django.core import management
> >        ImportError: No module named django.core
> > [/quote]
>
> > What I need to do to create the dir "locale\pt\LC_MESSAGES" and the
> > *.po and *.mo files for my App?
>
> > Give me some clues, I'm kind of lost.
>
> > Best Regards,
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
>

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



How does localization work in Django?

2011-03-23 Thread Andre Lopes
Hi,

I have reading some topics of
http://docs.djangoproject.com/en/1.3/topics/i18n/localization/

But have not understand what I need to do.

First what I intend to do...

I have created a new App, called "directorio", and now I need to have
the capability of translate the data inside some database columns.

my models.py

[quote]
from django.utils.translation import ugettext as _

GENDERS = (('male', _('MALE')), ('female', _('FEMALE')))

class Genders(models.Model):
n_gender = models.CharField(max_length= 60, choices= GENDERS)
[/quote]

After doing this I think I need to do the *.po an *.mo files inside my
App directory... I have tried to do:

[quote]
django-admin.py makemessages -l pt
[/quote]

But is not working, I got this error:

[quote]
Traceback (most recent call last):
  File "C:\Python27\Lib\site-packages\djan
odule>
from django.core import management
ImportError: No module named django.core

C:\xampp\htdocs\djangodir\directorio>djang
Traceback (most recent call last):
  File "C:\Python27\Lib\site-packages\djan
odule>
from django.core import management
ImportError: No module named django.core
[/quote]

What I need to do to create the dir "locale\pt\LC_MESSAGES" and the
*.po and *.mo files for my App?

Give me some clues, I'm kind of lost.

Best Regards,

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



Re: ANN: Django 1.3 released

2011-03-23 Thread Andre Lopes
I'm kind of sad :)

I have installed 1.2 one day ago... :O

Just kidding.

Congratulations to all people involved.


Best Regards,



On Wed, Mar 23, 2011 at 10:02 AM, Sultan Imanhodjaev
 wrote:
> Wow!!! Congratulations people, thanks to developers!
>
> On Wed, Mar 23, 2011 at 3:59 PM, Marco  wrote:
>>
>> so happy
>>
>> On Wed, Mar 23, 2011 at 5:34 PM, bruno desthuilliers
>>  wrote:
>>>
>>> On 23 mar, 07:15, James Bennett  wrote:
>>> > It's here!
>>> >
>>> > Django 1.3 has been officially released.
>>>
>>> Yay great ! Congrats guys.
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> LinuX
>> Violin
>> Canon EOS
>>
>> --
>> 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.
>
>
>
> --
> Kind regards,
> Sultan Imanhodjaev
> +996 779 230 968
>
> --
> 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.



Where to put generic Database Tables?

2011-03-22 Thread Andre Lopes
Hi,

I'm trying to start with Django.

I'm developing an App. This App is called "Directory" and will store
info about websites.

I must to create a database table called "Genders", but this is a
generic database table and could be used in other App.

My question... how to deal with this kind of situation in Django? And
in wich model I shuld put this database table?


Best Regards,

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



Some clues on multi language webapp on Django

2011-03-22 Thread Andre Lopes
Hi,

I'm new to Django. I need some clues on how to design a multi language
webapp on Django. There are some some examples, tips and tricks about
the best way of doing it?

PS: Sorry for my english.

Best Regards,

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



About database composite keys.

2011-03-22 Thread Andre Lopes
Hi,

I'm new to Django and I have some doubts about the Database Design. I
design Databases two years from now but I'm not accustomed to design
databases without composite keys.

I have read that Django does not support composite keys. True?

How is the philosophy of database design in Django... All the tables
must to have one sequence(in PostgreSQL) for the PK and use unique
keys to do the same that a composite key does?

Do you recommend some Database Design readings about Django?

Best Regards,

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