Re: django.contrib.auth and username's field size

2013-07-25 Thread Mike Dewhirst

On 26/07/2013 8:12am, Jonathan Baker wrote:

Ideally your Django project would contain many different applications,
which in turn have their own models.py module. I've yet to work on a
project large enough to warrant that i try this, so what I'm about to say
is completely untested... but I would think that creating a 'models'
directory inside of an app (instead of models.py), creating+populating
various .py modules that will constitute your model classes, and then
creating an __init__.py that imports the previously created model classes
would work. Something like:

project/
 app1/
 models/
 __init__.py (would import classes from models1.py and
models2.py)
 models1.py
 models2.py
 app2/
 models.py


See also app_label ...

https://docs.djangoproject.com/en/1.5/ref/models/options/#app-label



As for your second question, I tend to try my best to keep my views slim,
and let my models grow as they need too (containing all the business
logic). I can't speak for others, but when my views start getting too large
it's usually a sign to me that something could be designed better, but
large and complex models are common on my end.

Hope this helps,
Jonathan


On Thu, Jul 25, 2013 at 4:03 PM, Ivan Voras  wrote:


Thanks!

While I have a newbie thread going, let me ask you one more thing: I like
the concepts behind Django models, but what are the best practices for
organizing models into files for large-ish scale projects? Keeping all
model classes in a single models.py file is not scalable, and I'd rather
have a file-per-class situation, at least for some of them. The reason for
this is that I suspect the models will grow functionalities encapsulating
more complex behaviour than simple database operations.

Or is the best practice to keep models simple - basically a database
schema description - and create new, more complex classes containing
specific code?


Simple is good if it works for you. I put as much behaviour as possible 
in the models because that's where it belongs. I also document behaviour 
generously in help_text. Whenever possible I refactor common stuff out 
and either import it or inherit it. It is all just Python.


Look at https://django.2scoops.org/ for best practices ...





On Thursday, 25 July 2013 23:36:49 UTC+2, jondbaker wrote:


Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I
believe would solve your problem: https://docs.**
djangoproject.com/en/dev/**topics/auth/customizing/#**
specifying-a-custom-user-model


On Thu, Jul 25, 2013 at 3:25 PM, Ivan Voras  wrote:


Hello,

I'm new to Django, and still finding out how it all fits together. I've
seen django.contrib.auth and I'm wondering - is it a common practice to
actually use it as a basis for application authentication?

If so, I have a question: the username field as defined (30 characters)
is too short for me. Is there an easy way to override the default field
size?

What I'm actually trying to do is this: I'm thinking of using e-mail
addresses for user names, with the "username" field holding a lowercase
address (to make use of the unique index) and the "email" field will store
the address as entered by the user. The default length of the "email" field
is good enough (75) but the "username" field is too short.

  --
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
.
For more options, visit 
https://groups.google.com/**groups/opt_out
.







--
Jonathan D. Baker
Developer
http://jonathandbaker.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.
For more options, visit https://groups.google.com/groups/opt_out.









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




Re: cannot import name current_datetime

2013-07-25 Thread Mike Dewhirst

On 25/07/2013 5:18pm, jacob poke wrote:

Djangobook on the internet.  Quick beginners question:  In Chapter 3, where

I am looking at a dynamic webpage in the 2nd example I am running into some
problems with the current_datetime function I am trying to set up. When, in
views.py I insert the "datetime.datetime.now()" statement and "import
current_datetime" into my urls.py file, I get the following error message
when I try to call up the webpage via runserver.  It seems like my pure
python script is not being picked up by the server:

"ImportError cannot import name current_datetime".


You need to look at a Python tutorial about namespaces to understand 
what is happening.


The error is saying you have tried to import something which cannot be 
found. There are two solutions:


1. tell Python where to look for current_datetime

2. put the current_datetime function near the top of the file in which 
you are calling it.


It is good practice to keep your main program files relatively 
uncluttered and put such "utility" functions somewhere they can be 
called by lots of different modules. This makes 1. above the preferred 
solution.


from .date_utilities import current_datetime

... where the dot indicates that date_utilities.py is in the same 
directory as the file within which you make the call. Otherwise, you 
need to put date_utilities.py in directory which is on the Python path. 
For example:


from utils.date_utilities import current_datetime

hth

Mike







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




Re: django.contrib.auth and username's field size

2013-07-25 Thread Jonathan Baker
Ideally your Django project would contain many different applications,
which in turn have their own models.py module. I've yet to work on a
project large enough to warrant that i try this, so what I'm about to say
is completely untested... but I would think that creating a 'models'
directory inside of an app (instead of models.py), creating+populating
various .py modules that will constitute your model classes, and then
creating an __init__.py that imports the previously created model classes
would work. Something like:

project/
app1/
models/
__init__.py (would import classes from models1.py and
models2.py)
models1.py
models2.py
app2/
models.py

As for your second question, I tend to try my best to keep my views slim,
and let my models grow as they need too (containing all the business
logic). I can't speak for others, but when my views start getting too large
it's usually a sign to me that something could be designed better, but
large and complex models are common on my end.

Hope this helps,
Jonathan


On Thu, Jul 25, 2013 at 4:03 PM, Ivan Voras  wrote:

> Thanks!
>
> While I have a newbie thread going, let me ask you one more thing: I like
> the concepts behind Django models, but what are the best practices for
> organizing models into files for large-ish scale projects? Keeping all
> model classes in a single models.py file is not scalable, and I'd rather
> have a file-per-class situation, at least for some of them. The reason for
> this is that I suspect the models will grow functionalities encapsulating
> more complex behaviour than simple database operations.
>
> Or is the best practice to keep models simple - basically a database
> schema description - and create new, more complex classes containing
> specific code?
>
>
>
> On Thursday, 25 July 2013 23:36:49 UTC+2, jondbaker wrote:
>
>> Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I
>> believe would solve your problem: https://docs.**
>> djangoproject.com/en/dev/**topics/auth/customizing/#**
>> specifying-a-custom-user-model
>>
>>
>> On Thu, Jul 25, 2013 at 3:25 PM, Ivan Voras  wrote:
>>
>>> Hello,
>>>
>>> I'm new to Django, and still finding out how it all fits together. I've
>>> seen django.contrib.auth and I'm wondering - is it a common practice to
>>> actually use it as a basis for application authentication?
>>>
>>> If so, I have a question: the username field as defined (30 characters)
>>> is too short for me. Is there an easy way to override the default field
>>> size?
>>>
>>> What I'm actually trying to do is this: I'm thinking of using e-mail
>>> addresses for user names, with the "username" field holding a lowercase
>>> address (to make use of the unique index) and the "email" field will store
>>> the address as entered by the user. The default length of the "email" field
>>> is good enough (75) but the "username" field is too short.
>>>
>>>  --
>>> 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
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Jonathan D. Baker
>> Developer
>> http://jonathandbaker.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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.contrib.auth and username's field size

2013-07-25 Thread Ivan Voras
Thanks!

While I have a newbie thread going, let me ask you one more thing: I like 
the concepts behind Django models, but what are the best practices for 
organizing models into files for large-ish scale projects? Keeping all 
model classes in a single models.py file is not scalable, and I'd rather 
have a file-per-class situation, at least for some of them. The reason for 
this is that I suspect the models will grow functionalities encapsulating 
more complex behaviour than simple database operations. 

Or is the best practice to keep models simple - basically a database schema 
description - and create new, more complex classes containing specific code?



On Thursday, 25 July 2013 23:36:49 UTC+2, jondbaker wrote:
>
> Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I 
> believe would solve your problem: 
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>
>
> On Thu, Jul 25, 2013 at 3:25 PM, Ivan Voras  > wrote:
>
>> Hello,
>>
>> I'm new to Django, and still finding out how it all fits together. I've 
>> seen django.contrib.auth and I'm wondering - is it a common practice to 
>> actually use it as a basis for application authentication?
>>
>> If so, I have a question: the username field as defined (30 characters) 
>> is too short for me. Is there an easy way to override the default field 
>> size?
>>
>> What I'm actually trying to do is this: I'm thinking of using e-mail 
>> addresses for user names, with the "username" field holding a lowercase 
>> address (to make use of the unique index) and the "email" field will store 
>> the address as entered by the user. The default length of the "email" field 
>> is good enough (75) but the "username" field is too short.
>>
>>  -- 
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
> Jonathan D. Baker
> Developer
> http://jonathandbaker.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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django.contrib.auth and username's field size

2013-07-25 Thread Jonathan Baker
Hi Ivan, and welcome. Django >= 1.5 features custom User models, which I
believe would solve your problem:
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model


On Thu, Jul 25, 2013 at 3:25 PM, Ivan Voras  wrote:

> Hello,
>
> I'm new to Django, and still finding out how it all fits together. I've
> seen django.contrib.auth and I'm wondering - is it a common practice to
> actually use it as a basis for application authentication?
>
> If so, I have a question: the username field as defined (30 characters) is
> too short for me. Is there an easy way to override the default field size?
>
> What I'm actually trying to do is this: I'm thinking of using e-mail
> addresses for user names, with the "username" field holding a lowercase
> address (to make use of the unique index) and the "email" field will store
> the address as entered by the user. The default length of the "email" field
> is good enough (75) but the "username" field is too short.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.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.
For more options, visit https://groups.google.com/groups/opt_out.




django.contrib.auth and username's field size

2013-07-25 Thread Ivan Voras
Hello,

I'm new to Django, and still finding out how it all fits together. I've 
seen django.contrib.auth and I'm wondering - is it a common practice to 
actually use it as a basis for application authentication?

If so, I have a question: the username field as defined (30 characters) is 
too short for me. Is there an easy way to override the default field size?

What I'm actually trying to do is this: I'm thinking of using e-mail 
addresses for user names, with the "username" field holding a lowercase 
address (to make use of the unique index) and the "email" field will store 
the address as entered by the user. The default length of the "email" field 
is good enough (75) but the "username" field is too short.

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




Re: Should anyone be using Django 1.3 in production at this point?

2013-07-25 Thread Bjorn Tipling
Thank you for the reply. Upgrading as soon as possible makes the most sense.

On Wednesday, July 24, 2013 12:03:49 PM UTC-7, Bjorn Tipling wrote:
>
> The django downloads section says versions of Django 1.3 are no longer 
> supported with bug and security fixes. Obviously nobody ought to start a 
> new project with Django 1.3, but is it critical to update? Since the 
> release updates are broken down by version, it isn't clear to me if any of 
> the issues that affect 1.4 or 1.5 also affect 1.3.
>
> https://docs.djangoproject.com/en/1.3/releases/
>
> I also do not see any security fixes since the 1.3 deprecation.
>
> Thanks,
>
> Bjorn
>

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




Re: or-ing to QuerySets turns INNER into LEFT OUTER joins?

2013-07-25 Thread Tom Evans
On Thu, Jul 25, 2013 at 4:42 PM, Carsten Fuchs  wrote:
> Hi Tom,
>
> thank you very much for your reply!
>
> Am 25.07.2013 12:17, schrieb Tom Evans:
>
>> Isn't this to be expected? You've asked Django to OR the querysets.
>> This means that you are looking for tuples from STAFF where either the
>> join+conditions to ERFASST match or the join+conditions to
>> STAFF_BEREICHE match. If these joins were performed with an INNER
>> JOIN, then the query would only include tuples from STAFF that match
>> both joins and conditions.
>
>
> Well, I must foreclose that I'm by no means an SQL expert, and rather
> consider myself as a beginner -- but won't the joins augment the STAFF table
> independently of each other?
>
> That is, if I understand things correctly, the join types INNER vs. LEFT
> OUTER are mostly about the handling of NULL values on the "other" side of
> the relation, but as only non-NULL values are involved here, I'd expect a
> query to provide the same augmented table no matter if INNER or LEFT OUTER
> joins are used.

This query is all about joining tuples from the STAFF table to the
other two tables. If the joins to both ERFASST and STAFF_BEREICHE are
inner joins, then the only tuples from STAFF under consideration are
ones which have valid references to both tables. This is not the same
as OR'ing two independent queries.

Now, if your data obeys that criteria, then there would be no
difference between the two results, but the meaning of the queries are
very different. With inner joins, the query means "Find me staff that
have department 1, AND have logs* in the specified date range from
department 1", but with outer joins the query means "Find me staff
that have either department 1, or have logs from the specified date
range from department 1".

Put another way, if you AND'ed the Q objects instead, your query would
be the fast one you are looking for with inner joins throughout, but
you would not see users who do not have log entries, nor users with
log entries not in departments - but those conditions sound like an
impossible situation given your models.

As an example you can play around with, pick one user who has log
entries, and remove all their departments from STAFF_BEREICHE. This
user should then be found with the slow query with LEFT OUTER joins,
but not with the fast query with INNER joins - they are excluded due
to the INNER join to STAFF_BEREICHE fails for that tuple in STAFF, and
so it is not considered from that point onwards.

Cheers

Tom

* Erfasst is meaning logging here, right? Reaching the limits of my German :)

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




Re: server error (500)

2013-07-25 Thread Charly Román
You need to add a app, the error is clear, yo don't have anything to show.

2013/7/25 Oliver :
> Thanks Evans.  I'm new to Django so Im trying to learn faster on setting up
> my project or apps.  I appreciate the help for pointing out what I'm
> missing.
>
> Thanks so much.  I'll get to work now :)
>
>
>
>
> On Thursday, July 25, 2013 9:36:53 AM UTC-4, Tom Evans wrote:
>>
>> On Thu, Jul 25, 2013 at 2:32 PM, Oliver  wrote:
>> > I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found
>> > the
>> > requested URL / not found on the server"
>>
>> Yes. You will need to add some views and URLs to the server if you
>> want to see things when you go to URLs.
>>
>> When you still had debug=True, Django spits out the "It works…"
>> message, which ends with this sentence:
>>
>> "You're seeing this message because you have DEBUG = True in your
>> Django settings file and you haven't configured any URLs. Get to
>> work!"
>>
>> Get to it!
>>
>> Cheers
>>
>> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: or-ing to QuerySets turns INNER into LEFT OUTER joins?

2013-07-25 Thread Carsten Fuchs

Hi Tom,

thank you very much for your reply!

Am 25.07.2013 12:17, schrieb Tom Evans:

Isn't this to be expected? You've asked Django to OR the querysets.
This means that you are looking for tuples from STAFF where either the
join+conditions to ERFASST match or the join+conditions to
STAFF_BEREICHE match. If these joins were performed with an INNER
JOIN, then the query would only include tuples from STAFF that match
both joins and conditions.


Well, I must foreclose that I'm by no means an SQL expert, and rather 
consider myself as a beginner -- but won't the joins augment the STAFF 
table independently of each other?


That is, if I understand things correctly, the join types INNER vs. LEFT 
OUTER are mostly about the handling of NULL values on the "other" side 
of the relation, but as only non-NULL values are involved here, I'd 
expect a query to provide the same augmented table no matter if INNER or 
LEFT OUTER joins are used.


(And vice versa, as the corresponding Django foreign key fields are 
defined as non-NULL, too, I thought that Django would use INNER joins in 
the first place.)


The OR in the WHERE clause then acts "independently" on the resulting 
augmented table.


When I try this experimentally with the queries Q_a and Q_b from my 
original post, where Q_a and Q_b yield different result tuples, e.g.


A B C D E

for Q_a and

  D E F G

for Q_b, then *both* the query Q_a_or_b with the original LEFT OUTER 
joins, as well as an edited query where INNER join is used instead, 
yield the same result tuple set


A B C D E F G


Or is my understanding of SQL basics that wrong?

Best regards,
Carsten



--
Dipl.-Inf. Carsten Fuchs

Carsten Fuchs Software
Industriegebiet 3, c/o Rofu, 55768 Hoppstädten-Weiersbach, Germany
Internet: http://www.cafu.de | E-Mail: i...@cafu.de

Cafu - the open-source game and graphics engine for multiplayer 3D action

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




Re: server error (500)

2013-07-25 Thread Oliver
Thanks Evans.  I'm new to Django so Im trying to learn faster on setting up 
my project or apps.  I appreciate the help for pointing out what I'm 
missing.

Thanks so much.  I'll get to work now :)




On Thursday, July 25, 2013 9:36:53 AM UTC-4, Tom Evans wrote:
>
> On Thu, Jul 25, 2013 at 2:32 PM, Oliver  
> wrote: 
> > I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found 
>  the 
> > requested URL / not found on the server" 
>
> Yes. You will need to add some views and URLs to the server if you 
> want to see things when you go to URLs. 
>
> When you still had debug=True, Django spits out the "It works…" 
> message, which ends with this sentence: 
>
> "You're seeing this message because you have DEBUG = True in your 
> Django settings file and you haven't configured any URLs. Get to 
> work!" 
>
> Get to it! 
>
> Cheers 
>
> Tom 
>

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




Re: server error (500)

2013-07-25 Thread Oliver
I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found  the 
requested URL / not found on the server"







On Thursday, July 25, 2013 8:19:13 AM UTC-4, Oliver wrote:
>
> when you change Debug=False
>
>
>
>
> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>
>> The error log doesn't show anything. In which step following the 
>> documentation are you getting this error? 
>>
>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver  wrote: 
>> > my environment is in my local pc or machine so its a development 
>> machine. 
>> > 
>> > I tried that empy field in allowed_host. 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>> >> 
>> >> use this in your settings.py 
>> >> ALLOWED_HOSTS = [] 
>> >> 
>> >> where are you envirioment? you app there in production or development? 
>> >> Em 25/07/2013 04:35, "victoria"  escreveu: 
>> >> > 
>> >> > Hi, 
>> >> 
>> >> > 
>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote: 
>> >> > > If I set DEBUG = False, I get this 
>> >> > > 
>> >> > > It worked! 
>> >> > > 
>> >> > > Congratulations on your first Django-powered page. 
>> >> > > 
>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>> do 
>> >> > > next: 
>> >> > > 
>> >> > > If you plan to use a database, edit the DATABASES setting in 
>> >> > > mysite/settings.py. 
>> >> > > Start your first app by running python manage.py startapp 
>> [appname]. 
>> >> > > 
>> >> > > You're seeing this message because you have DEBUG = True in your 
>> >> > > Django 
>> >> > > settings file and you haven't configured any URLs. Get to work! 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > If I set it to true, I get the server error (500).  I created the 
>> >> > > template 
>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>> >> > > 
>> >> > 
>> >> > Can  you check the apache error log to see if you can find more 
>> >> > information there? It is located in 
>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>> >> > 
>> >> > 
>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>> >> > > following the 
>> >> > > tutorials at Django website documentation. 
>> >> > > 
>> >> > > I appreciate any help. 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > # Django settings for mysite project. 
>> >> > > 
>> >> > > DEBUG = True 
>> >> > > TEMPLATE_DEBUG = DEBUG 
>> >> > > 
>> >> > > ADMINS = ( 
>> >> > > # ('mysite', 'em...@email.com'), 
>> >> 
>> >> > > ) 
>> >> > > 
>> >> > > MANAGERS = ADMINS 
>> >> > > 
>> >> > > DATABASES = { 
>> >> > > 'default': { 
>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>> >> > > 'postgresql_psycopg2', 
>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>> >> > > 'NAME': 'mysitedb',  # Or path to 
>> database 
>> >> > > file 
>> >> > > if using sqlite3. 
>> >> > > # The following settings are not used with sqlite3: 
>> >> > > 'USER': 'root', 
>> >> > > 'PASSWORD': '', 
>> >> > > 'HOST': '',  # Empty for localhost 
>> through 
>> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
>> >> > > 'PORT': '',  # Set to empty string for 
>> >> > > default. 
>> >> > > } 
>> >> > > } 
>> >> > > 
>> >> > > # Hosts/domain names that are valid for this site; required if 
>> DEBUG 
>> >> > > is 
>> >> > > False 
>> >> > > # See 
>> >> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
>> >> > > ALLOWED_HOSTS = ['localhost'] 
>> >> > > 
>> >> > > # Local time zone for this installation. Choices can be found 
>> here: 
>> >> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
>> >> > > # although not all choices may be available on all operating 
>> systems. 
>> >> > > # In a Windows environment this must be set to your system time 
>> zone. 
>> >> > > TIME_ZONE = 'EST' 
>> >> > > 
>> >> > > # Language code for this installation. All choices can be found 
>> here: 
>> >> > > # http://www.i18nguy.com/unicode/language-identifiers.html 
>> >> > > LANGUAGE_CODE = 'en-us' 
>> >> > > 
>> >> > > SITE_ID = 1 
>> >> > > 
>> >> > > # If you set this to False, Django will make some optimizations so 
>> as 
>> >> > > not 
>> >> > > # to load the internationalization machinery. 
>> >> > > USE_I18N = True 
>> >> > > 
>> >> > > # If you set this to False, Django will not format dates, numbers 
>> and 
>> >> > > # calendars according to the current locale. 
>> >> > > USE_L10N = True 
>> >> > > 
>> >> > > # If you set this to False, Django will not use timezone-aware 
>> >> > > datetimes. 
>> >> > > USE_TZ = True 
>> >> > > 
>> >> > > # Absolute filesystem path to the directory that will hold 
>> >> > > user-uploaded 
>> >> > > files. 
>> >> > > # Example: "/var/www/example.com/media/" 
>> >> > > MEDIA_ROOT = '' 
>> >> > > 

Re: server error (500)

2013-07-25 Thread Tom Evans
On Thu, Jul 25, 2013 at 2:32 PM, Oliver  wrote:
> I change the ALLOWED_host = ['*'].   Now I'm getting this "Not Found  the
> requested URL / not found on the server"

Yes. You will need to add some views and URLs to the server if you
want to see things when you go to URLs.

When you still had debug=True, Django spits out the "It works…"
message, which ends with this sentence:

"You're seeing this message because you have DEBUG = True in your
Django settings file and you haven't configured any URLs. Get to
work!"

Get to it!

Cheers

Tom

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




Re: server error (500)

2013-07-25 Thread Oliver
I did allowed host to 0.0.0.0.  It's back to server error(500)

On Thursday, July 25, 2013 9:32:45 AM UTC-4, Christian Erhardt wrote:
>
> Set Allowed Hosts to 0.0.0.0
>
> Am Donnerstag, 25. Juli 2013 14:19:13 UTC+2 schrieb Oliver:
>>
>> when you change Debug=False
>>
>>
>>
>>
>> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>>
>>> The error log doesn't show anything. In which step following the 
>>> documentation are you getting this error? 
>>>
>>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver  wrote: 
>>> > my environment is in my local pc or machine so its a development 
>>> machine. 
>>> > 
>>> > I tried that empy field in allowed_host. 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>>> >> 
>>> >> use this in your settings.py 
>>> >> ALLOWED_HOSTS = [] 
>>> >> 
>>> >> where are you envirioment? you app there in production or 
>>> development? 
>>> >> Em 25/07/2013 04:35, "victoria"  escreveu: 
>>> >> > 
>>> >> > Hi, 
>>> >> 
>>> >> > 
>>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote: 
>>> >> > > If I set DEBUG = False, I get this 
>>> >> > > 
>>> >> > > It worked! 
>>> >> > > 
>>> >> > > Congratulations on your first Django-powered page. 
>>> >> > > 
>>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>>> do 
>>> >> > > next: 
>>> >> > > 
>>> >> > > If you plan to use a database, edit the DATABASES setting in 
>>> >> > > mysite/settings.py. 
>>> >> > > Start your first app by running python manage.py startapp 
>>> [appname]. 
>>> >> > > 
>>> >> > > You're seeing this message because you have DEBUG = True in your 
>>> >> > > Django 
>>> >> > > settings file and you haven't configured any URLs. Get to work! 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > If I set it to true, I get the server error (500).  I created the 
>>> >> > > template 
>>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>>> >> > > 
>>> >> > 
>>> >> > Can  you check the apache error log to see if you can find more 
>>> >> > information there? It is located in 
>>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>>> >> > 
>>> >> > 
>>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>>> >> > > following the 
>>> >> > > tutorials at Django website documentation. 
>>> >> > > 
>>> >> > > I appreciate any help. 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > 
>>> >> > > # Django settings for mysite project. 
>>> >> > > 
>>> >> > > DEBUG = True 
>>> >> > > TEMPLATE_DEBUG = DEBUG 
>>> >> > > 
>>> >> > > ADMINS = ( 
>>> >> > > # ('mysite', 'em...@email.com'), 
>>> >> 
>>> >> > > ) 
>>> >> > > 
>>> >> > > MANAGERS = ADMINS 
>>> >> > > 
>>> >> > > DATABASES = { 
>>> >> > > 'default': { 
>>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>>> >> > > 'postgresql_psycopg2', 
>>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>>> >> > > 'NAME': 'mysitedb',  # Or path to 
>>> database 
>>> >> > > file 
>>> >> > > if using sqlite3. 
>>> >> > > # The following settings are not used with sqlite3: 
>>> >> > > 'USER': 'root', 
>>> >> > > 'PASSWORD': '', 
>>> >> > > 'HOST': '',  # Empty for localhost 
>>> through 
>>> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
>>> >> > > 'PORT': '',  # Set to empty string 
>>> for 
>>> >> > > default. 
>>> >> > > } 
>>> >> > > } 
>>> >> > > 
>>> >> > > # Hosts/domain names that are valid for this site; required if 
>>> DEBUG 
>>> >> > > is 
>>> >> > > False 
>>> >> > > # See 
>>> >> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
>>> >> > > ALLOWED_HOSTS = ['localhost'] 
>>> >> > > 
>>> >> > > # Local time zone for this installation. Choices can be found 
>>> here: 
>>> >> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
>>> >> > > # although not all choices may be available on all operating 
>>> systems. 
>>> >> > > # In a Windows environment this must be set to your system time 
>>> zone. 
>>> >> > > TIME_ZONE = 'EST' 
>>> >> > > 
>>> >> > > # Language code for this installation. All choices can be found 
>>> here: 
>>> >> > > # http://www.i18nguy.com/unicode/language-identifiers.html 
>>> >> > > LANGUAGE_CODE = 'en-us' 
>>> >> > > 
>>> >> > > SITE_ID = 1 
>>> >> > > 
>>> >> > > # If you set this to False, Django will make some optimizations 
>>> so as 
>>> >> > > not 
>>> >> > > # to load the internationalization machinery. 
>>> >> > > USE_I18N = True 
>>> >> > > 
>>> >> > > # If you set this to False, Django will not format dates, numbers 
>>> and 
>>> >> > > # calendars according to the current locale. 
>>> >> > > USE_L10N = True 
>>> >> > > 
>>> >> > > # If you set this to False, Django will not use timezone-aware 
>>> >> > > datetimes. 
>>> >> > > USE_TZ = True 
>>> >> > 

Re: server error (500)

2013-07-25 Thread Christian Erhardt
Set Allowed Hosts to 0.0.0.0

Am Donnerstag, 25. Juli 2013 14:19:13 UTC+2 schrieb Oliver:
>
> when you change Debug=False
>
>
>
>
> On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>>
>> The error log doesn't show anything. In which step following the 
>> documentation are you getting this error? 
>>
>> On Thu, Jul 25, 2013 at 12:09 PM, Oliver  wrote: 
>> > my environment is in my local pc or machine so its a development 
>> machine. 
>> > 
>> > I tried that empy field in allowed_host. 
>> > 
>> > 
>> > 
>> > 
>> > 
>> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
>> >> 
>> >> use this in your settings.py 
>> >> ALLOWED_HOSTS = [] 
>> >> 
>> >> where are you envirioment? you app there in production or development? 
>> >> Em 25/07/2013 04:35, "victoria"  escreveu: 
>> >> > 
>> >> > Hi, 
>> >> 
>> >> > 
>> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote: 
>> >> > > If I set DEBUG = False, I get this 
>> >> > > 
>> >> > > It worked! 
>> >> > > 
>> >> > > Congratulations on your first Django-powered page. 
>> >> > > 
>> >> > > Of course, you haven't actually done any work yet. Here's what to 
>> do 
>> >> > > next: 
>> >> > > 
>> >> > > If you plan to use a database, edit the DATABASES setting in 
>> >> > > mysite/settings.py. 
>> >> > > Start your first app by running python manage.py startapp 
>> [appname]. 
>> >> > > 
>> >> > > You're seeing this message because you have DEBUG = True in your 
>> >> > > Django 
>> >> > > settings file and you haven't configured any URLs. Get to work! 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > If I set it to true, I get the server error (500).  I created the 
>> >> > > template 
>> >> > > and static folder inside mysite folder.  Here is my setting.py. 
>> >> > > 
>> >> > 
>> >> > Can  you check the apache error log to see if you can find more 
>> >> > information there? It is located in 
>> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>> >> > 
>> >> > 
>> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
>> >> > > following the 
>> >> > > tutorials at Django website documentation. 
>> >> > > 
>> >> > > I appreciate any help. 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > 
>> >> > > # Django settings for mysite project. 
>> >> > > 
>> >> > > DEBUG = True 
>> >> > > TEMPLATE_DEBUG = DEBUG 
>> >> > > 
>> >> > > ADMINS = ( 
>> >> > > # ('mysite', 'em...@email.com'), 
>> >> 
>> >> > > ) 
>> >> > > 
>> >> > > MANAGERS = ADMINS 
>> >> > > 
>> >> > > DATABASES = { 
>> >> > > 'default': { 
>> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
>> >> > > 'postgresql_psycopg2', 
>> >> > > 'mysql', 'sqlite3' or 'oracle'. 
>> >> > > 'NAME': 'mysitedb',  # Or path to 
>> database 
>> >> > > file 
>> >> > > if using sqlite3. 
>> >> > > # The following settings are not used with sqlite3: 
>> >> > > 'USER': 'root', 
>> >> > > 'PASSWORD': '', 
>> >> > > 'HOST': '',  # Empty for localhost 
>> through 
>> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
>> >> > > 'PORT': '',  # Set to empty string for 
>> >> > > default. 
>> >> > > } 
>> >> > > } 
>> >> > > 
>> >> > > # Hosts/domain names that are valid for this site; required if 
>> DEBUG 
>> >> > > is 
>> >> > > False 
>> >> > > # See 
>> >> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
>> >> > > ALLOWED_HOSTS = ['localhost'] 
>> >> > > 
>> >> > > # Local time zone for this installation. Choices can be found 
>> here: 
>> >> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
>> >> > > # although not all choices may be available on all operating 
>> systems. 
>> >> > > # In a Windows environment this must be set to your system time 
>> zone. 
>> >> > > TIME_ZONE = 'EST' 
>> >> > > 
>> >> > > # Language code for this installation. All choices can be found 
>> here: 
>> >> > > # http://www.i18nguy.com/unicode/language-identifiers.html 
>> >> > > LANGUAGE_CODE = 'en-us' 
>> >> > > 
>> >> > > SITE_ID = 1 
>> >> > > 
>> >> > > # If you set this to False, Django will make some optimizations so 
>> as 
>> >> > > not 
>> >> > > # to load the internationalization machinery. 
>> >> > > USE_I18N = True 
>> >> > > 
>> >> > > # If you set this to False, Django will not format dates, numbers 
>> and 
>> >> > > # calendars according to the current locale. 
>> >> > > USE_L10N = True 
>> >> > > 
>> >> > > # If you set this to False, Django will not use timezone-aware 
>> >> > > datetimes. 
>> >> > > USE_TZ = True 
>> >> > > 
>> >> > > # Absolute filesystem path to the directory that will hold 
>> >> > > user-uploaded 
>> >> > > files. 
>> >> > > # Example: "/var/www/example.com/media/" 
>> >> > > MEDIA_ROOT = '' 
>> >> > > 
>> >> > > # URL that handles the media served from MEDIA_ROOT. Make sure to 
>> use 
>> >> > 

Html templates editor autocomplete Eclipse(PyDev)

2013-07-25 Thread Новак Бошков
I can't find any settings for Django editor in PyDev to possibly adjust 
autocompletion for html code. Now when I type there is no any suggestions 
for html code, I have to type every single tag. I've made .htmlfile by right 
click on project root->New->file and just named file template.html. How to 
get autocompletion here?

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




Re: server error (500)

2013-07-25 Thread Oliver
when you change Debug=False




On Thursday, July 25, 2013 8:12:14 AM UTC-4, victoria wrote:
>
> The error log doesn't show anything. In which step following the 
> documentation are you getting this error? 
>
> On Thu, Jul 25, 2013 at 12:09 PM, Oliver  
> wrote: 
> > my environment is in my local pc or machine so its a development 
> machine. 
> > 
> > I tried that empy field in allowed_host. 
> > 
> > 
> > 
> > 
> > 
> > On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote: 
> >> 
> >> use this in your settings.py 
> >> ALLOWED_HOSTS = [] 
> >> 
> >> where are you envirioment? you app there in production or development? 
> >> Em 25/07/2013 04:35, "victoria"  escreveu: 
> >> > 
> >> > Hi, 
> >> 
> >> > 
> >> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote: 
> >> > > If I set DEBUG = False, I get this 
> >> > > 
> >> > > It worked! 
> >> > > 
> >> > > Congratulations on your first Django-powered page. 
> >> > > 
> >> > > Of course, you haven't actually done any work yet. Here's what to 
> do 
> >> > > next: 
> >> > > 
> >> > > If you plan to use a database, edit the DATABASES setting in 
> >> > > mysite/settings.py. 
> >> > > Start your first app by running python manage.py startapp 
> [appname]. 
> >> > > 
> >> > > You're seeing this message because you have DEBUG = True in your 
> >> > > Django 
> >> > > settings file and you haven't configured any URLs. Get to work! 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > If I set it to true, I get the server error (500).  I created the 
> >> > > template 
> >> > > and static folder inside mysite folder.  Here is my setting.py. 
> >> > > 
> >> > 
> >> > Can  you check the apache error log to see if you can find more 
> >> > information there? It is located in 
> >> > C:\BitNami\djangostack-1.5.1-0\apache2\logs 
> >> > 
> >> > 
> >> > > I run the inspectdb and it went fine, no errors.   I'm new and 
> >> > > following the 
> >> > > tutorials at Django website documentation. 
> >> > > 
> >> > > I appreciate any help. 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > 
> >> > > # Django settings for mysite project. 
> >> > > 
> >> > > DEBUG = True 
> >> > > TEMPLATE_DEBUG = DEBUG 
> >> > > 
> >> > > ADMINS = ( 
> >> > > # ('mysite', 'em...@email.com'), 
> >> 
> >> > > ) 
> >> > > 
> >> > > MANAGERS = ADMINS 
> >> > > 
> >> > > DATABASES = { 
> >> > > 'default': { 
> >> > > 'ENGINE': 'django.db.backends.mysql', # Add 
> >> > > 'postgresql_psycopg2', 
> >> > > 'mysql', 'sqlite3' or 'oracle'. 
> >> > > 'NAME': 'mysitedb',  # Or path to 
> database 
> >> > > file 
> >> > > if using sqlite3. 
> >> > > # The following settings are not used with sqlite3: 
> >> > > 'USER': 'root', 
> >> > > 'PASSWORD': '', 
> >> > > 'HOST': '',  # Empty for localhost 
> through 
> >> > > domain sockets or '127.0.0.1' for localhost through TCP. 
> >> > > 'PORT': '',  # Set to empty string for 
> >> > > default. 
> >> > > } 
> >> > > } 
> >> > > 
> >> > > # Hosts/domain names that are valid for this site; required if 
> DEBUG 
> >> > > is 
> >> > > False 
> >> > > # See 
> >> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
> >> > > ALLOWED_HOSTS = ['localhost'] 
> >> > > 
> >> > > # Local time zone for this installation. Choices can be found here: 
> >> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
> >> > > # although not all choices may be available on all operating 
> systems. 
> >> > > # In a Windows environment this must be set to your system time 
> zone. 
> >> > > TIME_ZONE = 'EST' 
> >> > > 
> >> > > # Language code for this installation. All choices can be found 
> here: 
> >> > > # http://www.i18nguy.com/unicode/language-identifiers.html 
> >> > > LANGUAGE_CODE = 'en-us' 
> >> > > 
> >> > > SITE_ID = 1 
> >> > > 
> >> > > # If you set this to False, Django will make some optimizations so 
> as 
> >> > > not 
> >> > > # to load the internationalization machinery. 
> >> > > USE_I18N = True 
> >> > > 
> >> > > # If you set this to False, Django will not format dates, numbers 
> and 
> >> > > # calendars according to the current locale. 
> >> > > USE_L10N = True 
> >> > > 
> >> > > # If you set this to False, Django will not use timezone-aware 
> >> > > datetimes. 
> >> > > USE_TZ = True 
> >> > > 
> >> > > # Absolute filesystem path to the directory that will hold 
> >> > > user-uploaded 
> >> > > files. 
> >> > > # Example: "/var/www/example.com/media/" 
> >> > > MEDIA_ROOT = '' 
> >> > > 
> >> > > # URL that handles the media served from MEDIA_ROOT. Make sure to 
> use 
> >> > > a 
> >> > > # trailing slash. 
> >> > > # Examples: "http://example.com/media/;, "http://media.example.com/; 
>
> >> > > MEDIA_URL = '' 
> >> > > 
> >> > > # Absolute path to the directory static files should be collected 
> to. 
> >> > > # Don't 

Re: server error (500)

2013-07-25 Thread victoria
The error log doesn't show anything. In which step following the
documentation are you getting this error?

On Thu, Jul 25, 2013 at 12:09 PM, Oliver  wrote:
> my environment is in my local pc or machine so its a development machine.
>
> I tried that empy field in allowed_host.
>
>
>
>
>
> On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote:
>>
>> use this in your settings.py
>> ALLOWED_HOSTS = []
>>
>> where are you envirioment? you app there in production or development?
>> Em 25/07/2013 04:35, "victoria"  escreveu:
>> >
>> > Hi,
>>
>> >
>> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote:
>> > > If I set DEBUG = False, I get this
>> > >
>> > > It worked!
>> > >
>> > > Congratulations on your first Django-powered page.
>> > >
>> > > Of course, you haven't actually done any work yet. Here's what to do
>> > > next:
>> > >
>> > > If you plan to use a database, edit the DATABASES setting in
>> > > mysite/settings.py.
>> > > Start your first app by running python manage.py startapp [appname].
>> > >
>> > > You're seeing this message because you have DEBUG = True in your
>> > > Django
>> > > settings file and you haven't configured any URLs. Get to work!
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > If I set it to true, I get the server error (500).  I created the
>> > > template
>> > > and static folder inside mysite folder.  Here is my setting.py.
>> > >
>> >
>> > Can  you check the apache error log to see if you can find more
>> > information there? It is located in
>> > C:\BitNami\djangostack-1.5.1-0\apache2\logs
>> >
>> >
>> > > I run the inspectdb and it went fine, no errors.   I'm new and
>> > > following the
>> > > tutorials at Django website documentation.
>> > >
>> > > I appreciate any help.
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > # Django settings for mysite project.
>> > >
>> > > DEBUG = True
>> > > TEMPLATE_DEBUG = DEBUG
>> > >
>> > > ADMINS = (
>> > > # ('mysite', 'em...@email.com'),
>>
>> > > )
>> > >
>> > > MANAGERS = ADMINS
>> > >
>> > > DATABASES = {
>> > > 'default': {
>> > > 'ENGINE': 'django.db.backends.mysql', # Add
>> > > 'postgresql_psycopg2',
>> > > 'mysql', 'sqlite3' or 'oracle'.
>> > > 'NAME': 'mysitedb',  # Or path to database
>> > > file
>> > > if using sqlite3.
>> > > # The following settings are not used with sqlite3:
>> > > 'USER': 'root',
>> > > 'PASSWORD': '',
>> > > 'HOST': '',  # Empty for localhost through
>> > > domain sockets or '127.0.0.1' for localhost through TCP.
>> > > 'PORT': '',  # Set to empty string for
>> > > default.
>> > > }
>> > > }
>> > >
>> > > # Hosts/domain names that are valid for this site; required if DEBUG
>> > > is
>> > > False
>> > > # See
>> > > https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
>> > > ALLOWED_HOSTS = ['localhost']
>> > >
>> > > # Local time zone for this installation. Choices can be found here:
>> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
>> > > # although not all choices may be available on all operating systems.
>> > > # In a Windows environment this must be set to your system time zone.
>> > > TIME_ZONE = 'EST'
>> > >
>> > > # Language code for this installation. All choices can be found here:
>> > > # http://www.i18nguy.com/unicode/language-identifiers.html
>> > > LANGUAGE_CODE = 'en-us'
>> > >
>> > > SITE_ID = 1
>> > >
>> > > # If you set this to False, Django will make some optimizations so as
>> > > not
>> > > # to load the internationalization machinery.
>> > > USE_I18N = True
>> > >
>> > > # If you set this to False, Django will not format dates, numbers and
>> > > # calendars according to the current locale.
>> > > USE_L10N = True
>> > >
>> > > # If you set this to False, Django will not use timezone-aware
>> > > datetimes.
>> > > USE_TZ = True
>> > >
>> > > # Absolute filesystem path to the directory that will hold
>> > > user-uploaded
>> > > files.
>> > > # Example: "/var/www/example.com/media/"
>> > > MEDIA_ROOT = ''
>> > >
>> > > # URL that handles the media served from MEDIA_ROOT. Make sure to use
>> > > a
>> > > # trailing slash.
>> > > # Examples: "http://example.com/media/;, "http://media.example.com/;
>> > > MEDIA_URL = ''
>> > >
>> > > # Absolute path to the directory static files should be collected to.
>> > > # Don't put anything in this directory yourself; store your static
>> > > files
>> > > # in apps' "static/" subdirectories and in STATICFILES_DIRS.
>> > > # Example: "/var/www/example.com/static/"
>> > > #STATIC_ROOT = ''
>> > >
>> > > # URL prefix for static files.
>> > > # Example: "http://example.com/static/;, "http://static.example.com/;
>> > > STATIC_URL = '/static/'
>> > >
>> > > # Additional locations of static files
>> > > STATICFILES_DIRS = (
>> > > # Put strings here, like "/home/html/static" or
>> > > "C:/www/django/static".
>> > > # Always use 

Re: cannot import name current_datetime

2013-07-25 Thread jacob poke
hi - I am having the same problem to this and wondering if anyone found a 
solution? I dont really want to move on until i solve this. 

I have tried to change the text in the "Hello world" section but the 
browser continues to show "hello world". I also tried to develop a url 
similar to "Hello" using my name and this refused to work also. Any ideas?

On Thursday, 19 April 2012 04:47:12 UTC+10, asherakhet06 wrote:
>
> H all!
>
> I am fairly new to programming (went over LPTHW) and now going through the 
> Djangobook on the internet.  Quick beginners question:  In Chapter 3, where 
> I am looking at a dynamic webpage in the 2nd example I am running into some 
> problems with the current_datetime function I am trying to set up. When, in 
> views.py I insert the "datetime.datetime.now()" statement and "import 
> current_datetime" into my urls.py file, I get the following error message 
> when I try to call up the webpage via runserver.  It seems like my pure 
> python script is not being picked up by the server: 
>
> "ImportError cannot import name current_datetime".
>
> I know this is most likely an easy question for most of you, but it's been 
> a real puzzle for me to be honest:/  Anybody have any tips on how to solve 
> this error?  I know it is really important to be careful to copy EXACTLY as 
> mentioned in the programming book(s), so I am pretty sure I am not making 
> any spelling/character errors.  I am using windows btw.  I also have python 
> 2.7 and django 1.4 installed on my computer.  Anybody kind enough to help 
> me out?  Much appreciated!
>

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




[no subject]

2013-07-25 Thread J C
How are you? http://howtobuildrippedmuscles.com/avwr/from.php?J_C havea 
nice day!
 

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




Re: Unable to open database.

2013-07-25 Thread jk121960
You need path from root of file system so if home is in normal place off root, 
start with /home, also put db name as the last responder said



Gerald Klein DBA
contac...@geraldklein.com
www.geraldklein.com
geraldklein.wordpress.com
j...@zognet.com
708-599-0352

Arch/Gentoo Awesome, Ranger & Vim the coding triple threat.
Linux registered user #548580 




From: Nigel Legg
Sent: Thursday, July 25, 2013 5:43 AM
To: django-users@googlegroups.com




So should I put 

home/stats_portal/stats_/portal/myproject/myproject/database/sqlite3 ?
(settings.py in second myproject folder)
The database file name is sqlite3, this worked on Windows with no file 
extension, does Linux require it?






Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg





On 25 July 2013 11:18, Gerald Klein  wrote:


It looks fine but that depends on your folder structure but this is showing 
"myproject" off the root of the file system, is that correct?











On Thu, Jul 25, 2013 at 5:12 AM, Nigel Legg  wrote:







I have just moved my project from Windows to Linux.  I have maintained the 
folder structure, but am getting the message "Unable to open database file - 
sqlite3". 

Settings as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/myproject/database/sqlite3',  
'USER': '',
'PASSWORD': '',  
'HOST': '',
'PORT': '',
}
}
I'm very new at using Linux, is this a path definition error?







Cheers,Nigel



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





-- 



Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com

geraldklein.wordpress.com

j...@zognet.com

708-599-0352






Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580 





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


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

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




Re: Unable to open database.

2013-07-25 Thread Sergiy Khohlov
linux does not need extension
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Thu, Jul 25, 2013 at 1:43 PM, Nigel Legg  wrote:
> So should I put
> home/stats_portal/stats_/portal/myproject/myproject/database/sqlite3 ?
> (settings.py in second myproject folder)
> The database file name is sqlite3, this worked on Windows with no file
> extension, does Linux require it?
>
>
> Regards,
> Nigel Legg
> 07914 740972
> http://www.trevanianlegg.co.uk
> http://twitter.com/nigellegg
> http://uk.linkedin.com/in/nigellegg
>
>
>
> On 25 July 2013 11:18, Gerald Klein  wrote:
>>
>> It looks fine but that depends on your folder structure but this is
>> showing "myproject" off the root of the file system, is that correct?
>>
>>
>>
>>
>> On Thu, Jul 25, 2013 at 5:12 AM, Nigel Legg  wrote:
>>>
>>> I have just moved my project from Windows to Linux.  I have maintained
>>> the folder structure, but am getting the message "Unable to open database
>>> file - sqlite3".
>>> Settings as follows:
>>> DATABASES = {
>>> 'default': {
>>> 'ENGINE': 'django.db.backends.sqlite3',
>>> 'NAME': '/myproject/database/sqlite3',
>>> 'USER': '',
>>> 'PASSWORD': '',
>>> 'HOST': '',
>>> 'PORT': '',
>>> }
>>> }
>>> I'm very new at using Linux, is this a path definition error?
>>>
>>> Cheers,Nigel
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>
>>
>>
>>
>> --
>>
>> Gerald Klein DBA
>>
>> contac...@geraldklein.com
>>
>> www.geraldklein.com
>>
>> geraldklein.wordpress.com
>>
>> j...@zognet.com
>>
>> 708-599-0352
>>
>>
>> Arch Awesome, Ranger & Vim the coding triple threat.
>>
>> Linux registered user #548580
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

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




Re: Unable to open database.

2013-07-25 Thread Nigel Legg
So should I put
home/stats_portal/stats_/portal/myproject/myproject/database/sqlite3 ?
(settings.py in second myproject folder)
The database file name is sqlite3, this worked on Windows with no file
extension, does Linux require it?


Regards,
Nigel Legg
07914 740972
http://www.trevanianlegg.co.uk
http://twitter.com/nigellegg
http://uk.linkedin.com/in/nigellegg



On 25 July 2013 11:18, Gerald Klein  wrote:

> It looks fine but that depends on your folder structure but this is
> showing "myproject" off the root of the file system, is that correct?
>
>
>
>
> On Thu, Jul 25, 2013 at 5:12 AM, Nigel Legg  wrote:
>
>> I have just moved my project from Windows to Linux.  I have maintained
>> the folder structure, but am getting the message "Unable to open database
>> file - sqlite3".
>> Settings as follows:
>> DATABASES = {
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': '/myproject/database/sqlite3',
>> 'USER': '',
>> 'PASSWORD': '',
>> 'HOST': '',
>> 'PORT': '',
>> }
>> }
>> I'm very new at using Linux, is this a path definition error?
>>
>> Cheers,Nigel
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
>
> Gerald Klein DBA
>
> contac...@geraldklein.com
>
> www.geraldklein.com 
>
> geraldklein.wordpress.com
>
> j...@zognet.com
>
> 708-599-0352
>
>
> Arch Awesome, Ranger & Vim the coding triple threat.
>
> Linux registered user #548580
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: Unable to open database.

2013-07-25 Thread abhijeet shete
Hi Nigel

You have just given the path of db but you need to mention db name in
the DATABASES field of settings file.


>
> 'NAME': '/myproject/database/sqlite3',
>

  'NAME': '/myproject/database/sqlite3/example.db',

Regards.
Software Engineer | mquotient |  Mobile +91.9860219715

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




Re: Unable to open database.

2013-07-25 Thread Gerald Klein
It looks fine but that depends on your folder structure but this is showing
"myproject" off the root of the file system, is that correct?




On Thu, Jul 25, 2013 at 5:12 AM, Nigel Legg  wrote:

> I have just moved my project from Windows to Linux.  I have maintained the
> folder structure, but am getting the message "Unable to open database file
> - sqlite3".
> Settings as follows:
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': '/myproject/database/sqlite3',
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': '',
> 'PORT': '',
> }
> }
> I'm very new at using Linux, is this a path definition error?
>
> Cheers,Nigel
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

geraldklein.wordpress.com

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580

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




Re: or-ing to QuerySets turns INNER into LEFT OUTER joins?

2013-07-25 Thread Tom Evans
On Wed, Jul 24, 2013 at 5:39 PM, Carsten Fuchs  wrote:
> Hi all,
>
> Am 15.07.2013 17:41, schrieb Carsten Fuchs:
>
>> we have two queries/QuerySets Q_a and Q_b, each of which use INNER joins
>> in the generated SQL when evaluated individually.
>>
>> When I use a Q object to "OR" these two QuerySets, the INNER joins turn
>> into LEFT OUTER joins -- which in turn cause a huge performance drop
>> (several hundred times slower than with INNER joins).
>>
>> Why is this, and can I do anything against it at the Django ORM level?
>
>
>
> Can someone provide some help or insights into this, please?
>

Isn't this to be expected? You've asked Django to OR the querysets.
This means that you are looking for tuples from STAFF where either the
join+conditions to ERFASST match or the join+conditions to
STAFF_BEREICHE match. If these joins were performed with an INNER
JOIN, then the query would only include tuples from STAFF that match
both joins and conditions.

Cheers

Tom

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




Unable to open database.

2013-07-25 Thread Nigel Legg
I have just moved my project from Windows to Linux.  I have maintained the
folder structure, but am getting the message "Unable to open database file
- sqlite3".
Settings as follows:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/myproject/database/sqlite3',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
I'm very new at using Linux, is this a path definition error?

Cheers,Nigel

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




Re: server error (500)

2013-07-25 Thread Oliver
my environment is in my local pc or machine so its a development machine. 

I tried that empy field in allowed_host.  





On Thursday, July 25, 2013 5:43:02 AM UTC-4, Mário Idival wrote:
>
> use this in your settings.py
> ALLOWED_HOSTS = []
>
> where are you envirioment? you app there in production or development?
> Em 25/07/2013 04:35, "victoria"  
> escreveu:
> >
> > Hi,
> >
> > On Thu, Jul 25, 2013 at 4:30 AM, Oliver  
> wrote:
> > > If I set DEBUG = False, I get this
> > >
> > > It worked!
> > >
> > > Congratulations on your first Django-powered page.
> > >
> > > Of course, you haven't actually done any work yet. Here's what to do 
> next:
> > >
> > > If you plan to use a database, edit the DATABASES setting in
> > > mysite/settings.py.
> > > Start your first app by running python manage.py startapp [appname].
> > >
> > > You're seeing this message because you have DEBUG = True in your Django
> > > settings file and you haven't configured any URLs. Get to work!
> > >
> > >
> > >
> > >
> > >
> > > If I set it to true, I get the server error (500).  I created the 
> template
> > > and static folder inside mysite folder.  Here is my setting.py.
> > >
> >
> > Can  you check the apache error log to see if you can find more
> > information there? It is located in
> > C:\BitNami\djangostack-1.5.1-0\apache2\logs
> >
> >
> > > I run the inspectdb and it went fine, no errors.   I'm new and 
> following the
> > > tutorials at Django website documentation.
> > >
> > > I appreciate any help.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > # Django settings for mysite project.
> > >
> > > DEBUG = True
> > > TEMPLATE_DEBUG = DEBUG
> > >
> > > ADMINS = (
> > > # ('mysite', 'em...@email.com '),
> > > )
> > >
> > > MANAGERS = ADMINS
> > >
> > > DATABASES = {
> > > 'default': {
> > > 'ENGINE': 'django.db.backends.mysql', # Add 
> 'postgresql_psycopg2',
> > > 'mysql', 'sqlite3' or 'oracle'.
> > > 'NAME': 'mysitedb',  # Or path to database 
> file
> > > if using sqlite3.
> > > # The following settings are not used with sqlite3:
> > > 'USER': 'root',
> > > 'PASSWORD': '',
> > > 'HOST': '',  # Empty for localhost through
> > > domain sockets or '127.0.0.1' for localhost through TCP.
> > > 'PORT': '',  # Set to empty string for 
> default.
> > > }
> > > }
> > >
> > > # Hosts/domain names that are valid for this site; required if DEBUG is
> > > False
> > > # See 
> https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> > > ALLOWED_HOSTS = ['localhost']
> > >
> > > # Local time zone for this installation. Choices can be found here:
> > > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> > > # although not all choices may be available on all operating systems.
> > > # In a Windows environment this must be set to your system time zone.
> > > TIME_ZONE = 'EST'
> > >
> > > # Language code for this installation. All choices can be found here:
> > > # http://www.i18nguy.com/unicode/language-identifiers.html
> > > LANGUAGE_CODE = 'en-us'
> > >
> > > SITE_ID = 1
> > >
> > > # If you set this to False, Django will make some optimizations so as 
> not
> > > # to load the internationalization machinery.
> > > USE_I18N = True
> > >
> > > # If you set this to False, Django will not format dates, numbers and
> > > # calendars according to the current locale.
> > > USE_L10N = True
> > >
> > > # If you set this to False, Django will not use timezone-aware 
> datetimes.
> > > USE_TZ = True
> > >
> > > # Absolute filesystem path to the directory that will hold 
> user-uploaded
> > > files.
> > > # Example: "/var/www/example.com/media/"
> > > MEDIA_ROOT = ''
> > >
> > > # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> > > # trailing slash.
> > > # Examples: "http://example.com/media/;, "http://media.example.com/;
> > > MEDIA_URL = ''
> > >
> > > # Absolute path to the directory static files should be collected to.
> > > # Don't put anything in this directory yourself; store your static 
> files
> > > # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> > > # Example: "/var/www/example.com/static/"
> > > #STATIC_ROOT = ''
> > >
> > > # URL prefix for static files.
> > > # Example: "http://example.com/static/;, "http://static.example.com/;
> > > STATIC_URL = '/static/'
> > >
> > > # Additional locations of static files
> > > STATICFILES_DIRS = (
> > > # Put strings here, like "/home/html/static" or 
> "C:/www/django/static".
> > > # Always use forward slashes, even on Windows.
> > > # Don't forget to use absolute paths, not relative paths.
> > > )
> > >
> > > # 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',
> > > 

Re: server error (500)

2013-07-25 Thread Oliver
Hi Victoria,

attached is my the error log from the apache2

Thanks





On Thursday, July 25, 2013 3:35:00 AM UTC-4, victoria wrote:
>
> Hi, 
>
> On Thu, Jul 25, 2013 at 4:30 AM, Oliver  
> wrote: 
> > If I set DEBUG = False, I get this 
> > 
> > It worked! 
> > 
> > Congratulations on your first Django-powered page. 
> > 
> > Of course, you haven't actually done any work yet. Here's what to do 
> next: 
> > 
> > If you plan to use a database, edit the DATABASES setting in 
> > mysite/settings.py. 
> > Start your first app by running python manage.py startapp [appname]. 
> > 
> > You're seeing this message because you have DEBUG = True in your Django 
> > settings file and you haven't configured any URLs. Get to work! 
> > 
> > 
> > 
> > 
> > 
> > If I set it to true, I get the server error (500).  I created the 
> template 
> > and static folder inside mysite folder.  Here is my setting.py. 
> > 
>
> Can  you check the apache error log to see if you can find more 
> information there? It is located in 
> C:\BitNami\djangostack-1.5.1-0\apache2\logs 
>
>
> > I run the inspectdb and it went fine, no errors.   I'm new and following 
> the 
> > tutorials at Django website documentation. 
> > 
> > I appreciate any help. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > # Django settings for mysite project. 
> > 
> > DEBUG = True 
> > TEMPLATE_DEBUG = DEBUG 
> > 
> > ADMINS = ( 
> > # ('mysite', 'em...@email.com '), 
> > ) 
> > 
> > MANAGERS = ADMINS 
> > 
> > DATABASES = { 
> > 'default': { 
> > 'ENGINE': 'django.db.backends.mysql', # Add 
> 'postgresql_psycopg2', 
> > 'mysql', 'sqlite3' or 'oracle'. 
> > 'NAME': 'mysitedb',  # Or path to database 
> file 
> > if using sqlite3. 
> > # The following settings are not used with sqlite3: 
> > 'USER': 'root', 
> > 'PASSWORD': '', 
> > 'HOST': '',  # Empty for localhost through 
> > domain sockets or '127.0.0.1' for localhost through TCP. 
> > 'PORT': '',  # Set to empty string for 
> default. 
> > } 
> > } 
> > 
> > # Hosts/domain names that are valid for this site; required if DEBUG is 
> > False 
> > # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts 
> > ALLOWED_HOSTS = ['localhost'] 
> > 
> > # Local time zone for this installation. Choices can be found here: 
> > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name 
> > # although not all choices may be available on all operating systems. 
> > # In a Windows environment this must be set to your system time zone. 
> > TIME_ZONE = 'EST' 
> > 
> > # Language code for this installation. All choices can be found here: 
> > # http://www.i18nguy.com/unicode/language-identifiers.html 
> > LANGUAGE_CODE = 'en-us' 
> > 
> > SITE_ID = 1 
> > 
> > # If you set this to False, Django will make some optimizations so as 
> not 
> > # to load the internationalization machinery. 
> > USE_I18N = True 
> > 
> > # If you set this to False, Django will not format dates, numbers and 
> > # calendars according to the current locale. 
> > USE_L10N = True 
> > 
> > # If you set this to False, Django will not use timezone-aware 
> datetimes. 
> > USE_TZ = True 
> > 
> > # Absolute filesystem path to the directory that will hold user-uploaded 
> > files. 
> > # Example: "/var/www/example.com/media/" 
> > MEDIA_ROOT = '' 
> > 
> > # URL that handles the media served from MEDIA_ROOT. Make sure to use a 
> > # trailing slash. 
> > # Examples: "http://example.com/media/;, "http://media.example.com/; 
> > MEDIA_URL = '' 
> > 
> > # Absolute path to the directory static files should be collected to. 
> > # Don't put anything in this directory yourself; store your static files 
> > # in apps' "static/" subdirectories and in STATICFILES_DIRS. 
> > # Example: "/var/www/example.com/static/" 
> > #STATIC_ROOT = '' 
> > 
> > # URL prefix for static files. 
> > # Example: "http://example.com/static/;, "http://static.example.com/; 
> > STATIC_URL = '/static/' 
> > 
> > # Additional locations of static files 
> > STATICFILES_DIRS = ( 
> > # Put strings here, like "/home/html/static" or 
> "C:/www/django/static". 
> > # Always use forward slashes, even on Windows. 
> > # Don't forget to use absolute paths, not relative paths. 
> > ) 
> > 
> > # 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', 
> > 'C:\BitNami\djangostack-1.5.1-0\mysite\mysite\static', 
> > ) 
> > 
> > # Make this unique, and don't share it with anybody. 
> > SECRET_KEY = '358gds4dg4s0*&^&^lkN0g4ses4rt6strssgs' 
> > 
> > # List of callables that know how to import templates from various 
> sources. 
> > TEMPLATE_LOADERS = ( 
> > 

Re: /admin redirects me to 127.0.0.1:8000/admin on nginx+gunicorn production server

2013-07-25 Thread Daniel Oźminkowski
I thought that it may be connected to Chrome's Omnibox, but honestly now I
can not replicate that behaviour. It works fine in and out of incognito
mode.

Best regards,
Daniel Ozminkowski

2013/7/24 Avraham Serour 

> Well, if it works on incognito mode you should try cleaning your cookies
> On Jul 24, 2013 11:33 PM, "Daniel Oźminkowski" 
> wrote:
>
>> Hello again,
>>
>> I just had a WTF moment. I kept trying to access 192.168.1.4/admin which
>> opened 0.0.0.0:8000 consistently for the last couple of hours (notice
>> this is not localhost). Then I've read somewhere: "check with curl what
>> kind of reponse you get directly from gunicorn". So I did and it was fine,
>> I got the login form. Then I had a hunch - maybe it's something wrong with
>> my browser, Chrome. Turns out I was right - it worked in incognito mode! I
>> tried again with normal tab - again 0.0.0.0:8000. So I tried
>> http://192.168.1.4/admin/ with the slash at the end and voila! Admin
>> login form. Now even without the slash at the end I get the login form
>> everytime.
>>
>> Please, somebody explain this to me. I wasted so much time on this, tried
>> so many nginx configurations and I still don't know what I did wrong. It's
>> voodoo. ;)
>>
>> Best regards,
>> Daniel Ozminkowski
>>
>> 2013/7/18 Daniel Oźminkowski 
>>
>>> Hello,
>>>
>>> first I want to state, that I am a beginner and everything still works a
>>> little like magic for me. I have always worked with django by running it
>>> with runserver. Recently decided to put it on virtual machine and serve the
>>> site with nginx + gunicorn. I understand how to serve static files and so
>>> on. Even my app works. I hit the problem when I try to access built-in
>>> admin interface. Everytime when I go to http://VMip/admin I get
>>> redirected to http://127.0.0.1:8000/.
>>>
>>> I made sure that SITE_ID is the same in settings.py and the django_site
>>> table.
>>>
>>> The server is on a VM, I access it by ip. Here is my nginx config in
>>> sites-enabled/my_app.
>>>
>>> server {
>>> server_name 192.168.0.112; # I noticed it doesn't matter. Nginx
>>> serves the site even if VM ip changes... hmmm?
>>> listen 80;
>>>
>>> root /home/daniel/www
>>> index index.html index.htm
>>> client_max_body_size 32M;
>>> client_body_buffer_size 128k;
>>> location /static/ {
>>> root /home/daniel/www
>>> }
>>>
>>> location / {
>>> proxy_pass_header Server;
>>> proxy_set_header Host $http_host;
>>> proxy_redirect off;
>>> proxy_set_header X-Real-IP $remote_addr;
>>> proxy_set_header X-Scheme $scheme;
>>> proxy_connect_timeout 10;
>>> proxy_read_timeout 10;
>>> proxy_pass http://localhost:8000/;
>>> }
>>> }
>>>
>>> I will be very grateful for any clues how to fix it. Thanks!
>>>
>>> Best regards,
>>> Daniel
>>>
>>> --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/ZbtZ9d8YPXo/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>>
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/ZbtZ9d8YPXo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: server error (500)

2013-07-25 Thread Mário Idival
use this in your settings.py
ALLOWED_HOSTS = []

where are you envirioment? you app there in production or development?
Em 25/07/2013 04:35, "victoria"  escreveu:
>
> Hi,
>
> On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote:
> > If I set DEBUG = False, I get this
> >
> > It worked!
> >
> > Congratulations on your first Django-powered page.
> >
> > Of course, you haven't actually done any work yet. Here's what to do
next:
> >
> > If you plan to use a database, edit the DATABASES setting in
> > mysite/settings.py.
> > Start your first app by running python manage.py startapp [appname].
> >
> > You're seeing this message because you have DEBUG = True in your Django
> > settings file and you haven't configured any URLs. Get to work!
> >
> >
> >
> >
> >
> > If I set it to true, I get the server error (500).  I created the
template
> > and static folder inside mysite folder.  Here is my setting.py.
> >
>
> Can  you check the apache error log to see if you can find more
> information there? It is located in
> C:\BitNami\djangostack-1.5.1-0\apache2\logs
>
>
> > I run the inspectdb and it went fine, no errors.   I'm new and
following the
> > tutorials at Django website documentation.
> >
> > I appreciate any help.
> >
> >
> >
> >
> >
> >
> >
> > # Django settings for mysite project.
> >
> > DEBUG = True
> > TEMPLATE_DEBUG = DEBUG
> >
> > ADMINS = (
> > # ('mysite', 'em...@email.com'),
> > )
> >
> > MANAGERS = ADMINS
> >
> > DATABASES = {
> > 'default': {
> > 'ENGINE': 'django.db.backends.mysql', # Add
'postgresql_psycopg2',
> > 'mysql', 'sqlite3' or 'oracle'.
> > 'NAME': 'mysitedb',  # Or path to database
file
> > if using sqlite3.
> > # The following settings are not used with sqlite3:
> > 'USER': 'root',
> > 'PASSWORD': '',
> > 'HOST': '',  # Empty for localhost through
> > domain sockets or '127.0.0.1' for localhost through TCP.
> > 'PORT': '',  # Set to empty string for
default.
> > }
> > }
> >
> > # Hosts/domain names that are valid for this site; required if DEBUG is
> > False
> > # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> > ALLOWED_HOSTS = ['localhost']
> >
> > # Local time zone for this installation. Choices can be found here:
> > # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> > # although not all choices may be available on all operating systems.
> > # In a Windows environment this must be set to your system time zone.
> > TIME_ZONE = 'EST'
> >
> > # Language code for this installation. All choices can be found here:
> > # http://www.i18nguy.com/unicode/language-identifiers.html
> > LANGUAGE_CODE = 'en-us'
> >
> > SITE_ID = 1
> >
> > # If you set this to False, Django will make some optimizations so as
not
> > # to load the internationalization machinery.
> > USE_I18N = True
> >
> > # If you set this to False, Django will not format dates, numbers and
> > # calendars according to the current locale.
> > USE_L10N = True
> >
> > # If you set this to False, Django will not use timezone-aware
datetimes.
> > USE_TZ = True
> >
> > # Absolute filesystem path to the directory that will hold user-uploaded
> > files.
> > # Example: "/var/www/example.com/media/"
> > MEDIA_ROOT = ''
> >
> > # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> > # trailing slash.
> > # Examples: "http://example.com/media/;, "http://media.example.com/;
> > MEDIA_URL = ''
> >
> > # Absolute path to the directory static files should be collected to.
> > # Don't put anything in this directory yourself; store your static files
> > # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> > # Example: "/var/www/example.com/static/"
> > #STATIC_ROOT = ''
> >
> > # URL prefix for static files.
> > # Example: "http://example.com/static/;, "http://static.example.com/;
> > STATIC_URL = '/static/'
> >
> > # Additional locations of static files
> > STATICFILES_DIRS = (
> > # Put strings here, like "/home/html/static" or
"C:/www/django/static".
> > # Always use forward slashes, even on Windows.
> > # Don't forget to use absolute paths, not relative paths.
> > )
> >
> > # 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',
> > 'C:\BitNami\djangostack-1.5.1-0\mysite\mysite\static',
> > )
> >
> > # Make this unique, and don't share it with anybody.
> > SECRET_KEY = '358gds4dg4s0*&^&^lkN0g4ses4rt6strssgs'
> >
> > # List of callables that know how to import templates from various
sources.
> > TEMPLATE_LOADERS = (
> > 'django.template.loaders.filesystem.Loader',
> > 'django.template.loaders.app_directories.Loader',
> > # 

How to get the right url of models in generic views?

2013-07-25 Thread Floor Tile
#urls.py
from .models import Entry
from django.conf.urls import patterns, url
from django.views.generic.dates import (ArchiveIndexView,
YearArchiveView,
MonthArchiveView,
DayArchiveView,
DateDetailView,
)

urlpatterns = patterns('',

url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/(?P[-\w]+)/$',
DateDetailView.as_view(model=Entry,
date_field='pub_date'
),
),

url(r'^(?P\d{4})/(?P\w{3})/(?P\d{2})/$',
DayArchiveView.as_view(model=Entry,
date_field='pub_date',
template_name='blog/entry_archive.html',
),
),

url(r'^(?P\d{4})/(?P\w{3})/$',
MonthArchiveView.as_view(model=Entry,
queryset=Entry.objects.order_by('-pub_date'),
context_object_name='latest',
date_field='pub_date',
template_name='blog/entry_archive.html',
),
),

url(r'^(?P\d{4})/$',
YearArchiveView.as_view(model=Entry,
queryset=Entry.objects.order_by('-pub_date'),
context_object_name='latest',
date_field='pub_date',
template_name='blog/entry_archive.html',
make_object_list=True,
),
),

url(r'^$',
ArchiveIndexView.as_view(model=Entry,
date_field='pub_date',
),
),
)

I'm having a problem getting the right urls of model instances in generic
class based views in Django 1.5.

I have the following code:

#models.py
import datetime

from django.contrib.auth.models import User
from django.db import models

from taggit.managers import TaggableManager
from markdown import markdown

class Category(models.Model):
title = models.CharField(max_length=250, help_text="Maximum 250
characters.")
slug = models.SlugField(unique=True,
help_text="Sugested value will be generated from title. Must be
unique")
description = models.TextField()


class Meta:
ordering = ['-title']
verbose_name_plural = 'Categories'

def __unicode__(self):
return self.title

def get_absolute_url(self):
return 'categories/%s/' % self.slug


class Entry(models.Model):

LIVE_STATUS = 1
DRAFT_STATUS = 2
HIDDEN_STATUS = 3
STATUS_CHOICES = (
(LIVE_STATUS, 'Live'),
(DRAFT_STATUS, 'Draft'),
(HIDDEN_STATUS, 'Hidden'),
)

status = models.IntegerField(choices=STATUS_CHOICES,
default=LIVE_STATUS)
title = models.CharField(max_length=250)
slug = models.SlugField(unique_for_date='pub_date')
excerpt = models.TextField(blank=True)
excerpt_html = models.TextField(editable=False, blank=True)
body = models.TextField()
body_html = models.TextField(editable=False, blank=True)
pub_date = models.DateTimeField(default=datetime.datetime.now())
author = models.ForeignKey(User)
enable_comments = models.BooleanField(default=True)
categories = models.ManyToManyField(Category)
tags = TaggableManager()

class Meta:
verbose_name_plural = 'Entries'
ordering = ['-pub_date']

def __unicode__(self):
return self.title

def save(self, force_insert=False, force_update=False):
self.body_html = markdown(self.body)
if self.excerpt:
self.excerpt_html = markdown(self.excerpt)
super(Entry, self).save(force_insert, force_update)

@models.permalink
def get_absolute_url(self):
return ('entry', (),{
'year': self.pub_date.strftime('%Y'),
'month': self.pub_date.strftime('%b'),
'day': self.pub_date.strftime('%d'),
'slug': self.slug,
}
)

When I manually type an url in the browser the archives or entries are
shown.
So when giving in "localhost://news/2013/jul/24/entry-name" the entry is
shown.
And when giving in "localhost://news/2013/" a list is presented.
So the urls are valid but in the list-views (archives) the links that are
printed on the screen are not linked to the the right url.
They are linked to the url of the present page.
Can someone help me ?

Many thanks in advance!

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




Re: server error (500)

2013-07-25 Thread victoria
Hi,

On Thu, Jul 25, 2013 at 4:30 AM, Oliver  wrote:
> If I set DEBUG = False, I get this
>
> It worked!
>
> Congratulations on your first Django-powered page.
>
> Of course, you haven't actually done any work yet. Here's what to do next:
>
> If you plan to use a database, edit the DATABASES setting in
> mysite/settings.py.
> Start your first app by running python manage.py startapp [appname].
>
> You're seeing this message because you have DEBUG = True in your Django
> settings file and you haven't configured any URLs. Get to work!
>
>
>
>
>
> If I set it to true, I get the server error (500).  I created the template
> and static folder inside mysite folder.  Here is my setting.py.
>

Can  you check the apache error log to see if you can find more
information there? It is located in
C:\BitNami\djangostack-1.5.1-0\apache2\logs


> I run the inspectdb and it went fine, no errors.   I'm new and following the
> tutorials at Django website documentation.
>
> I appreciate any help.
>
>
>
>
>
>
>
> # Django settings for mysite project.
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('mysite', 'em...@email.com'),
> )
>
> MANAGERS = ADMINS
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
> 'mysql', 'sqlite3' or 'oracle'.
> 'NAME': 'mysitedb',  # Or path to database file
> if using sqlite3.
> # The following settings are not used with sqlite3:
> 'USER': 'root',
> 'PASSWORD': '',
> 'HOST': '',  # Empty for localhost through
> domain sockets or '127.0.0.1' for localhost through TCP.
> 'PORT': '',  # Set to empty string for default.
> }
> }
>
> # Hosts/domain names that are valid for this site; required if DEBUG is
> False
> # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> ALLOWED_HOSTS = ['localhost']
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> TIME_ZONE = 'EST'
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded
> files.
> # Example: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/;, "http://media.example.com/;
> MEDIA_URL = ''
>
> # Absolute path to the directory static files should be collected to.
> # Don't put anything in this directory yourself; store your static files
> # in apps' "static/" subdirectories and in STATICFILES_DIRS.
> # Example: "/var/www/example.com/static/"
> #STATIC_ROOT = ''
>
> # URL prefix for static files.
> # Example: "http://example.com/static/;, "http://static.example.com/;
> STATIC_URL = '/static/'
>
> # Additional locations of static files
> STATICFILES_DIRS = (
> # Put strings here, like "/home/html/static" or "C:/www/django/static".
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )
>
> # 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',
> 'C:\BitNami\djangostack-1.5.1-0\mysite\mysite\static',
> )
>
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '358gds4dg4s0*&^&^lkN0g4ses4rt6strssgs'
>
> # List of callables that know how to import templates from various sources.
> TEMPLATE_LOADERS = (
> 'django.template.loaders.filesystem.Loader',
> 'django.template.loaders.app_directories.Loader',
> # 'django.template.loaders.eggs.Loader',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> # Uncomment the next line for simple clickjacking protection:
> #