回复: How to host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Pengfei Xue
http://peng-fei-xue.blogspot.com/2012/06/howto-create-django-application-in.html

check this post  

--  
Sincerely,
Pengfei Xue





已使用 Sparrow (http://www.sparrowmailapp.com/?sig)

已使用 Sparrow (http://www.sparrowmailapp.com/?sig)  

在 2012年8月12日星期日,下午7:54,surya 写道:

> I am really fed up with tutorials on web telling how to configure Django & 
> Python 2.7 on OpenShift (http://openshift.com) DIY.
>  
> So, can write a detailed step-by-step procedure on how to setup Django 1.4 
> with Python 2.7 on OpenShift using VirtualEnv??
>  
> Thanks a lot!!  
>  
> --  
> 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/-/gM7OFF1Bx_kJ.
> To post to this group, send email to django-users@googlegroups.com 
> (mailto:django-users@googlegroups.com).
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com 
> (mailto:django-users+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-allauth and signup or login via twitter?

2012-08-12 Thread Amyth
It seems like there is a problem with your twitter app configuration, most 
probably the website url and the callback url. Make sure you are specifying 
the Urls in /etc/hosts on your local server and the consumer key and secret 
are correct. If you still face any problems, follow my step by step 
tutorial here -> 
http://techstricks.com/django-allauth-tutorial-step-by-step/

On Wednesday, 1 August 2012 07:52:36 UTC+5:30, HL wrote:
>
> I am trying to work with django-allauth. I followed the instructions at 
> github  page and done 
> following:
>
> 1. Added allauth urls into urls.py
>
> urlpatterns += patterns ('',
>> url('^accounts/', include('allauth.urls')),
>> url('^accounts/profile/$', ProfileView.as_view(), name='ProfileView'),
>> url('^login/$', login, name='account_login'),
>> url('^logout/$', logout, name='account_logout'),
>> url('^login/cancelled/$', login_cancelled, 
>> name='socialaccount_login_cancelled'),
>> url('^login/error/$', login_error, name='socialaccount_login_error'),
>> )
>
>
> 2. Updated TEMPLATE_CONTEXT_DIRS, TEMPLATE_CONTEXT_PROCESSORS, 
> AUTHENTICATION_BACKENDS and INSTALLED_APPS. Also added 
> ACCOUNT_AUTHENTICATION_METHOD = "username_email"
>
> 3. Added Key and Secret for twitter in the Social apps table.
>
> 4. Copied django-allauth templates to my app's directory and modified it. 
> I can see all the templates working fine like */accounts/signup/* and *
> /accounts/social/connections/*.
>
> Now, from connections or signup when I click Twitter link *
> /accounts/twitter/login/* I ended up with the following error:
>
> *Social Network Login Failure*
>> An error occured while attempting to login via your social network 
>> account.
>
>
> Am I missing something? Did anybody ever try to login or sign up using 
> twitter? I tried to search for all solution on the web but was not able to 
> find any. If this thing doesn't work then I would like to try 
> django-social-auth .
>
> Thanks in advance.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/1oypz1gptuoJ.
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 let user change the language

2012-08-12 Thread Marcin Tustin
So, what part, exactly is a problem? What have you tried?

On Sun, Aug 12, 2012 at 6:52 PM, Gelonida N  wrote:

> On 08/12/2012 08:46 PM, Marcin Tustin wrote:
>
>> This is linked from the Django front page:
>> https://docs.djangoproject.**com/en/1.4/topics/i18n/
>>
>> Come back with specific questions when you get stuck.
>>
>
>
> Thanks for your answer.
>
> I created already all the l18n messages and I can switch the language site
> wise  by changing the language in settings.py
>
> However Now I'd like to change them via user preferences. (not cookies)
> (So if one user changes the language on one m,achine it should be changed
> on any other machine if he logs in.
>
> I'd prefer not to set the language as suggested by the browser, but let
> the user the choice even if his useragent suggests another prefered
> language.
>
>
> There seems to be a url based approach and a cookies based approach I
> wonder what would be best for my scenario.
> (I am in full control of the web server and can add redirects / rewrite
> rules, etc. if this helps)
>
>
> This might be explained somewhere in more details in the Django docss
> however I did not find the related page.
>
> The doc mentions:
> "It uses these hooks to localize Web apps for particular users according
> to their preferences."
>
> but I did not find the how
>
>
>
>> On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > > wrote:
>>
>>
>> I'd like to have a web site, where the can switch the language
>> The first time the user connects the language would be the prefered
>> language as sugegsted by the news agent,
>> then the user could select the prefered lanngauge in some user
>> preference settings.
>>
>>
>>
>> What would be the standard way to do this in Django?
>>
>> Thanks in advance for comments,  examples, snippets, links,
>>
>> --
>> 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+unsubscribe@__goo**glegroups.com
>> 
>> 
>> **>.
>>
>> For more options, visit this group at
>> 
>> http://groups.google.com/__**group/django-users?hl=en
>> 
>> 
>> >.
>>
>>
>>
>>
>>
>> --
>> Marcin Tustin
>> Tel: 07773 787 105
>>
>> --
>> 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+unsubscribe@**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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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 let user change the language

2012-08-12 Thread Gelonida N

On 08/12/2012 08:46 PM, Marcin Tustin wrote:

This is linked from the Django front page:
https://docs.djangoproject.com/en/1.4/topics/i18n/

Come back with specific questions when you get stuck.



Thanks for your answer.

I created already all the l18n messages and I can switch the language 
site wise  by changing the language in settings.py


However Now I'd like to change them via user preferences. (not cookies)
(So if one user changes the language on one m,achine it should be 
changed on any other machine if he logs in.


I'd prefer not to set the language as suggested by the browser, but let 
the user the choice even if his useragent suggests another prefered 
language.



There seems to be a url based approach and a cookies based approach I 
wonder what would be best for my scenario.
(I am in full control of the web server and can add redirects / rewrite 
rules, etc. if this helps)



This might be explained somewhere in more details in the Django docss 
however I did not find the related page.


The doc mentions:
"It uses these hooks to localize Web apps for particular users according 
to their preferences."


but I did not find the how




On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N > wrote:


I'd like to have a web site, where the can switch the language
The first time the user connects the language would be the prefered
language as sugegsted by the news agent,
then the user could select the prefered lanngauge in some user
preference settings.



What would be the standard way to do this in Django?

Thanks in advance for comments,  examples, snippets, links,

--
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+unsubscribe@__googlegroups.com
.
For more options, visit this group at
http://groups.google.com/__group/django-users?hl=en
.




--
Marcin Tustin
Tel: 07773 787 105

--
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: Created & updated date/time in models

2012-08-12 Thread Lachlan Musicman
On Sun, Aug 12, 2012 at 12:06 PM, Melvyn Sopacua  wrote:
> On 8-8-2012 23:02, Lachlan Musicman wrote:
>
>> From what I can see, the admin interface already keeps this data for
>> each object (exception: no create_date for data imported via fixtures
>> apparently).
>
> Three options:
> 1) Add the fields you want to each model
> 2) Bypass django and use triggers to populate a separate table, this can
> be installed as custom SQL [1].
> 3) Implement 2) in django using generic foreign keys [2]. This is
> similar to how the admin is doing it, except that you would have to
> connect a global post_save (and pre_delete?) signal and ignore the
> signal if it applies to the "statistics collecting model". The overhead
> will be noticeable.
>
>> In an effort to reduce duplicating data, how would I go about getting
>> at that data from within my model's view?
>
> For option 1) it should be obvious.
> For option 3) by resolving the content type
> Option 2) requires raw SQL [3].

Bingo, perfect answer - thanks
(number 1 it is)
cheers
L.

-- 
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Cal Leeming [Simplicity Media Ltd]
It's more of a 'YMMV' thing - hence the "hands dirty" comment.

On Sun, Aug 12, 2012 at 7:33 PM, Marcin Tustin wrote:

> I thought the point of a tutorial was that if you followed it blindly, and
> to the letter, it will work, and then you can pull it apart afterwards.
>
>
> On Sun, Aug 12, 2012 at 2:10 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> You can't blindly follow a deployment tutorial and expect to not have to
>> get your hands dirty - especially when it's not even an official tutorial ;)
>>
>> First off - you need to find the error logs for your application and/or
>> web server, and/or determine where the stack is breaking
>>
>> Cal
>>
>> On Sun, Aug 12, 2012 at 6:56 PM, surya  wrote:
>>
>>> Hi Cal,
>>>
>>> Actually, I have followed this 
>>> tutorialfor 
>>> deploying a basic Django app using Python 2.7 on Open Shift.
>>>
>>> So, when I pushed the repo, the website showed me..
>>>
>>> Service Temporarily Unavailable
>>>
>>> The server is temporarily unable to service your request due to
>>> maintenance downtime or capacity problems. Please try again later.
>>> --
>>> Apache/2.2.15 (Red Hat) Server at appName-userID.rhcloud.com Port 80
>>>
>>> On Sunday, August 12, 2012 10:43:46 PM UTC+5:30, Cal Leeming [Simplicity
>>> Media Ltd] wrote:
>>>
 Surya,

 Your original question does not really explain what problem you are
 having.

 From what I can tell, you have read tutorials on the web that explain
 how to set up Django on OpenShift, but you have not explained what is wrong
 with them, nor what specific problem you are having.

 You'll need to explain in more detail the exact problem you are having
 before anyone will be able to help you with this.

 Cal

 On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi wrote:

> Haven't got any answer! So, I thought someone from Django users would
> be using it and might help.
>
>
> On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza wrote:
>
>> Uhmm... Is not better ask the same to openshift support?
>>
>> Mario Lacunza
>> Enviado desde mi Motorola Atrix2
>> El ago 12, 2012 6:55 a.m., "surya"  escribió:
>>
>>  I am really fed up with tutorials on web telling how to configure
>>> Django & Python 2.7 on OpenShift  DIY.
>>>
>>> So, can write a detailed step-by-step procedure on *how to setup
>>> Django 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>>
>>> Thanks a lot!!
>>>
>>> --
>>> 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/-/gM7OFF1Bx_**kJ
>>> .
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> googlegroups.com.
>>
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> googlegroups.com.
>
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>

  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/kCd8atMMgDwJ.
>>>
>>> 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 

Re: Django app to update site through email

2012-08-12 Thread Marwan Al-Sabbagh
Ah good old fetchmail. How did I forget you. Thanks Melvyn, It looks really
really mature an full featured. As far as security and identifying the user
I was planning to use Django's Cryptographic
signingand to
put a signed value contained the user details and record they are
approving or reject by email. That way I don't have to rely on the SMTP
headers. There is also the added benefit of being able to use the
TimestampSigner class so that messages could expire after a certain period
if the user didn't respond to them.

On 12 August 2012 11:31, Melvyn Sopacua  wrote:

> On 10-8-2012 17:23, Paul Backhouse wrote:
>
> > Has this already been done? Does my google-fu escape me? If it hasn't
> > already been done, why not? And are there any modules out there that can
> > be dropped in to speed development? Any tips on developing this app?
>
> An email gateway is what exposed contrib.auth's problems to me, because
> it has the email stored on the user account info, you can only match one
> email per user. In a world where people use several accounts or server
> addresses with 'subdomains', having only one registered address per
> account isn't practical. Also, match a user based on SMTP headers is not
> very secure.
>
> Another approach that you can observe in the wild is to have 'secret
> email addresses'. In the user account information an email address at
> the site's domain is made available that the user can send comments or
> content to. The drawback here is that it's very sensitive to identity
> theft as the assumption is made that only that user knows that address.
>
> So very quickly, you come into the dark realm of requiring some kind of
> authentication key associated with the email message and while for us
> techies this is trivial, explaining that to casual internet users has
> been a problem since the inception of S-MIME and PGP.
>
> I imagine most projects that have attempted this principle strand on
> this issue and the associated spam nightmare.
>
> --
> Melvyn Sopacua
>
> --
> 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 let user change the language

2012-08-12 Thread Marcin Tustin
This is linked from the Django front page:
https://docs.djangoproject.com/en/1.4/topics/i18n/

Come back with specific questions when you get stuck.

On Sun, Aug 12, 2012 at 1:10 PM, Gelonida N  wrote:

>
> I'd like to have a web site, where the can switch the language
> The first time the user connects the language would be the prefered
> language as sugegsted by the news agent,
> then the user could select the prefered lanngauge in some user preference
> settings.
>
>
>
> What would be the standard way to do this in Django?
>
> Thanks in advance for comments,  examples, snippets, links,
>
> --
> 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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>


-- 
Marcin Tustin
Tel: 07773 787 105

-- 
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Marcin Tustin
I thought the point of a tutorial was that if you followed it blindly, and
to the letter, it will work, and then you can pull it apart afterwards.

On Sun, Aug 12, 2012 at 2:10 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> You can't blindly follow a deployment tutorial and expect to not have to
> get your hands dirty - especially when it's not even an official tutorial ;)
>
> First off - you need to find the error logs for your application and/or
> web server, and/or determine where the stack is breaking
>
> Cal
>
> On Sun, Aug 12, 2012 at 6:56 PM, surya  wrote:
>
>> Hi Cal,
>>
>> Actually, I have followed this 
>> tutorialfor deploying 
>> a basic Django app using Python 2.7 on Open Shift.
>>
>> So, when I pushed the repo, the website showed me..
>>
>> Service Temporarily Unavailable
>>
>> The server is temporarily unable to service your request due to
>> maintenance downtime or capacity problems. Please try again later.
>> --
>> Apache/2.2.15 (Red Hat) Server at appName-userID.rhcloud.com Port 80
>>
>> On Sunday, August 12, 2012 10:43:46 PM UTC+5:30, Cal Leeming [Simplicity
>> Media Ltd] wrote:
>>
>>> Surya,
>>>
>>> Your original question does not really explain what problem you are
>>> having.
>>>
>>> From what I can tell, you have read tutorials on the web that explain
>>> how to set up Django on OpenShift, but you have not explained what is wrong
>>> with them, nor what specific problem you are having.
>>>
>>> You'll need to explain in more detail the exact problem you are having
>>> before anyone will be able to help you with this.
>>>
>>> Cal
>>>
>>> On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi wrote:
>>>
 Haven't got any answer! So, I thought someone from Django users would
 be using it and might help.


 On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza wrote:

> Uhmm... Is not better ask the same to openshift support?
>
> Mario Lacunza
> Enviado desde mi Motorola Atrix2
> El ago 12, 2012 6:55 a.m., "surya"  escribió:
>
>  I am really fed up with tutorials on web telling how to configure
>> Django & Python 2.7 on OpenShift  DIY.
>>
>> So, can write a detailed step-by-step procedure on *how to setup
>> Django 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>
>> Thanks a lot!!
>>
>> --
>> 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/-/gM7OFF1Bx_**kJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> googlegroups.com.
>>
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> googlegroups.com.
>
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>

  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/kCd8atMMgDwJ.
>>
>> 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.
>



-- 
Marcin Tustin
Tel: 07773 

Re: Issue Deploying Django

2012-08-12 Thread Kurtis Mullins
On Aug 11, 2012 6:31 PM, "Mario Lacunza"  wrote:
>
> Dont forget ask to webfaction about it too before > you buy the package,
you have root access in WF > and you can install whaterver you want I guess.

Web faction gives root access now?

> Anyways ask WF support.
>
> http://www.webfaction.com?affiliate=lacunza

Haha, nice usage of your affiliate link. Maybe this response was a bit
biased?

-- 
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Cal Leeming [Simplicity Media Ltd]
Sorry - hit send too fast.

Once you've found the logs, you can then have a look around on Google for
what the errors mean.. if you get stuck, you can send the exact error
messages into the mailing list to see if anyone else knows what it means.

On Sun, Aug 12, 2012 at 7:10 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> You can't blindly follow a deployment tutorial and expect to not have to
> get your hands dirty - especially when it's not even an official tutorial ;)
>
> First off - you need to find the error logs for your application and/or
> web server, and/or determine where the stack is breaking
>
> Cal
>
> On Sun, Aug 12, 2012 at 6:56 PM, surya  wrote:
>
>> Hi Cal,
>>
>> Actually, I have followed this 
>> tutorialfor deploying 
>> a basic Django app using Python 2.7 on Open Shift.
>>
>> So, when I pushed the repo, the website showed me..
>>
>> Service Temporarily Unavailable
>>
>> The server is temporarily unable to service your request due to
>> maintenance downtime or capacity problems. Please try again later.
>> --
>> Apache/2.2.15 (Red Hat) Server at appName-userID.rhcloud.com Port 80
>>
>> On Sunday, August 12, 2012 10:43:46 PM UTC+5:30, Cal Leeming [Simplicity
>> Media Ltd] wrote:
>>
>>> Surya,
>>>
>>> Your original question does not really explain what problem you are
>>> having.
>>>
>>> From what I can tell, you have read tutorials on the web that explain
>>> how to set up Django on OpenShift, but you have not explained what is wrong
>>> with them, nor what specific problem you are having.
>>>
>>> You'll need to explain in more detail the exact problem you are having
>>> before anyone will be able to help you with this.
>>>
>>> Cal
>>>
>>> On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi wrote:
>>>
 Haven't got any answer! So, I thought someone from Django users would
 be using it and might help.


 On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza wrote:

> Uhmm... Is not better ask the same to openshift support?
>
> Mario Lacunza
> Enviado desde mi Motorola Atrix2
> El ago 12, 2012 6:55 a.m., "surya"  escribió:
>
>  I am really fed up with tutorials on web telling how to configure
>> Django & Python 2.7 on OpenShift  DIY.
>>
>> So, can write a detailed step-by-step procedure on *how to setup
>> Django 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>
>> Thanks a lot!!
>>
>> --
>> 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/-/gM7OFF1Bx_**kJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> googlegroups.com.
>>
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> googlegroups.com.
>
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>

  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/kCd8atMMgDwJ.
>>
>> 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 

Re: How to host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Cal Leeming [Simplicity Media Ltd]
You can't blindly follow a deployment tutorial and expect to not have to
get your hands dirty - especially when it's not even an official tutorial ;)

First off - you need to find the error logs for your application and/or web
server, and/or determine where the stack is breaking

Cal

On Sun, Aug 12, 2012 at 6:56 PM, surya  wrote:

> Hi Cal,
>
> Actually, I have followed this 
> tutorialfor deploying 
> a basic Django app using Python 2.7 on Open Shift.
>
> So, when I pushed the repo, the website showed me..
>
> Service Temporarily Unavailable
>
> The server is temporarily unable to service your request due to
> maintenance downtime or capacity problems. Please try again later.
> --
> Apache/2.2.15 (Red Hat) Server at appName-userID.rhcloud.com Port 80
>
> On Sunday, August 12, 2012 10:43:46 PM UTC+5:30, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> Surya,
>>
>> Your original question does not really explain what problem you are
>> having.
>>
>> From what I can tell, you have read tutorials on the web that explain how
>> to set up Django on OpenShift, but you have not explained what is wrong
>> with them, nor what specific problem you are having.
>>
>> You'll need to explain in more detail the exact problem you are having
>> before anyone will be able to help you with this.
>>
>> Cal
>>
>> On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi wrote:
>>
>>> Haven't got any answer! So, I thought someone from Django users would be
>>> using it and might help.
>>>
>>>
>>> On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza wrote:
>>>
 Uhmm... Is not better ask the same to openshift support?

 Mario Lacunza
 Enviado desde mi Motorola Atrix2
 El ago 12, 2012 6:55 a.m., "surya"  escribió:

 I am really fed up with tutorials on web telling how to configure
> Django & Python 2.7 on OpenShift  DIY.
>
> So, can write a detailed step-by-step procedure on *how to setup
> Django 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>
> Thanks a lot!!
>
> --
> 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/-/gM7OFF1Bx_**kJ
> .
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> googlegroups.com.
>
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
  --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 googlegroups.com.

 For more options, visit this group at http://groups.google.com/**
 group/django-users?hl=en
 .

>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> googlegroups.com.
>>>
>>> For more options, visit this group at http://groups.google.com/**
>>> group/django-users?hl=en
>>> .
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/kCd8atMMgDwJ.
>
> 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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread surya
Hi Cal,

Actually, I have followed this 
tutorialfor deploying a 
basic Django app using Python 2.7 on Open Shift.

So, when I pushed the repo, the website showed me..

Service Temporarily Unavailable

The server is temporarily unable to service your request due to maintenance 
downtime or capacity problems. Please try again later.
--
Apache/2.2.15 (Red Hat) Server at appName-userID.rhcloud.com Port 80

On Sunday, August 12, 2012 10:43:46 PM UTC+5:30, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
> Surya,
>
> Your original question does not really explain what problem you are having.
>
> From what I can tell, you have read tutorials on the web that explain how 
> to set up Django on OpenShift, but you have not explained what is wrong 
> with them, nor what specific problem you are having.
>
> You'll need to explain in more detail the exact problem you are having 
> before anyone will be able to help you with this.
>
> Cal
>
> On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi 
>  > wrote:
>
>> Haven't got any answer! So, I thought someone from Django users would be 
>> using it and might help.
>>
>>
>> On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza 
>> > > wrote:
>>
>>> Uhmm... Is not better ask the same to openshift support?
>>>
>>> Mario Lacunza
>>> Enviado desde mi Motorola Atrix2
>>> El ago 12, 2012 6:55 a.m., "surya"  
>>> escribió:
>>>
>>> I am really fed up with tutorials on web telling how to configure Django 
 & Python 2.7 on OpenShift  DIY.

 So, can write a detailed step-by-step procedure on *how to setup 
 Django 1.4 with Python 2.7 on OpenShift using VirtualEnv*??

 Thanks a lot!!

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

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/kCd8atMMgDwJ.
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: Hosting tutorials

2012-08-12 Thread surya
HI Scott,

Thanks for replying. Actually I have been on Heroku for some time. Its 
pretty good. However, I am looking for a PaaS which provides Database 
Hosting. Heroku does that but I need credit card to do use it.

As OpenShift doesn't ask me such details and also provides good servers.. I 
thought to move to it.



On Sunday, August 12, 2012 10:58:54 PM UTC+5:30, citadelgrad wrote:
>
> I'd recommend you following heroku's step-by-step 
> tutorialto get a test app 
> working on Heroku then try to deploy your app. Heroku's 
> documentation is good and you won't need to worry about setting up 
> virtualenv. The Django book is out of date and so if you are developing 
> against 1.4 you will have a lot of problems that will be difficult to sort 
> out.  Django 1.4 changed the project structure of apps so you will probably 
> run into problems if you are following tutorials written for 1.3 or older.
>
> Thanks,
>
> Scott
>
>
> On Sunday, August 12, 2012 4:50:49 AM UTC-7, surya wrote:
>>
>> Hey,
>>
>> As you said that you were using Django on Open Shift..
>>
>> Can you tell me how to configure Django 1.4 and Python 2.7 on openshift 
>> DIY with virtualenv??
>>
>> I tried almost every tutorial on web and fed up with them. I don't know 
>> why but I just run into errors..
>>
>> So, could you please write a detailed step-by-step procedure for that?? 
>> It will help me a lot!
>>
>>
>> Thanks.
>>
>> Waiting for your rely.
>>
>> On Thursday, March 29, 2012 12:01:59 AM UTC+5:30, yati sagade wrote:
>>>
>>> Hi
>>> I you just want to share your apps with the world, you do not need to 
>>> pay for a complete server setup. I have been using OpenShift(
>>> https://openshift.redhat.com/app/) for long now, and it's quite easy to 
>>> get up and running. Others are[not tried, but heard are great] Heroku(
>>> http://www.heroku.com/), Google AppEngine(https://appengine.google.com/). 
>>> I've actually used GAE for Python, but using Django and it's ORM is a bit 
>>> tricky here, but nonetheless doable. Another one with great reviews is 
>>> CloudFoundry by VMWare (http://www.cloudfoundry.com/).
>>>
>>> Cheers!
>>>
>>> -- 
>>> Yati Sagade 
>>>
>>> Twitter: @yati_itay 
>>>
>>> Organizing member of TEDx EasternMetropolitanBypass
>>> http://www.ted.com/tedx/events/4933
>>>
>>> https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
>>>
>>>
>>>

-- 
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/-/eFQvmn6U6k4J.
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: Hosting tutorials

2012-08-12 Thread citadelgrad
I'd recommend you following heroku's step-by-step 
tutorialto get a test app working 
on Heroku then try to deploy your app. Heroku's 
documentation is good and you won't need to worry about setting up 
virtualenv. The Django book is out of date and so if you are developing 
against 1.4 you will have a lot of problems that will be difficult to sort 
out.  Django 1.4 changed the project structure of apps so you will probably 
run into problems if you are following tutorials written for 1.3 or older.

Thanks,

Scott


On Sunday, August 12, 2012 4:50:49 AM UTC-7, surya wrote:
>
> Hey,
>
> As you said that you were using Django on Open Shift..
>
> Can you tell me how to configure Django 1.4 and Python 2.7 on openshift 
> DIY with virtualenv??
>
> I tried almost every tutorial on web and fed up with them. I don't know 
> why but I just run into errors..
>
> So, could you please write a detailed step-by-step procedure for that?? It 
> will help me a lot!
>
>
> Thanks.
>
> Waiting for your rely.
>
> On Thursday, March 29, 2012 12:01:59 AM UTC+5:30, yati sagade wrote:
>>
>> Hi
>> I you just want to share your apps with the world, you do not need to pay 
>> for a complete server setup. I have been using OpenShift(
>> https://openshift.redhat.com/app/) for long now, and it's quite easy to 
>> get up and running. Others are[not tried, but heard are great] Heroku(
>> http://www.heroku.com/), Google AppEngine(https://appengine.google.com/). 
>> I've actually used GAE for Python, but using Django and it's ORM is a bit 
>> tricky here, but nonetheless doable. Another one with great reviews is 
>> CloudFoundry by VMWare (http://www.cloudfoundry.com/).
>>
>> Cheers!
>>
>> -- 
>> Yati Sagade 
>>
>> Twitter: @yati_itay 
>>
>> Organizing member of TEDx EasternMetropolitanBypass
>> http://www.ted.com/tedx/events/4933
>>
>> https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
>>
>>
>>

-- 
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/-/ck9q_sjcEbMJ.
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Cal Leeming [Simplicity Media Ltd]
Surya,

Your original question does not really explain what problem you are having.

>From what I can tell, you have read tutorials on the web that explain how
to set up Django on OpenShift, but you have not explained what is wrong
with them, nor what specific problem you are having.

You'll need to explain in more detail the exact problem you are having
before anyone will be able to help you with this.

Cal

On Sun, Aug 12, 2012 at 4:48 PM, Surya Kasturi wrote:

> Haven't got any answer! So, I thought someone from Django users would be
> using it and might help.
>
>
> On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza  wrote:
>
>> Uhmm... Is not better ask the same to openshift support?
>>
>> Mario Lacunza
>> Enviado desde mi Motorola Atrix2
>> El ago 12, 2012 6:55 a.m., "surya"  escribió:
>>
>> I am really fed up with tutorials on web telling how to configure Django
>>> & Python 2.7 on OpenShift  DIY.
>>>
>>> So, can write a detailed step-by-step procedure on *how to setup Django
>>> 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>>
>>> Thanks a lot!!
>>>
>>> --
>>> 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/-/gM7OFF1Bx_kJ.
>>> 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.
>

-- 
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 let user change the language

2012-08-12 Thread Gelonida N


I'd like to have a web site, where the can switch the language
The first time the user connects the language would be the prefered 
language as sugegsted by the news agent,
then the user could select the prefered lanngauge in some user 
preference settings.




What would be the standard way to do this in Django?

Thanks in advance for comments,  examples, snippets, links,

--
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 organize models

2012-08-12 Thread Jojo
It works!

Thank you very much!

Il giorno sabato 11 agosto 2012 20:25:14 UTC+2, Alexis Roda ha scritto:
>
> Al 11/08/12 15:57, En/na Jojo ha escrit: 
> > Hi, I'm developing my first web application with Django. The model is 
> > growing up quite fast and I started to split the code in different files 
> > I putted under models directory with its __init__.py file. Everything 
> > works fine, but syncdb doesn't recognize new models, and consequently 
> > doesn't create new tables. 
>
> You should import the models from __init__.py and add to every model 
>
> class Meta : 
>  app_label = "your_app_label" 
>
>
> https://docs.djangoproject.com/en/1.4/ref/models/options/#app-label 
> https://docs.djangoproject.com/en/1.4/topics/db/models/#meta-options 
>
>
> HTH 
>

-- 
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/-/WXXYU_VT730J.
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Surya Kasturi
Haven't got any answer! So, I thought someone from Django users would be
using it and might help.

On Sun, Aug 12, 2012 at 7:33 PM, Mario Lacunza  wrote:

> Uhmm... Is not better ask the same to openshift support?
>
> Mario Lacunza
> Enviado desde mi Motorola Atrix2
> El ago 12, 2012 6:55 a.m., "surya"  escribió:
>
> I am really fed up with tutorials on web telling how to configure Django &
>> Python 2.7 on OpenShift  DIY.
>>
>> So, can write a detailed step-by-step procedure on *how to setup Django
>> 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>>
>> Thanks a lot!!
>>
>> --
>> 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/-/gM7OFF1Bx_kJ.
>> 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: different language for admin/front-end

2012-08-12 Thread Melvyn Sopacua
On 12-8-2012 15:53, Gour wrote:

> what is the recommended way to set different language in Django admin
> (e.g. English) than the one in front-end (e.g. native one)?

As you can see in the documentation [1], there's five methods by which
one can select the language once you've added LocaleMiddleware:
- The first method enables the user to select the language by altering
the URL. Naturally, this can be facilitated by the site by providing
'change language' buttons.
- Two and three are controlled by the site, but can also be made
user-selectable.
- Four is fully user controllable by going into the browser options.
- Five is site-wide and should remain that way. Altering project
settings at runtime can have unforeseen side effects.

Of these options, number one is the least intrusive, but you'll have to
figure out how to handle the redirect if the language code is not part
of the URL.
Second best is the session cookie, though I don't really see a simple
way to properly set it back if one leaves the admin site (which isn't
the same as logging out).

[1]

-- 
Melvyn Sopacua

-- 
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: using vars() function in django

2012-08-12 Thread Masklinn

On 2012-08-12, at 16:15 , rafiee.nima wrote:

> Hi I need to to assign dynamic name to a variable I use blow code :
> for item,value in request.POST.items():
> if item=="kid_room"
>vars()[item]="ok"
>list.append({"a":kid_room})
>data=simplejson.dumps(list,cls=DjangoJSONEncoder)
>return HttpResponse(data, mimetype="application/json")
> 
> which kid_room is request.POST item 
> but i got error that kid_room is not defined which means vars()[item]="ok" 
> dose not work
> please help 

Why the hell would you want to do something like that in the fist place? How 
about jus writing:

if item == 'kid_room':
list.append({'a': 'ok'})

? If the name is hardcoded there obviously is no need to dynamically assign it, 
and if it's not you can just use a dict.

I see no reason to even try to do that, and so far I've never seen one when 
coding.

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



using vars() function in django

2012-08-12 Thread rafiee.nima
Hi I need to to assign dynamic name to a variable I use blow code :
 for item,value in request.POST.items():
 if item=="kid_room"
vars()[item]="ok"
list.append({"a":kid_room})
data=simplejson.dumps(list,cls=DjangoJSONEncoder)
return HttpResponse(data, mimetype="application/json")

which kid_room is request.POST item 
but i got error that kid_room is not defined which means vars()[item]="ok" 
dose not work
please help 





-- 
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/-/o7lbR_yCSWUJ.
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 host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread Mario Lacunza
Uhmm... Is not better ask the same to openshift support?

Mario Lacunza
Enviado desde mi Motorola Atrix2
El ago 12, 2012 6:55 a.m., "surya"  escribió:

> I am really fed up with tutorials on web telling how to configure Django &
> Python 2.7 on OpenShift  DIY.
>
> So, can write a detailed step-by-step procedure on *how to setup Django
> 1.4 with Python 2.7 on OpenShift using VirtualEnv*??
>
> Thanks a lot!!
>
> --
> 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/-/gM7OFF1Bx_kJ.
> 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.



different language for admin/front-end

2012-08-12 Thread Gour

Hello,

what is the recommended way to set different language in Django admin
(e.g. English) than the one in front-end (e.g. native one)?

I see there are some snippets and/or middleware for it, but the posts
are several years old and, considering I'm new to django-1,4; I wonder
if there is some other way/settings/app to achieve it?


Sincerely,
Gour

-- 
As fire is covered by smoke, as a mirror is covered by dust, 
or as the embryo is covered by the womb, the living entity is 
similarly covered by different degrees of this lust.

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


signature.asc
Description: PGP signature


How to host Django 1.4 with Python 2.7 on OpenShift DIY

2012-08-12 Thread surya
I am really fed up with tutorials on web telling how to configure Django & 
Python 2.7 on OpenShift  DIY.

So, can write a detailed step-by-step procedure on *how to setup Django 1.4 
with Python 2.7 on OpenShift using VirtualEnv*??

Thanks a lot!!

-- 
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/-/gM7OFF1Bx_kJ.
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: Hosting tutorials

2012-08-12 Thread surya
Hey,

As you said that you were using Django on Open Shift..

Can you tell me how to configure Django 1.4 and Python 2.7 on openshift DIY 
with virtualenv??

I tried almost every tutorial on web and fed up with them. I don't know why 
but I just run into errors..

So, could you please write a detailed step-by-step procedure for that?? It 
will help me a lot!


Thanks.

Waiting for your rely.

On Thursday, March 29, 2012 12:01:59 AM UTC+5:30, yati sagade wrote:
>
> Hi
> I you just want to share your apps with the world, you do not need to pay 
> for a complete server setup. I have been using OpenShift(
> https://openshift.redhat.com/app/) for long now, and it's quite easy to 
> get up and running. Others are[not tried, but heard are great] Heroku(
> http://www.heroku.com/), Google AppEngine(https://appengine.google.com/). 
> I've actually used GAE for Python, but using Django and it's ORM is a bit 
> tricky here, but nonetheless doable. Another one with great reviews is 
> CloudFoundry by VMWare (http://www.cloudfoundry.com/).
>
> Cheers!
>
> -- 
> Yati Sagade 
>
> Twitter: @yati_itay 
>
> Organizing member of TEDx EasternMetropolitanBypass
> http://www.ted.com/tedx/events/4933
>
> https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
>
>
>

-- 
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/-/kV1eT0yMHW0J.
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: custom management commands: AttributeError: 'module' object has no attribute 'Command'

2012-08-12 Thread Melvyn Sopacua
On 11-8-2012 2:14, Matthew Meyer wrote:

> The command I am running is :
> 
> $ python manage.py event_expiration
> 
> I've made sure I am adding the event_expiration.py file within management 
> and commands folders and that those folders have init files. those are in 
> one of my app folders.
> 
> Am I overlooking something here? Any help is appreciated, thanks!

Since I don't see anything wrong with your code or setup, I'm going to
take a stab in the dark and say that you need to loose the underscore in
the command.
Otherwise, please provide the *full* traceback for more clues.

-- 
Melvyn Sopacua

-- 
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 app to update site through email

2012-08-12 Thread Melvyn Sopacua
On 10-8-2012 17:23, Paul Backhouse wrote:

> Has this already been done? Does my google-fu escape me? If it hasn't
> already been done, why not? And are there any modules out there that can
> be dropped in to speed development? Any tips on developing this app?

An email gateway is what exposed contrib.auth's problems to me, because
it has the email stored on the user account info, you can only match one
email per user. In a world where people use several accounts or server
addresses with 'subdomains', having only one registered address per
account isn't practical. Also, match a user based on SMTP headers is not
very secure.

Another approach that you can observe in the wild is to have 'secret
email addresses'. In the user account information an email address at
the site's domain is made available that the user can send comments or
content to. The drawback here is that it's very sensitive to identity
theft as the assumption is made that only that user knows that address.

So very quickly, you come into the dark realm of requiring some kind of
authentication key associated with the email message and while for us
techies this is trivial, explaining that to casual internet users has
been a problem since the inception of S-MIME and PGP.

I imagine most projects that have attempted this principle strand on
this issue and the associated spam nightmare.

-- 
Melvyn Sopacua

-- 
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 app to update site through email

2012-08-12 Thread Melvyn Sopacua
On 12-8-2012 8:15, Marwan Al-Sabbagh wrote:
> thats interesting. I was gonna use python's imaplib to periodically check
> an email's inbox using IMAP, and run an action whenever new emails are
> discovered. We are running MS Exchange as our email server so I needed
> something more generic that would work essentially with any Email server
> that supports IMAP.

Oh oh you youngins ;)
http://www.fetchmail.info/

-- 
Melvyn Sopacua

-- 
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 app to update site through email

2012-08-12 Thread Marwan Al-Sabbagh
thats interesting. I was gonna use python's imaplib to periodically check
an email's inbox using IMAP, and run an action whenever new emails are
discovered. We are running MS Exchange as our email server so I needed
something more generic that would work essentially with any Email server
that supports IMAP.

On 11 August 2012 16:15, m1chael  wrote:

> Hello,
>
> I did this recently with postfix.
>
> These are my notes:
>
> [add to /etc/aliases]
> support:"|/home/support/support.py"
>
> [add to /etc/postfix/virtual]
> t...@thesupport.com  support
>
> * then run newaliases
>
> And my script looks like this:
>
> #!/usr/bin/python
>
> import sys, time, email, email.Message, email.Errors, email.Utils,
> smtplib, os, socket, random
> from datetime import date
> from email.Iterators import typed_subpart_iterator
> from time import sleep
>
> def get_charset(message, default="ascii"):
> """Get the message charset"""
>
> if message.get_content_charset():
> return message.get_content_charset()
>
> if message.get_charset():
> return message.get_charset()
>
> return default
>
> # Taken from here, with thanks -
> http://ginstrom.com/scribbles/2007/11/19/parsing-multilingual-email-with-python/
> def get_body(message):
> """Get the body of the email message"""
>
> if message.is_multipart():
> #get the plain text version only
> text_parts = [part
>   for part in typed_subpart_iterator(message,
>  'text',
>  'plain')]
> body = []
> for part in text_parts:
> charset = get_charset(part, get_charset(message))
> body.append(unicode(part.get_payload(decode=True),
> charset,
> "replace"))
>
> return u"\n".join(body).strip()
>
> else: # if it is not multipart, the payload will be a string
>   # representing the message body
> body = unicode(message.get_payload(decode=True),
>get_charset(message),
>"replace")
> return body.strip()
>
> logfile = open('/home/support/support.txt','a')
> raw_msg = sys.stdin.read()
> emailmsg = email.message_from_string(raw_msg)
>
> # Extract database Fields from mail
> msgfrom = emailmsg['From']
> msgto =  emailmsg['To']
> msgsubj = emailmsg['Subject']
> msgbody = get_body(emailmsg)
>
> # Write a log file in /tmp with a record of the e-mails
> currtime = date.today().strftime("%B %d, %Y")
> logfile.write(currtime + "\n")
> logfile.write("From: " + msgfrom + "\n")
> logfile.write("To: " + msgto + "\n")
> logfile.write("Subject: " + msgsubj + "\n")
> logfile.write("Body: " + msgbody + "\n\n")
> logfile.close()
>
> 
>
> Hope this might help someone
>
> ~Mike
>
> On Sat, Aug 11, 2012 at 6:21 AM, Marwan Al-Sabbagh <
> marwan.alsabb...@gmail.com> wrote:
>
>> It's a very cool idea. I wanted to do something similar to this where I
>> would email users notification for approvals and they could reply to the
>> email with their approval. I'm curious you said you have already
>> implemented this. How did you end up doing it.
>>
>>
>> On 10 August 2012 18:23, Paul Backhouse  wrote:
>>
>>> Hi there,
>>>
>>> The Django site I'm working on at the moment sends out emails when
>>> content is created/updated, using django-notifications.
>>>
>>> A feature I would like to add is where users can reply to these mails,
>>> ie comment on a topic. This reply then appears updated on the site.
>>>
>>> I've already written something that does this, but it's very application
>>> specific.
>>>
>>> Ideally it would be done in a generic way (as its own app), with
>>> something in the admin interface to set up the email account, and then
>>> maybe a list of ordered filters to pass over the email and consequently
>>> generate various model instances.
>>>
>>> Has this already been done? Does my google-fu escape me? If it hasn't
>>> already been done, why not? And are there any modules out there that can
>>> be dropped in to speed development? Any tips on developing this app?
>>>
>>> Thanks,
>>>
>>> Paul
>>>
>>> --
>>> 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
>>