translations fix

2014-02-05 Thread stayros kroustouris
I have found an error in Greek translations. What can i do in order to fix it?
Thank you!

-- 
Stavros

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


Re: SITE_ID

2014-02-05 Thread Adam Hurwitz
Thanks Tim, but how does one implement a Site_ID under installed apps in 
the settings.py file?

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'blog',

Is there anywhere else code needs to be implemented for the site_ID?
 
Thanks,

Adam

On Saturday, September 25, 2010 9:32:17 AM UTC-7, Tim Sawyer wrote:
>
> On 25/09/10 15:57, craphunter wrote:
> > Yes, I have read it, but I don't really get it. What is the meaning of
> > it?
>
> Consider a website that has multiple blogs, all of which are deployed to 
> the same database.
>
> Consider that you want each blog to be a separate URL: www.blog1.com, 
> www.blog2.com, but you only want one database for ease of backing up etc.
>
> So, you have one codebase, one database, but multiple sites.
>
> You can achieve this using SITE_ID.  www.blog1.com has a settings.py 
> with SITE_ID = 1.  www.blog2.com has a settings.py file with SITE_ID = 
> 2.  In your database, there are two rows in the django_site database 
> table, with serials 1 and 2.  The table that holds the blog entries has 
> a foreign key to Site, and so identifies which site the blog post 
> appears on.
>
> At least that's how I used it...hope that helps clarify it a bit!
>
> Tim.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/84d88a5f-b746-4ec5-8d53-68d8a2c1379a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to change language by clicking on link (using GET not POST) (set_language redirect)

2014-02-05 Thread David Seddon
It might be that you just want a link to the current page in another 
language.  If you need that, see my comment here: 
http://stackoverflow.com/questions/11437454/django-templates-get-current-url-in-another-language/21573776#21573776

On Tuesday, 15 April 2008 01:03:56 UTC+1, Simon Tite wrote:
>
> The documentation on how the user can change the language of a page/ 
> site (from: http://www.djangoproject.com/documentation/i18n/), in the 
> section  "The set_language redirect view", gives the following code: 
>
>  
>  
>  
>  
> {% for lang in LANGUAGES %} 
> {{ lang.1 }} 
> {% endfor %} 
>  
>  
>  
>  
>
> This of course means the user has to click on the language required, 
> then click the submit button. The result is put in POST data, and then 
> the redirect to " /i18n/setlang/" does its magic, then returns you 
> back to the page you came from, with the new LANGUAGE_CODE set up 
> correctly and, (here's the magic), the code is also automatically 
> stored in the user's session and cookie data, providing useful 
> persistence. 
>
> However, instead of clicking on submit, I would prefer the user to 
> click on just a regular link, so I nead to write something like.. 
>
>  
> http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0263684-5ccc-4f8e-9a77-6b31ce60d9f3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


django-admin-bootstrapped needs a new maintainer

2014-02-05 Thread Riccardo Forina
Hello, 

I'm the current maintainer (and author) of django-admin-bootstrapped, a 
package to replace the default admin theme with a Bootstrap 2/3 one 
(https://github.com/riccardo-forina/django-admin-bootstrapped/). 

It's a nice little project with active contributors and it's quite used on 
the wild, as far as I can understand from the emails and the various 
statistics.

Unfortunately, since the start of my new job I have had problems keeping 
the pace up to that of the fantastic contributors. As you can see on 
GitHub, there are some long standing issues that should be addressed, plus 
some other trivial ones and PRs that must be analysed. Also, a roadmap for 
how to evolve the project in the future should be defined.

I'm looking for somebody that can help in these tasks. Of course, chosen 
people will get moderator rights to this repository. I can also consider 
moving the project to its own home, effectively detaching it from my home.

I posted this plea also as a new issue: 
https://github.com/riccardo-forina/django-admin-bootstrapped/issues/99

Thanks for reading,
Riccardo

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed37d255-4fa6-4089-abc9-c8e89f1b6888%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to change language by clicking on link (using GET not POST) (set_language redirect)

2014-02-05 Thread Sergiy Khohlov
On Wed, Feb 5, 2014 at 11:54 AM, David Seddon  wrote:
>> a href="/i18n/setlang?lang=fr&name=next

 Take a look at your URL :  lang=fr is present  and you can use this
information for updating LANGUAGE_CODE  variable

Many thanks,

Serge


+380 636150445
skype: skhohlov

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


Re: Django 1.6 Python 3.3 How to recognize and handle three different form's POST data in the same page without reloading the entire page?

2014-02-05 Thread nkuttler


On Tuesday, February 4, 2014 3:36:12 PM UTC+1, 项楠 wrote:
>
> OK, my situation seems similar to SO but much simpler. As we know, in a SO 
> question detail page we can post a comment to this quesion, or to one of 
> its answers, we can also post an answer to this question. *All will be 
> done in the same page*, and if you just post comments, *it is not 
> required to reload the entire page to update the comments* -- this is 
> just what I don't know how to do.
>
> Currently, I only know how to handle one form's POST data in a page -- 
> handle answer form's POST data.
>
> I know solutions have something to do with jquery. But it is hard for me 
> to find a solution for my situation, and I am really tired after searching 
> for a long time. Maybe for you it is just a very simple thing. Thanks.
>

Well, you don't need jQuery at all, what you want to do is called Ajax, but 
jQuery makes it a little easier.

So you have a page with multiple forms on it. You simply give those forms 
different action urls that point to different views and intercept the form 
submission with JavaScript. When you intercept the submission you send an 
Ajax request to the form's view instead, and do something with the returned 
data.

https://en.wikipedia.org/wiki/Ajax_(programming)

You might want to look into one of the REST packages for Django.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9856a2a7-97be-41a5-af6e-01fa7943fe2e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


tutorial p.6 problem: style.css isn't loaded

2014-02-05 Thread Janek Warchoł
Hello,

i'm following Django's tutorial (very nice, btw) and static files don't
work for me.  I have a test project created along the previous parts of the
tutorial, and now i'm here:
https://docs.djangoproject.com/en/1.6/intro/tutorial06/#customize-your-app-s-look-and-feel

According to instructions, I've added a style.css file to
BASE_DIR/polls/static/polls/ subdir and inserted

{% load staticfiles %}



into my polls/templates/polls/index.html - however, it doesn't have any
effect (i.e. the links in the poll list aren't green), and when i look into
the shell where Django development server is running, i see

"GET /static/polls/style.css HTTP/1.1" 404 1649

so, it seems that the file cannot be accessed at all.  But i'm at a loss of
why it doesn't work :(

Any ideas?
If anyone wants to look at my code, it's here:
https://github.com/j-warchol/django-test

best,
Janek

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


Re: Model field's verbose_name from database?

2014-02-05 Thread Jon Dufresne
> Why not use dictionary to Map user-level names to database-fields

I'm not sure I fully follow what you're suggesting. But it sounds like
you're suggesting I move the configuration of field name out of the
database and into a Python file using a dictionary to map actual
fields to preferred field names. Is this correct?

I can't do this because:

* I do not know the user's preference ahead of time
* Their preference could change as time goes on
* It is unreasonable (in my case) to expect my users to modify python files
* These preferences could be different across different installations

For this reason, these fields are configured as a sort of "user
setting". The user is in complete control. But, once they are set,
they should be used everywhere.

Cheers,
Jon

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


Optimizing DB query involving annotate and aggregate

2014-02-05 Thread ST
Hi,

I'm trying to optimize the run-time of getting total credit and debt values 
out of our database. Ideally I'd like to formulate it as a Django query. 
This is the raw SQL query I have, which produces the right answer and is 
very fast (milliseconds):

SELECT sum(tg.total) FROM
  (
  SELECT sum(t.amount) AS total, t.member_id AS member_id
  FROM club_transaction AS t
  WHERE t.member_id IS NOT NULL
  GROUP BY t.member_id
  ) AS tg
WHERE tg.total < 0

(plus a second query for > 0)

My Django implementation was:

m = Member.objects.annotate(balance=Sum('transaction__amount'))
m_debt = m.filter(balance__lt=0).aggregate(total=Sum('balance'))
m_credit = m.filter(balance__gt=0).aggregate(total=Sum('balance'))

which looks a lot nicer, is easier to understand and maintain.

However, it results in the following SQL query (slightly redacted):

SELECT SUM(balance) FROM
  (
  SELECT "club_member"."id" AS "id", {all the other fields}, 
SUM("club_transaction"."amount") AS "balance"
  FROM "club_member"
  LEFT OUTER JOIN "auth_user" ON ("club_member"."user_id" = 
"auth_user"."id")
  LEFT OUTER JOIN "club_transaction" ON ("club_member"."id" = 
"club_transaction"."member_id")
  GROUP BY "club_member"."id", {all the other fields}, 
"auth_user"."last_name", "auth_user"."first_name"
  HAVING SUM("club_transaction"."amount") < 0
  ORDER BY "auth_user"."last_name" ASC, "auth_user"."first_name" ASC
  ) subquery

(again, plus another one for > 0)
which is very slow (almost 1.5 seconds).

How can I construct a Django query which doesn't request (and group by) all 
the unnecessary other fields ?
I already tried playing around with only() and values() but never got it to 
work.

Looking forward to your responses!

best regards,
ST

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/367c1f59-870c-40d1-9a53-4feb08890f29%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Model field's verbose_name from database?

2014-02-05 Thread Tom Evans
On Wed, Feb 5, 2014 at 5:47 PM, Jon Dufresne  wrote:
>> Why not use dictionary to Map user-level names to database-fields
>
> I'm not sure I fully follow what you're suggesting. But it sounds like
> you're suggesting I move the configuration of field name out of the
> database and into a Python file using a dictionary to map actual
> fields to preferred field names. Is this correct?
>
> I can't do this because:
>
> * I do not know the user's preference ahead of time
> * Their preference could change as time goes on
> * It is unreasonable (in my case) to expect my users to modify python files
> * These preferences could be different across different installations
>
> For this reason, these fields are configured as a sort of "user
> setting". The user is in complete control. But, once they are set,
> they should be used everywhere.

Do the names of the fields differ for different installation instance,
or do they differ for different users on the same installation?

If the former, I would do it with translations. Combined with
something like django-rosetta, you can easily knock up an interface to
allow super-users to set the translation for "First name" to whatever
they want by translating the "en" language (or indeed, any language).
If your site is multi-lingual already, this should be quite easy (and
frankly, if its not, its also very easy to configure). verbose_name
will happily accept a lazy translation as a value, converting it on
display to the "language" specified .

If the latter, then I don't think you can hammer this in to the
verbose_name mechanism without becoming very inventive - perhaps still
with translations, activating a different .mo file per-user?

Cheers

Tom

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


Re: Optimizing DB query involving annotate and aggregate

2014-02-05 Thread Anssi Kääriäinen
Something like this might work:

Transaction.objects.values_list('member_id').annotate(total=Sum('amount')).filter(total__gt=0).aggregate(Sum('total'))

That is, don't start from Member, Django isn't smart enough to get rid of 
the non-necessary joins. Instead go directly for the query you wrote in 
SQL. In the ORM .values() is the way to control GROUP BY clause. Getting 
the order of .values() and .annotate() right is important, and it is 
sometimes hard to figure out how to do it correctly. Also, if you have some 
extra ordering going on in the query just issue an empty .order_by() call - 
that will get rid of all ordering.

 - Anssi

On Wednesday, February 5, 2014 8:11:29 PM UTC+2, ST wrote:
>
> Hi,
>
> I'm trying to optimize the run-time of getting total credit and debt 
> values out of our database. Ideally I'd like to formulate it as a Django 
> query. This is the raw SQL query I have, which produces the right answer 
> and is very fast (milliseconds):
>
> SELECT sum(tg.total) FROM
>   (
>   SELECT sum(t.amount) AS total, t.member_id AS member_id
>   FROM club_transaction AS t
>   WHERE t.member_id IS NOT NULL
>   GROUP BY t.member_id
>   ) AS tg
> WHERE tg.total < 0
>
> (plus a second query for > 0)
>
> My Django implementation was:
>
> m = Member.objects.annotate(balance=Sum('transaction__amount'))
> m_debt = m.filter(balance__lt=0).aggregate(total=Sum('balance'))
> m_credit = m.filter(balance__gt=0).aggregate(total=Sum('balance'))
>
> which looks a lot nicer, is easier to understand and maintain.
>
> However, it results in the following SQL query (slightly redacted):
>
> SELECT SUM(balance) FROM
>   (
>   SELECT "club_member"."id" AS "id", {all the other fields}, 
> SUM("club_transaction"."amount") AS "balance"
>   FROM "club_member"
>   LEFT OUTER JOIN "auth_user" ON ("club_member"."user_id" = 
> "auth_user"."id")
>   LEFT OUTER JOIN "club_transaction" ON ("club_member"."id" = 
> "club_transaction"."member_id")
>   GROUP BY "club_member"."id", {all the other fields}, 
> "auth_user"."last_name", "auth_user"."first_name"
>   HAVING SUM("club_transaction"."amount") < 0
>   ORDER BY "auth_user"."last_name" ASC, "auth_user"."first_name" ASC
>   ) subquery
>
> (again, plus another one for > 0)
> which is very slow (almost 1.5 seconds).
>
> How can I construct a Django query which doesn't request (and group by) 
> all the unnecessary other fields ?
> I already tried playing around with only() and values() but never got it 
> to work.
>
> Looking forward to your responses!
>
> best regards,
> ST
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed49abcb-2089-4c4f-a46a-7ba67f3caa81%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-02-05 Thread Malik Rumi
mysql>  CREATE DATABASE django_1;

Query OK, 1 row affected (0.24 sec)

mysql> SHOW DATABASES;

++

| Database   |

++

| information_schema |

| django_1   |

| mysql  |

| performance_schema |

| test   |

++

5 rows in set (0.31 sec)

mysql> exit

Bye

python manage.py syncdb

Traceback (most recent call last):

(...)

File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in
defaulterrorhandlerraise errorclass, errorvalue

django.db.utils.OperationalError: (1046, 'No database selected')

python manage.py syncdb django_1

CommandError: Command doesn't accept any arguments

python manage.py syncdb --django_1

Usage: manage.py syncdb [options]

Create the database tables for all apps in INSTALLED_APPS whose tables
haven't already been created.

manage.py: error: no such option: --django_1

<>

Ok, so MySQL wanted a db name, even though there was no db name (at least
not one I gave it) on sqlite3

when I ran syncdb without a name, it said no db selected

When I tried pointing it to a name, I got 'doesn't accept arguments' and
then 'no such option.'

Is django now saying this new database has to be listed as an installed
app? What am I missing here?

 - and thanks for much for your help.


On Tue, Jan 28, 2014 at 8:45 PM, Ariel E. Isidro  wrote:

> "Or can I create the database, (presumably directly in the shell), and
> then empty it, as these instructions say, and that will take care of it? I
> frankly didn't understand why I would need to 'empty' a new and empty
> database, but that's what it says. "
>
> With sql lite, everything will be created for you.
> While with MySQL,  you should create the database directly in the shell,
> and this should give you an empty database.  The Django tables will be
> created after configuring your settings, and running  syncdb.
>
>
>
>
> On Wed, Jan 29, 2014 at 1:17 AM, Malik Rumi wrote:
>
>> This is somewhat like the question in "need help moving to production
>> server" but I think the right procedure is to start a new thread. So I
>> think I have done well for just starting out. With your help I've gotten
>> Django running on Windows, and I completed a tutorial and got my site
>> working locally with the admin. thank you.
>>
>> So I thought I was ready to move up to MySQL for some heavy lifting. I
>> followed the instructions I got here
>> http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html.
>> I did not know what to do with the NAME part, so I put in 'django-1', and
>> promptly got the error message 'unknown database 'django-1'. I thought that
>> made sense because I hadn't created this database in mysql already, but
>> I was just blindly following along. Having to CREATE DATABASE doesn't make
>> sense, I thought, because it defeats the purpose of Django abstraction in
>> the first place. Besides, when I syncdb, it should take whatever name I
>> gave it when I was using sqlite3, right?
>>
>> Wrong. When I ran syncdb, this time with NAME: ' ', I got :   File
>> "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default
>> terror handlerraise errorclass, errorvalue
>> django.db.utils.OperationalError: (1046, 'No database selected').
>>
>> So, what am I missing here? There almost certainly is an easy solution
>> I'm not seeing. Do I need to create a database in mysql? If so, must it
>> have the same name as it had in sqlite3? I know that name was made from
>> putting the model name together with something else, but I don't actually
>> remember what it was, and it seems like a lot of extra work to install an
>> sqlite browser just to get that name right. If that's what I need to do,
>> maybe I can just open that file with notepad?
>>
>> Or can I create the database, (presumably directly in the shell), and
>> then empty it, as these instructions say, and that will take care of it? I
>> frankly didn't understand why I would need to 'empty' a new and empty
>> database, but that's what it says.
>>
>> Any and all helpful advise welcome and appreciated.
>>
>>   --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f4a6d446-7cf8-498a-8ba5-04e339dd80b9%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> *Ariel E. Isidro*
> Backup your important files, click here  
>
> DISCLAIMER: This message is for the designated recipient only and may
> contain confidential and/or privileged information. If you have received it
> in 

Re: translations fix

2014-02-05 Thread Russell Keith-Magee
Hi Stayros,

Translations for Django are all managed through Transifex.

http://transifex.com

Once you've signed up for an account, you can apply to join a specific
translation team, which will allow you to contribute new and/or corrected
translations.

Yours,
Russ Magee %-)


On Wed, Feb 5, 2014 at 7:22 PM, stayros kroustouris wrote:

> I have found an error in Greek translations. What can i do in order to fix
> it?
> Thank you!
>
> --
> Stavros
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAeENc1xOJnTnwCg3MNKV%2BV4KfeEQLU7U50X06dxa0SJzAn7rA%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJxq84_%2BDgSPcw8G_8%2BwRj-HT0q-1beAyJXEUwCV9L0qM4-xYg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-02-05 Thread Drew Ferguson
Hi

Just like SQLlite, you tell Django where the MySQL database is in
settings.py

At the top you should have something like

DATABASES = {
 'default': {
  'ENGINE': 'django.db.backends.mysql', 
  'NAME': 'django_1', # Or path to database file if using sqlite3. 
#  'USER': '', 
#  'PASSWORD': '',
#  'HOST': '', # Empty for localhost
#  'PORT': '', # Set to empty string for default. 
 }
}


On Wed, 5 Feb 2014 16:38:59 -0600
Malik Rumi  wrote:

> mysql>  CREATE DATABASE django_1;
> 
> Query OK, 1 row affected (0.24 sec)
> 
> mysql> SHOW DATABASES;
> 
> ++
> 
> | Database   |
> 
> ++
> 
> | information_schema |
> 
> | django_1   |
> 
> | mysql  |
> 
> | performance_schema |
> 
> | test   |
> 
> ++
> 
> 5 rows in set (0.31 sec)
-- 
Drew Ferguson
AFC Commercial
http://www.afccommercial.co.uk

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140205235235.53a238b1%40blacktav.fergiesontour.org.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-02-05 Thread Ariel E. Isidro
1. before exiting mysql, you should grant permission to a user,i.e.
grant all privileges on django_1.* to username@'localhost' identified by
'userpassword'
replace username, userpassword with your own
2. exit mysql console
3. modify settings.py to add your username, password, host (localhost), and
port (3306)
4. run python manage.py syncdb


On Thu, Feb 6, 2014 at 7:52 AM, Drew Ferguson wrote:

> Hi
>
> Just like SQLlite, you tell Django where the MySQL database is in
> settings.py
>
> At the top you should have something like
>
> DATABASES = {
>  'default': {
>   'ENGINE': 'django.db.backends.mysql',
>   'NAME': 'django_1', # Or path to database file if using sqlite3.
> #  'USER': '',
> #  'PASSWORD': '',
> #  'HOST': '', # Empty for localhost
> #  'PORT': '', # Set to empty string for default.
>  }
> }
>
>
> On Wed, 5 Feb 2014 16:38:59 -0600
> Malik Rumi  wrote:
>
> > mysql>  CREATE DATABASE django_1;
> >
> > Query OK, 1 row affected (0.24 sec)
> >
> > mysql> SHOW DATABASES;
> >
> > ++
> >
> > | Database   |
> >
> > ++
> >
> > | information_schema |
> >
> > | django_1   |
> >
> > | mysql  |
> >
> > | performance_schema |
> >
> > | test   |
> >
> > ++
> >
> > 5 rows in set (0.31 sec)
> --
> Drew Ferguson
> AFC Commercial
> http://www.afccommercial.co.uk
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/20140205235235.53a238b1%40blacktav.fergiesontour.org
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Ariel E. Isidro*
Backup your important files, click here  

DISCLAIMER: This message is for the designated recipient only and may
contain confidential and/or privileged information. If you have received it
in error, please delete it and advise the sender immediately. You should
not copy or use it for any other purpose, nor disclose its contents to any
other person.

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


url error

2014-02-05 Thread Cristiano Araujo
hello guys

this is my url.py

urlpatterns = patterns('blog.views',
url(r'^$', ListView.as_view(
  
 queryset=Post.objects.all().order_by("-created")[:2],
   template_name="blog.html")),
url(r'^(?P\d+)$', DetailView.as_view(
   model=Post,
   template_name="post.html")),
url(r'^archives/$', ListView.as_view(
   queryset=Post.objects.all().order_by("-created"),
   template_name="archives.html")),
url(r'^tag/(?P\w+)$', 'tagpage'),
url(r'^feed/$', BlogFeed()),
   
)


but it calls the url this way


http://127.0.0.1:8000/blog/tagLondon

the right way would be this:

http://127.0.0.1:8000/blog/tag/London

someone can help me to fix this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/329747a1-d260-4369-8c53-c3d1b068494a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: url error

2014-02-05 Thread Cristiano Araujo

>
> the message error:
>

Using the URLconf defined in webapp.urls, Django tried these URL patterns, 
in this order:

   1. ^blog/ ^$
   2. ^blog/ ^(?P\d+)$
   3. ^blog/ ^archives/$
   4. ^blog/ ^tag/(?P\w+)$
   5. ^blog/ ^feed/$
   6. ^admin/

The current URL, blog/tagLondon, didn't match any of these. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f6b64738-fb29-4bd1-86c1-4c30dd1992a8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: tutorial p.6 problem: style.css isn't loaded

2014-02-05 Thread Daniel Sears
templates/admin isn't necessary. Instead you should extend both TEMPLATE_DIRS
and STATICFILES_DIRS to include the templates and static files for the
admin package:

TEMPLATE_DIRS = (
> os.path.join(BASE_DIR, 'templates'),
> '
> /opt/python-venv/lib/python2.7/site-packages/django/contrib/admin/templates/
> ',
> )
> STATICFILES_DIRS = (
> '
> /opt/python-venv/lib/python2.7/site-packages/django/contrib/admin/static/
> ',
> )



On Wed, Feb 5, 2014 at 9:45 AM, Janek Warchoł <
lemniskata.bernoull...@gmail.com> wrote:

> Hello,
>
> i'm following Django's tutorial (very nice, btw) and static files don't
> work for me.  I have a test project created along the previous parts of the
> tutorial, and now i'm here:
> https://docs.djangoproject.com/en/1.6/intro/tutorial06/#customize-your-app-s-look-and-feel
>
> According to instructions, I've added a style.css file to
> BASE_DIR/polls/static/polls/ subdir and inserted
>
> {% load staticfiles %}
>
> 
>
> into my polls/templates/polls/index.html - however, it doesn't have any
> effect (i.e. the links in the poll list aren't green), and when i look into
> the shell where Django development server is running, i see
>
> "GET /static/polls/style.css HTTP/1.1" 404 1649
>
> so, it seems that the file cannot be accessed at all.  But i'm at a loss
> of why it doesn't work :(
>
> Any ideas?
> If anyone wants to look at my code, it's here:
> https://github.com/j-warchol/django-test
>
> best,
> Janek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABmDZEObsanqcDVBC9-R%3DiVen4eocRFcFc16oXHwkQY5PUPr7A%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: Model field's verbose_name from database?

2014-02-05 Thread Me Sulphur
You could easily convert mappings to JSON and store it in a model like:

Class VerboseNameMaps(models.Model):
map  = models.TextField()
user = models.ForeignKey(User)


When you wish to use the same, you could:

map_obj = VerboseNameMaps.objects.get(user=request.user)
mapping = json.loads(map_obj.map)
# Now you can use getattr() along with mapping as in my earlier mail

You can create a forms or interfaces for user to Create, Read, Update and
Delete (CRUD) these maps, so user need not write python files.

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


Re: url error

2014-02-05 Thread Babatunde Akinyanmi
Ji Cristiano.  You show the code that is not behaving as you expect
On 6 Feb 2014 03:15, "Cristiano Araujo"  wrote:

> the message error:
>>
>
> Using the URLconf defined in webapp.urls, Django tried these URL
> patterns, in this order:
>
>1. ^blog/ ^$
>2. ^blog/ ^(?P\d+)$
>3. ^blog/ ^archives/$
>4. ^blog/ ^tag/(?P\w+)$
>5. ^blog/ ^feed/$
>6. ^admin/
>
> The current URL, blog/tagLondon, didn't match any of these.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f6b64738-fb29-4bd1-86c1-4c30dd1992a8%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

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


Re: translations fix

2014-02-05 Thread stayros kroustouris
Thank you very much Russ!
Have a nice day!

On Thu, Feb 6, 2014 at 1:32 AM, Russell Keith-Magee
 wrote:
> Hi Stayros,
>
> Translations for Django are all managed through Transifex.
>
> http://transifex.com
>
> Once you've signed up for an account, you can apply to join a specific
> translation team, which will allow you to contribute new and/or corrected
> translations.
>
> Yours,
> Russ Magee %-)
>
>
> On Wed, Feb 5, 2014 at 7:22 PM, stayros kroustouris 
> wrote:
>>
>> I have found an error in Greek translations. What can i do in order to fix
>> it?
>> Thank you!
>>
>> --
>> Stavros
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAAeENc1xOJnTnwCg3MNKV%2BV4KfeEQLU7U50X06dxa0SJzAn7rA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJxq84_%2BDgSPcw8G_8%2BwRj-HT0q-1beAyJXEUwCV9L0qM4-xYg%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



-- 
Stavros

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