Re: how to make https work in django REST framework

2014-02-11 Thread Luca Corti
On 12/feb/2014, at 00:36, zhenwu he  wrote:
> Currently I am using Python Django as my REST framework and it could take all 
> the calls through http. If I want to switch from http to https, what should I 
> do to make this work?

Just issue a redirect to the equivalent HTTPS url from your web server when the 
REST API url is called via plain HTTP.

ciao

Luca



signature.asc
Description: Message signed with OpenPGP using GPGMail


how to make https work in django REST framework

2014-02-11 Thread zhenwu he

Hi, There:

Currently I am using Python Django as my REST framework and it could take 
all the calls through http. If I want to switch from http to https, what 
should I do to make this work?

thanks in advance.

/zhenwu 

-- 
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/2335d8e5-9d8b-422b-9698-baddc93071ad%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using a paginator with two models in the same view

2014-02-11 Thread Some Developer

Ah, I didn't realise that.

I think I should be able to do the transformation pretty easily. Thanks 
for the info that has sorted out a rather irrating problem I have been 
having. I'll give that a try tomorrow when I have some free time.


On 11/02/2014 17:52, C. Kirby wrote:
Paginator will work on any list/tuple of objects, not just querysets. 
If you have a way to transform your 2 querysets into a single list you 
can use that as your pagination object.
Not knowing enough about your architecture I can't really discuss how 
you might go about the transformation step.


On Friday, February 7, 2014 10:46:54 AM UTC-6, Some Developer wrote:

I have two models: Thread and EmailThread. As the names suggest the
Thread model relates to threads created via the web interface and the
EmailThread model relates to threads created via email.

I want to display a list of all threads from both models on the same
page and I want to paginate this page. If there was only a single
model
to paginate the page by then it would be easy but I'm having
difficulty
finding a way to paginate a page that has two models listed on the
same
page.

Can anyone suggest an option? I guess I could split them so that each
model had its own listing view but that seems a bit messy to me. It
would be much nicer if they were held on the same page.

Thanks for any help.

--
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/da0342f4-c89d-4d38-8c00-a3a91539cf3c%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/52FACAEA.50103%40googlemail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread whitelotus
I think I got it right. I forgot to add quotes for the strings to translate 
in trans tag. Thank you all. 

在 2014年2月11日星期二UTC-6上午8时24分52秒,Loutre写道:
>
> Well, according to a question on stackoverflow, this message appears when 
> you don't have any message to translate in your app.. maybe you could check 
> it ?
>
> Le mardi 11 février 2014 15:11:47 UTC+1, whitelotus a écrit :
>>
>> Yes it's installed. As follows, I'm using ubuntu12.04. Thanks.
>>
>> $sudo apt-get install gettext
>> Reading package lists... Done
>> Building dependency tree   
>> Reading state information... Done
>> gettext is already the newest version.
>> 0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
>>
>> 在 2014年2月11日星期二UTC-6上午7时43分28秒
>>
>

-- 
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/25a5785a-50b9-47d4-8aa0-612481a55e36%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread whitelotus
Thank you. It's working now. The strange thing is that I did have strings 
to translate in the template but without strings to translate in py, it 
complained like that. When I added something to translate in py, it works. 


在 2014年2月11日星期二UTC-6上午8时24分52秒,Loutre写道:
>
> Well, according to a question on stackoverflow, this message appears when 
> you don't have any message to translate in your app.. maybe you could check 
> it ?
>
> Le mardi 11 février 2014 15:11:47 UTC+1, whitelotus a écrit :
>>
>> Yes it's installed. As follows, I'm using ubuntu12.04. Thanks.
>>
>> $sudo apt-get install gettext
>> Reading package lists... Done
>> Building dependency tree   
>> Reading state information... Done
>> gettext is already the newest version.
>> 0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
>>
>> 在 2014年2月11日星期二UTC-6上午7时43分28秒
>>
>

-- 
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/4e6bbbf7-85b6-41c9-8a2f-40058ee221e9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-11 Thread Cal Leeming [Simplicity Media Ltd]
Hi Marsh,

Could you have a read of this thread;
https://groups.google.com/forum/#!msg/django-users/q64B4chm1ho/cCp_Xvxu41oJ

It has some tips/advice on what to put into a job description, it helps
keep the list free of recruiter spam and will ultimately result in better
responses for you too :)

Thank you

Cal


On Tue, Feb 11, 2014 at 8:54 PM, Marsh Sutherland wrote:

> Hi Djangonauts,
>
> Do you know anyone for my client's newly open Lead Python / Django
> Developer opening?
>
> They are a well-funded, stable, and disruptive startup in the Chandler
> area.
>
> If you do, please have them email their resume to me at
> msutherl...@waldenrecruiting.com AND mention your name as the referral
> source.
>
> Cheers!
>
> Marsh Sutherland
>
> President
>
> Walden Recruiting
>
> We Grow Your Startup(tm)
>
> Come see how at waldenrecruiting.com
>
>
>
> (877) 8 WALDEN Ext 2 (Voice/Fax)
>
> (877) 892-5336 Ext 2
>
> msutherl...@waldenrecruiting.com
>
> --
> 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/533070c8-ae0d-4aa4-af3f-71e19d28ada2%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/CAHKQagGx0asM0Z_WFs_AUN4trk%2B8y%2BTCtxCeVHxxz7%3Dh7dwMzA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django admin broken after putting into production

2014-02-11 Thread bhudspeth60
Thank you .collectstatic did the trick...

On Tuesday, February 11, 2014 2:39:59 PM UTC-7, Glyn Jackson wrote:
>
> Silly question, don't be offended, but have you run 
> collectstaticon
>  your production server?
>>
>

-- 
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/61735b69-5e60-4345-b824-0c2b25bdfa68%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[JOB] $1,500 referral reward - Know anyone for Lead Python / Django Developer opening?

2014-02-11 Thread Marsh Sutherland


Hi Djangonauts,

Do you know anyone for my client's newly open Lead Python / Django 
Developer opening? 

They are a well-funded, stable, and disruptive startup in the Chandler 
area. 

If you do, please have them email their resume to me at 
msutherl...@waldenrecruiting.com AND mention your name as the referral 
source.

Cheers!

Marsh Sutherland

President

Walden Recruiting

We Grow Your Startup™

Come see how at waldenrecruiting.com

 

(877) 8 WALDEN Ext 2 (Voice/Fax)

(877) 892-5336 Ext 2

msutherl...@waldenrecruiting.com 

-- 
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/533070c8-ae0d-4aa4-af3f-71e19d28ada2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django admin broken after putting into production

2014-02-11 Thread Glyn Jackson

>
> Silly question, don't be offended, but have you run 
> collectstaticon
>  your production server?
>

-- 
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/0d9f10d8-efbf-477f-a3db-9385b6e51298%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: heroku better for django?

2014-02-11 Thread Glyn Jackson
If you have a small app it's darn easy. I have personal experience with 
Amazon AWS which is by far a better choice. 
I wrote a guide on setup with Django if it helps:
http://glynjackson.org/weblog/entry/django-15-deployement-amazon-ec2-ubuntu.html

At the end of the day Heroku runs on AWS instances, why not cut out the 
middle man. I personally don't like Platform as a Service (PaaS), AWS offer 
Infrastructure as a Service (IaaS). 

Read more: 
http://www.quora.com/Heroku/How-easy-is-it-to-get-off-Heroku-once-you-grow-out-of-it

As you can see not a big fan.

-- 
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/8f4db73b-e645-4c01-8a21-e3d89dfe0d71%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Translated URL's

2014-02-11 Thread werefrog

Felipe,

Well, if you don't prefix your urls with language code, Django will try 
to match translated urls in the language retained for the session [1] 
(black-box guessing).


I see multiple options, but the following is the less messy and seems to 
fit your requirements:


# myproject.urls

from django.conf.urls import patterns, url
from django.utils.translation import ugettext_lazy as _

from help.views import HelpView


urlpatterns = patterns('',
 url(_(r'^help/$'), HelpView.as_view(), name='help-view')),
 url(r'^(help|ayuda)/$', HelpView.as_view())),
)

You keep first the translated named url for "reverse" sake then you add a 
forgiving pattern pointing to the right view.

Anyway, I found usefull to experience the localised rendering for different reasons 
(specific additions as legal informations, etc.) and you can easily propose a language 
selection "widget". I find also the prefix good for many reasons but you 
probably have your own ;)
 
Regards,


Michel

[1] 
https://docs.djangoproject.com/en/dev/topics/i18n/translation/#how-django-discovers-language-preference



Le 10/02/2014 13:22, Felipe Mesquita de Oliveira a écrit :

Michel,


Thanks for you reply.
My ideia was to make it without the '/es/' or '/en/' starting the url.

Let's say a user share an 'es' link to an american user.
Like this:  '/ayuda/'
I wanted the american user to be able to open it using language defined in
user's session ('en').

Thanks in advance,
Felipe







On Friday, February 7, 2014 11:23:39 PM UTC-2, werefrog wrote:

Hello,

I don't know where you're trying the troublesome reverse but maybe the
following can help.


# myproject.urls

from django.conf.urls import patterns, url
from django.utils.translation import ugettext_lazy as _
from django.conf.urls.i18n import i18n_patterns

from help.views import HelpView


urlpatterns = patterns('',
  #
)

urlpatterns += i18n_patterns('',
  url(_(r'^help/$'), HelpView.as_view(), name='help-view')),
  url(_(r'^news/'), include('news.urls')), # can add namespace
)


# news.urls

from django.conf.urls import patterns, url
from django.utils.translation import ugettext_lazy as _
from .views import PageOneView, PageTwoView


urlpatterns = patterns('',
  url(_(r'^$'), PageOneView.as_view(), name='news'),
  url(_(r'^page-one/$'), PageOneView.as_view(), name='news-page-one'),
  url(_(r'^page-two/$'), PageTwoView.as_view(), name='news-page-two'),
)

# test.py

from django.utils.translation import activate

activate('es')
#...


# resulting urls

/en/help/
/es/ayuda/

/en/news/
/en/news/page-one/
/en/news/page-two/
/es/noticias/
/es/noticias/pagina-um/
/es/noticias/pagina-dos/

Of course, you need to translate to spanish.

#

https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-files
python manage.py makemessages -l es
# python manage.py makemessages -a

# translate resulting file then …

#

https://docs.djangoproject.com/en/dev/topics/i18n/translation/#compiling-message-files
python manage.py compilemessages

Regards,
Michel




--
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/52FA938B.7010907%40yahoo.fr.
For more options, visit https://groups.google.com/groups/opt_out.


Re: heroku better for django?

2014-02-11 Thread Daniel Sears
I can't give a qualified opinion of Google App Engine, but you probably
want to start with Randall Degges book The Heroku Hacker's
Guide
.


On Tue, Feb 11, 2014 at 9:48 AM, Malik Rumi  wrote:

> I have been trying to get my django project on Google App Engine without
> success, including posting my most recent problem on Stack Overflow and
> getting zero responses (I just reposted that question 
> herein 
> Django Google Groups). I am using MySQL locally and trying to use Google
> Cloud SQL when and if I get on App Engine. I find the django documentation
> on App Engine fragmentary, occasionally out of date and therefore
> inconsistent. I suspect this is because GAE support for Django has been
> slow in developing because of GAE’s preference for webapp2,  nonrel, and
> jinja2 templates. Yesterday I found a step by step guide for getting django
> on heroku using postgres, which I’ve never used, but I can learn if I have
> to. I don’t think the quality of the documentation alone tells me about the
> quality of the software or the experience of using it, but maybe it isn’t
> irrelevant, either.
>
> My question: Is Heroku better, or easier, for Django than App Engine? Does
> anyone here have some concrete, specific, and hopefully unbiased comparison
> experience to share?
>
> --
> 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/1668c4af-4ea1-45f8-a1ab-8a5356f34ead%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/CALLzXtR_VygjhpYCz1cfSvUR0J-0d1NE0D4Ycy76E_Eaj7Hvwg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Using a paginator with two models in the same view

2014-02-11 Thread C. Kirby
Paginator will work on any list/tuple of objects, not just querysets. If 
you have a way to transform your 2 querysets into a single list you can use 
that as your pagination object.
Not knowing enough about your architecture I can't really discuss how you 
might go about the transformation step.

On Friday, February 7, 2014 10:46:54 AM UTC-6, Some Developer wrote:
>
> I have two models: Thread and EmailThread. As the names suggest the 
> Thread model relates to threads created via the web interface and the 
> EmailThread model relates to threads created via email. 
>
> I want to display a list of all threads from both models on the same 
> page and I want to paginate this page. If there was only a single model 
> to paginate the page by then it would be easy but I'm having difficulty 
> finding a way to paginate a page that has two models listed on the same 
> page. 
>
> Can anyone suggest an option? I guess I could split them so that each 
> model had its own listing view but that seems a bit messy to me. It 
> would be much nicer if they were held on the same page. 
>
> Thanks for any help. 
>

-- 
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/da0342f4-c89d-4d38-8c00-a3a91539cf3c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


heroku better for django?

2014-02-11 Thread Malik Rumi


I have been trying to get my django project on Google App Engine without 
success, including posting my most recent problem on Stack Overflow and 
getting zero responses (I just reposted that question 
herein Django 
Google Groups). I am using MySQL locally and trying to use Google 
Cloud SQL when and if I get on App Engine. I find the django documentation 
on App Engine fragmentary, occasionally out of date and therefore 
inconsistent. I suspect this is because GAE support for Django has been 
slow in developing because of GAE’s preference for webapp2,  nonrel, and 
jinja2 templates. Yesterday I found a step by step guide for getting django 
on heroku using postgres, which I’ve never used, but I can learn if I have 
to. I don’t think the quality of the documentation alone tells me about the 
quality of the software or the experience of using it, but maybe it isn’t 
irrelevant, either. 

My question: Is Heroku better, or easier, for Django than App Engine? Does 
anyone here have some concrete, specific, and hopefully unbiased comparison 
experience to share?

-- 
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/1668c4af-4ea1-45f8-a1ab-8a5356f34ead%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django default settings module errors

2014-02-11 Thread Malik Rumi


My immediate goal is to port my (first) Django project to Google App 
Engine. It is running fine in Django’s runserver. However, in the GAE SDK I 
get nothing but blank white pages. I have looked at the Djangosettings
 documentation , 
the django-admin 
command, 
and the GAE Cloud-SQL Django 
documenation.
 
I am on Windows 8.1 with Django 1.6.1 and Python 2.7 and a MySQL 5.5 
backend. I have the GAE SDK 1.8.9.


One of the messages I got was that the SDK didn’t work with Django 1.6.1 so 
I set the version to ‘latest’.

When I ran django-admin.py syncdb --settings=mysite.settings from within 
the directory, I got no error messages from Django but still got the blank 
pages and the same error message from the SDK as before:


% (desc, ENVIRONMENT_VARIABLE))

ImproperlyConfigured: Requested setting MIDDLEWARE_CLASSES, but settings 
are not configured. You must either define the environment variable 
DJANGO_SETTINGS_MODULE or call settings.configure() before accessing 
settings.


Then I ran django-admin.py syncdb --settings=[absolute path] mysite.settings. 
This time I got this from the command line:


% (self.SETTINGS_MODULE, e)

ImportError: Could not import settings 'C:\Users…settings' (Is it on 
sys.path? Is there an import error in the settings file?): Import by 
filename is not supported.


The SDK still gives the same ImproperlyConfigured error. Then I tried 
putting the path directly into environmental variables myself, in PYTHONPATH 
between 
Django and App Engine, but I still get the same errors, so now I am turning 
to you. What do I do now?

-- 
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/f040d157-070d-47a5-ba9d-6667a4097845%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django admin broken after putting into production

2014-02-11 Thread bhudspeth60


Hello, 


after considerable struggle to get my Apache mod-wsgi and httpd.conf 
configuration correct so that my static files can be accessed, now my admin 
pages don't workwhile the admin page content loads, I have no css, js, 
or images...And, the list of my pages will not show up..

*httpd.conf*



#/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin

ServerName epswww1.unm.edu
DocumentRoot /home/eps_admin/epsWeb/epsWeb/site-media

Alias /site-media/ /home/eps_admin/epsWeb/epsWeb/site-media/
Alias /images/ /home/eps_admin/epsWeb/epsWeb/site-media/images/
Alias /media/ /home/eps_admin/epsWeb/epsWeb/site-media/

WSGIScriptAlias / /home/eps_admin/epsWeb/epsWeb/wsgi.py

ErrorLog ${APACHE_LOG_DIR}/static_error.log
LogLevel warn

  # serve static stuff from here
  
   #AllowOverride None
   Order deny,allow
   Allow from all
  




*relevant info from settings.py*

MEDIA_ROOT = os.path.join(PROJECT_PATH, "site-media")
MEDIA_URL = "/site-media/"
STATIC_ROOT = os.path.join("/home/eps_admin/epsWeb/epsWeb/static/")
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
os.path.join(BASE_DIR,"static"),
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

Any help appreciated

Thanks, Wilbur

-- 
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/d6c97b56-3e55-41e7-b67b-e03701988c32%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Johan Hendriks

Johan Hendriks schreef:

Hello all.

I have a little question, maybe a little stupid but non the less it 
keeps me busy. :-)


I want to start making some web based apps as a hobby project.
I have no coding experience other then some basic shell scripting to 
get some daily routine jobs done on my FreeBSD servers.
The first struggle I had to take is the programming language, I looked 
at PHP and python, and I think my best option is Python, and with 
python comes Django.
So the last weeks i have been doing some searches on google and view a 
lot of tutorial video's how to start with django.


One thing that always comes back is the import part like below

from  django.http  import  HttpResponse

And here comes my question, where and how do you know what you need to 
import.
What is the best way to learn al these imports? , and is there a quick 
way to find the imports you need?


Thank you for your time.

regards
Johan




Thank you all for the comments.
I will start with the options given like think python and learn python 
the hard way, then try to convert my bash scripts into python scripts.


In the mean time i will lurk this mailing list

regards
Johan


--
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/52FA40A7.9060101%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread Vianney Gremmel
Well, according to a question on stackoverflow, this message appears when 
you don't have any message to translate in your app.. maybe you could check 
it ?

Le mardi 11 février 2014 15:11:47 UTC+1, whitelotus a écrit :
>
> Yes it's installed. As follows, I'm using ubuntu12.04. Thanks.
>
> $sudo apt-get install gettext
> Reading package lists... Done
> Building dependency tree   
> Reading state information... Done
> gettext is already the newest version.
> 0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.
>
> 在 2014年2月11日星期二UTC-6上午7时43分28秒
>

-- 
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/8fbad166-e0c7-4f6f-ad37-4e45718a82f9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Optimizing DB query involving annotate and aggregate

2014-02-11 Thread ST
Managed it in the end, so for reference here is what I ended up with:

def total_credit_debt(self):
transaction_totals = 
Transaction.objects.filter(member__isnull=False).values('member').annotate(total=Sum('amount')).order_by()
creditors = transaction_totals.filter(total__gt=0)
debtors = transaction_totals.filter(total__lt=0)
total_credit = sum(row['total'] for row in creditors)
total_debt = sum(row['total'] for row in debtors)
return total_credit, total_debt

(@classmethod on TransactionManager)

Unfortunately I didn't manage to get it to do the second sum inside the 
database as well, but this is fast enough - there's only a few hundred 
members with non-zero balances. If you think there's any way this could be 
improved / cleaned up, I'd be happy to hear:)

Thanks!


On Thursday, February 6, 2014 7:59:37 PM UTC, arnonym wrote:
>
> On Wed, 5 Feb 2014 10:11:29 -0800 (PST) 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. 
>
> I did something similar a few years back. Its next to impossible with 
> django-orm, just do it in raw sql. 
> The django-orm can't really do any advanced group_by clauses. And you 
> can't give them with extra(). Well, you can give them but they won't be 
> used;-) 
>
> Doing two (or three) orm-queries and then joining the data in python 
> will actually be slower then doing it all in hand-crafted sql. 
>
> So just do the sql by hand. And then optimize by having three columns, 
> one with the SUM(amount) if amount>0, one with the SUM(amount) if 
> amount<0 and one with the SUM(amount). Total credits, total depts and 
> balance all in one query (if possible)... 
>
> - Arnold 
>

-- 
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/73bd4ddb-d6ee-461a-bed3-a3ee915b8859%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread whitelotus
Yes it's installed. As follows, I'm using ubuntu12.04. Thanks.

$sudo apt-get install gettext
Reading package lists... Done
Building dependency tree   
Reading state information... Done
gettext is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 111 not upgraded.

在 2014年2月11日星期二UTC-6上午7时43分28秒,Vianney Gremmel写道:
>
> Is gettext installed on your machine ? 
>>>
>>

-- 
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/509bef39-3fcd-4446-acfb-f3ed70239d15%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Johan Beyers
Hi, Johan,

To answer the spirit of your question: Mostly, you will get the correct
import locations from the examples you use. Once you're used to Python, you
will see that there is a logic to the imports:

* You start at wherever your virtualenv stores its site-packages if you use
virtualenv, otherwise it should be somewhere in your Python path. For
example, my virtualenv directory is called ve, so I start at
ve/lib/python2.7/site-packages.

* Next you just burrow down the path, keeping in mind the convention that a
python module that you can import from is either a file with the module
name, or a directory with the module name, that has an __init__.py file in
it. For example: The import source above could be in
ve/lib/python2.7/site-packages/django/http.py or in
 ve/lib/python2.7/site-packages/django/http/__init__.py. In our case, the
second one is the right one.

* Note that when you open up that file, you see that it actually imports
the HttpResponse from django.http.response, which sits in the same
directory in the response.py file. This is usually due to a few factors:
Backwards compatibility, more compact imports of related functionality from
elsewhere, or maybe it's just the preferred coding style :)

OK, so that covers django imports, as well as other specific packages in
your requirements files, if you use pip (and you should, really). There are
2 other non-obvious places you will have imports:

1. If you have installed extra python packages globally, you might be able
to import those from other locations in the path. There, you probably need
to open a python debugger and look at sys.path to see where to start
looking for the actual files.

2. Python has many, many modules included, but not imported by default.
These you will encounter as you search for examples on how to do things in
Python. For example, math:

>>> from math import sqrt
>>> sqrt(16)
4

That should cover it. Keep in mind that Python is open source, so you can
find most of this from reading the source code. However, it's all
documented pretty well on the Django site, as well as various Python docs
sites.

Hope this helps,

Johan


> On Tue, Feb 11, 2014 at 5:26 AM, Johan Hendriks wrote:
>
>> Hello all.
>>
>> I have a little question, maybe a little stupid but non the less it keeps
>> me busy. :-)
>>
>> I want to start making some web based apps as a hobby project.
>> I have no coding experience other then some basic shell scripting to get
>> some daily routine jobs done on my FreeBSD servers.
>> The first struggle I had to take is the programming language, I looked at
>> PHP and python, and I think my best option is Python, and with python comes
>> Django.
>> So the last weeks i have been doing some searches on google and view a
>> lot of tutorial video's how to start with django.
>>
>> One thing that always comes back is the import part like below
>>
>> from  django.http  import  HttpResponse
>>
>> And here comes my question, where and how do you know what you need to
>> import.
>> What is the best way to learn al these imports? , and is there a quick
>> way to find the imports you need?
>>
>> Thank you for your time.
>>
>> regards
>> Johan
>>
>>

-- 
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/CAMto1Srrg1avEBdZH5v-sVHnUP8BPSER_iGQU%2BMkA3OOpPEyYg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread Vianney Gremmel

>
> Is gettext installed on your machine ? 
>>
>

-- 
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/9a819cc6-794d-4ef7-8740-5d2c9a8a123e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Manu
Hi Johan,

I don't know if you put sometime into learning python. These imports are a 
way to reuse other modules that already provide some of the functionality 
that you are trying to achieve. To know the right module to import from and 
to select the right things to import, you should consult that package's 
documentation. Like django documentation for 
imports from django.

All the best!
- Manu,

On Tuesday, 11 February 2014 15:56:19 UTC+5:30, joh.hendriks wrote:
>
> Hello all. 
>
> I have a little question, maybe a little stupid but non the less it 
> keeps me busy. :-) 
>
> I want to start making some web based apps as a hobby project. 
> I have no coding experience other then some basic shell scripting to get 
> some daily routine jobs done on my FreeBSD servers. 
> The first struggle I had to take is the programming language, I looked 
> at PHP and python, and I think my best option is Python, and with python 
> comes Django. 
> So the last weeks i have been doing some searches on google and view a 
> lot of tutorial video's how to start with django. 
>
> One thing that always comes back is the import part like below 
>
> from  django.http  import  HttpResponse 
>
> And here comes my question, where and how do you know what you need to 
> import. 
> What is the best way to learn al these imports? , and is there a quick 
> way to find the imports you need? 
>
> Thank you for your time. 
>
> regards 
> Johan 
>
>
>
>

-- 
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/1bb02bb9-d284-4fbd-8a9f-0dad4a2bdd4e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Vineet Naik
+1 for getting yourself familiar with Python first before trying to learn a
framework like django.

Since you mentioned that you have no significant programming experience, I
would like to suggest
"Learn Python the hard way" which is free to read online (
http://learnpythonthehardway.org/book/)

Regards,
Vineet


On Tue, Feb 11, 2014 at 6:31 PM, Timothy W. Cook  wrote:

> Welcome to the wonderful world of Python.  I suggest that you immerse
> yourself in http://www.greenteapress.com/thinkpython/  and then take this
> (free) course next month https://www.coursera.org/course/interactivepython 
> before tackling anything like Django.
>
> Best,
> Tim
>
>
>
>
> On Tue, Feb 11, 2014 at 8:26 AM, Johan Hendriks wrote:
>
>> Hello all.
>>
>> I have a little question, maybe a little stupid but non the less it keeps
>> me busy. :-)
>>
>> I want to start making some web based apps as a hobby project.
>> I have no coding experience other then some basic shell scripting to get
>> some daily routine jobs done on my FreeBSD servers.
>> The first struggle I had to take is the programming language, I looked at
>> PHP and python, and I think my best option is Python, and with python comes
>> Django.
>> So the last weeks i have been doing some searches on google and view a
>> lot of tutorial video's how to start with django.
>>
>> One thing that always comes back is the import part like below
>>
>> from  django.http  import  HttpResponse
>>
>> And here comes my question, where and how do you know what you need to
>> import.
>> What is the best way to learn al these imports? , and is there a quick
>> way to find the imports you need?
>>
>> Thank you for your time.
>>
>> regards
>> Johan
>>
>>
>>
>> --
>> 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/52F9FACB.5010108%40gmail.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> MLHIM VIP Signup: http://goo.gl/22B0U
> 
> Timothy Cook, MSc   +55 21 94711995
> MLHIM http://www.mlhim.org
> Like Us on FB: https://www.facebook.com/mlhim2
> Circle us on G+: http://goo.gl/44EV5
> Google Scholar: http://goo.gl/MMZ1o
> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>
> --
> 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%2B%3DOU3XPbDZZE7e1SYm8e2cpDfWo%3DM3tviwgTXPHkyUmzQj83w%40mail.gmail.com
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
~ Vineet

-- 
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/CADmbCiOzq5%3DMx1ZiXix3_YmWZ%3Dmw%3DhFDUAcxciQAv8m4WMeirw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: makemessages error. Please help!

2014-02-11 Thread whitelotus
Hi, 

Thank you for the help. I did have configured the LOCALE_PATHS in 
setting.py, which looks:

 85 LOCALE_PATHS = (   
 
 86 os.path.join(os.path.dirname(__file__), 'locale').replace('\\', 
'/'),   
 87 )

Any other ideas, please? Thanks.

Best,
Qian

在 2014年2月10日星期一UTC-6下午11时23分58秒,sacrac写道:
>
> hi maybe you need configure the setting put path for you locale dirs
>
> LOCALE_PATHS = (
> os.path.join(SITE_ROOT,'locale'),
> )
>
> https://docs.djangoproject.com/en/dev/ref/settings/#locale-paths
>
> Cheers
>
>
> On Mon, Feb 10, 2014 at 9:44 PM, whitelotus 
> > wrote:
>
>>
>> Hi, all,
>>
>> To create the message file, I did "django-admin.py makemessages -l 
>> zh_CN". It popped out the following error which I couldn't find on the web. 
>> Could anyone tell me the reason why this happened, please?  is 
>> the absolute app path which is right. I tried "touch > path>/locale/django.pot", but it still complained the same error and it 
>> seemed that msguniq deleted this file. I also tried "django-admin.py 
>> makemessages --keep-pot -l zh_CN" which didn't work either. Thank you.
>>
>> processing locale zh_CN
>> CommandError: errors happened while running msguniq
>> msguniq: error while opening "/locale/django.pot" for reading: 
>> No such file or directory
>>  
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@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/8ff2f353-7e26-4fcb-90a8-9e5d34e77399%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/5e0476e6-150d-460f-874a-46af749c2d95%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Adolphe Cher-Aime
Hi Hendriks,

My suggestion to you is to first take a look at the python language it self
as  Django is as python framework. There's a lot of tutorials out there to
help you. When you feel that you understand python, you can come back to
django.
The good news is you don't have to be a Python expert to build good web
apps in Django.


Good luck.

Adolphe Cher-Aime



On Tue, Feb 11, 2014 at 5:26 AM, Johan Hendriks wrote:

> Hello all.
>
> I have a little question, maybe a little stupid but non the less it keeps
> me busy. :-)
>
> I want to start making some web based apps as a hobby project.
> I have no coding experience other then some basic shell scripting to get
> some daily routine jobs done on my FreeBSD servers.
> The first struggle I had to take is the programming language, I looked at
> PHP and python, and I think my best option is Python, and with python comes
> Django.
> So the last weeks i have been doing some searches on google and view a lot
> of tutorial video's how to start with django.
>
> One thing that always comes back is the import part like below
>
> from  django.http  import  HttpResponse
>
> And here comes my question, where and how do you know what you need to
> import.
> What is the best way to learn al these imports? , and is there a quick way
> to find the imports you need?
>
> Thank you for your time.
>
> regards
> Johan
>
>
>
> --
> 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/52F9FACB.5010108%40gmail.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%2BfkitJMHwZ5WnAPE0Tip7fpP%3DNbwDVNxYuFTx%3DX3st4BVGd%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: import

2014-02-11 Thread Timothy W. Cook
Welcome to the wonderful world of Python.  I suggest that you immerse
yourself in http://www.greenteapress.com/thinkpython/  and then take this
(free) course next month
https://www.coursera.org/course/interactivepython before tackling
anything like Django.

Best,
Tim




On Tue, Feb 11, 2014 at 8:26 AM, Johan Hendriks wrote:

> Hello all.
>
> I have a little question, maybe a little stupid but non the less it keeps
> me busy. :-)
>
> I want to start making some web based apps as a hobby project.
> I have no coding experience other then some basic shell scripting to get
> some daily routine jobs done on my FreeBSD servers.
> The first struggle I had to take is the programming language, I looked at
> PHP and python, and I think my best option is Python, and with python comes
> Django.
> So the last weeks i have been doing some searches on google and view a lot
> of tutorial video's how to start with django.
>
> One thing that always comes back is the import part like below
>
> from  django.http  import  HttpResponse
>
> And here comes my question, where and how do you know what you need to
> import.
> What is the best way to learn al these imports? , and is there a quick way
> to find the imports you need?
>
> Thank you for your time.
>
> regards
> Johan
>
>
>
> --
> 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/52F9FACB.5010108%40gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
MLHIM VIP Signup: http://goo.gl/22B0U

Timothy Cook, MSc   +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook

-- 
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%2B%3DOU3XPbDZZE7e1SYm8e2cpDfWo%3DM3tviwgTXPHkyUmzQj83w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


import

2014-02-11 Thread Johan Hendriks

Hello all.

I have a little question, maybe a little stupid but non the less it 
keeps me busy. :-)


I want to start making some web based apps as a hobby project.
I have no coding experience other then some basic shell scripting to get 
some daily routine jobs done on my FreeBSD servers.
The first struggle I had to take is the programming language, I looked 
at PHP and python, and I think my best option is Python, and with python 
comes Django.
So the last weeks i have been doing some searches on google and view a 
lot of tutorial video's how to start with django.


One thing that always comes back is the import part like below

from  django.http  import  HttpResponse

And here comes my question, where and how do you know what you need to 
import.
What is the best way to learn al these imports? , and is there a quick 
way to find the imports you need?


Thank you for your time.

regards
Johan



--
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/52F9FACB.5010108%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.