Re: Specific models without a database table

2011-08-21 Thread Kristofer Pettijohn
> That is substantially harder, but could be possible. The main problem is that 
> the Django ORM will want to write SQL queries when there's a link to the 
> EmailAccount model.
> 
> Your best bet is probably a proxy model that contains a reference to the 
> relevant API record (e.g. the email address identifier or whatever the API 
> uses), and then a custom save() method that writes the values out to the DB. 
> You can use the Django form logic etc without it needing to be backed by a 
> model.
> 
> It will largely depend on how you want the EmailAccount to look - the closer 
> you want it to work to a standard ORM model, the more work you'll have to do 
> to trick things. If it's a simple field that isn't used for queries, then you 
> could look at creating a custom field type that knows how to read/write the 
> values to the API.

Are there any examples out there that get me started for overriding the save() 
method?

Ideally, I'd like to create fields in the Model that will similarly match 
fields in the mail server's API, so I can do queries, updates, etc.  I realize 
that I will need to do a lot of trickery to try to bring it closer to the 
standard ORM model.  So any little examples that might be out there would be 
helpful.

> All the above advice is worth exactly what you paid for it!

Thanks again!

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



Re: Import problem

2011-08-21 Thread Jim
You are right, SleepyCal. I changed global to something else, and the import 
issue was solved.

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



Re: objects tools redirect to models def

2011-08-21 Thread Mariano DAngelo
screenshot http://professional-fighters.com/images/change-list.png the
is shown the object tools of tools admin, I have to put a link into
the change list template to add it, but I whant that when the button
is pressed it's redirected to a python function, how can I do it?

On 21 ago, 23:16, Mike Dewhirst  wrote:
> On 22/08/2011 11:56am, Mariano DAngelo wrote:> Hi I'm new in django I'm 
> trying to redirect a personalize object tool
> > to a function on a model module
>
> > how can I do this becouse alll tutorial show how to redirect to a
> > link
>
> > thanks
>
> I'm not sure what you are asking about. Redirection is normally done in
> your urls.py or behind the scenes by the webserver itself. In python, a
> module is either a directory with source code or a file such as
> models.py. Models defined in models.py can have functions or methods.
> You can call them using normal python syntax.
>
> Could you say how new you are? Have you got the tutorial working?
>
> Mike

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



Re: How to create a sub-app directly

2011-08-21 Thread Jim
Thank you, folks. I am new to django. I read  a blog the other day that 
suggests put all applications under a common directory, such as apps, to 
make the site directory neat, and I think that seems a good idea. That's why 
I thought it would be wonderful if manage.py could make an app under a given 
directory, which is apps/ in my case. 

Anyway, it is always nice to hear other people's ideas. Again, thank you 
very much.

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



Re: How to create a sub-app directly

2011-08-21 Thread Mike Dewhirst

On 22/08/2011 1:22am, Jim wrote:

I tried
../manage.py startapp someapp
under apps/, but that created the someapp under mysite/ rather than 
under apps/.




That's what is expected.

mysite should contain settings.py and mysite/apps should contain 
models.py (among other files). If you want a separate database to 
contain data used by all applications there is nothing wrong with 
creating a new subdirectory mysite/common (someone here felt that 
"global" might be a reserved word) and copying the contents of 
mysite/apps into mysite/common. Then in settings.py put mysite.apps and 
mysite.common into INSTALLED_APPS.


I would adjust the name "apps" to something more specific for a single 
app. You can have a dozen app directories under mysite if you like. In 
fact that is good. Segregate your project into as many stand-alone apps 
as you feel comfortable doing - but they should all be at the same level 
for keystroke minimisation when importing.


 mysite (settings.py, urls.py etc)
  app1 (models.py, urls.py etc)
  app2 (urls.py)
   models (whatever.py containing just the whatever model)
  app3(models.py)
   urls (this.py containing just the this urls)
   views (lots of files keeping your views under control)

Because you import the bits and pieces as required it is best to keep 
things as flat as dictated by the inherent complexity of your project. 
In the diagram above, app1 is fairly simple, app2 has many complex 
models so you put them into separate files in a models sub-dir, while 
app3 has simple models but lots of complex urls which would be best in a 
separate urls directory and likewise for app3's views.


hth

Mike

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



Re: Specific models without a database table

2011-08-21 Thread Kristofer Pettijohn
Great, thank to both of you.

I'm coming from a world of CakePHP.  I did more Python programming back in the 
day, and am getting back into it, so I'm trying to get more familiar with 
Django.

Thanks for the suggestions, I'll see what I can make happen.

- Original Message -
From: sedl...@gmail.com
To: "Django users" 
Sent: Saturday, August 20, 2011 11:44:33 AM
Subject: Re: Specific models without a database table

Hi,
you may use custom model manager (responsible for retrieving objects
from DB) and custom save method (which would not call Model.save),
together with managed=True.

You may still face some issues, however I think this should be
possible.

Cheers,
Filip

On 20 srp, 12:51, Malcolm Box  wrote:
> On 20 August 2011 02:33, Kristofer Pettijohn wrote:
>
> > Hello,
>
> > Is it possible to create specific models without a database table?
>
> Yes, it's possible. You want the "managed" attribute on the model - 
> seehttps://docs.djangoproject.com/en/1.3/ref/models/options/#managed
>
> This will prevent Django from creating or modifying the db table
>
> > Basically what I would like to do is create an email account management
> > application that ties into my existing mail server and its API.  I would
> > like Django to have a Users model and keep track of users, a Domains model
> > to keep track of the email domains for the user, but I don't want it to
> > actually keep track of email addresses.  Once the user is in the
> > application, they will go into the "EmailAccount" model and I simply want
> > the model to query my mail server via its SOAP API.  So when they
> > create/delete/edit email accounts, there will be form pages and simple
> > validation done by Django, but the actual work will be done by connecting to
> > the mail servers API and not a database.
>
> Is this possible?
>
> That is substantially harder, but could be possible. The main problem is
> that the Django ORM will want to write SQL queries when there's a link to
> the EmailAccount model.
>
> Your best bet is probably a proxy model that contains a reference to the
> relevant API record (e.g. the email address identifier or whatever the API
> uses), and then a custom save() method that writes the values out to the DB.
> You can use the Django form logic etc without it needing to be backed by a
> model.
>
> It will largely depend on how you want the EmailAccount to look - the closer
> you want it to work to a standard ORM model, the more work you'll have to do
> to trick things. If it's a simple field that isn't used for queries, then
> you could look at creating a custom field type that knows how to read/write
> the values to the API.
>
> All the above advice is worth exactly what you paid for it!
>
> Malcolm

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

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



Re: objects tools redirect to models def

2011-08-21 Thread Mike Dewhirst

On 22/08/2011 11:56am, Mariano DAngelo wrote:

Hi I'm new in django I'm trying to redirect a personalize object tool
to a function on a model module

how can I do this becouse alll tutorial show how to redirect to a
link

thanks

I'm not sure what you are asking about. Redirection is normally done in 
your urls.py or behind the scenes by the webserver itself. In python, a 
module is either a directory with source code or a file such as 
models.py. Models defined in models.py can have functions or methods. 
You can call them using normal python syntax.


Could you say how new you are? Have you got the tutorial working?

Mike

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



objects tools redirect to models def

2011-08-21 Thread Mariano DAngelo
Hi I'm new in django I'm trying to redirect a personalize object tool
to a function on a model module

how can I do this becouse alll tutorial show how to redirect to a
link

thanks

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



Re: CSS question

2011-08-21 Thread Joshua Russo
Thanks for the help, CSS is always my gremlin 

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



Re: CSS question

2011-08-21 Thread Micky Hulse
P.S.

There's a great CSS listserv here:



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



Re: CSS question

2011-08-21 Thread Micky Hulse
Hello,

[ot]

One way to do it...

You could make all of your elements (label/input) inside of your block
container display "inline" and then use something like this:

#someContainer * {
...
vertical-align: middle !important;
...
}

The "!important" (what I call "not important") is optional, depending
on your setup.

You might also play around with line-height and font-size (i.e. apply
the same sizes to labels and input fields) in order to tame things
down.

line-height: 1;

Remember that you should omit the unit for line-height property values.
Here's one reference for that:



I also use a reset/base/fonts css (I prefer YUI) in order to
reset/normalize my global styles... That might also help you.

Hope that helps.

[/ot]

Cheers,
Micky

On Sun, Aug 21, 2011 at 2:47 PM, Joshua Russo  wrote:
> I know this is a bit off topic but I know this place is full of very
> helpful intelligent people. :o)
> Ok so I have an html block (div, p, doesn't matter what kind), and I fill it
> with a label and an input text field. The input is always larger than the
> label (rightly so), but the label is always aligned to the top of the block.
> I want to center the label in the block but for the life of me, I can't
> figure out how.
> Any ideas on how to fix it or where to go to get an answer?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/-6G_bvvoyM0J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Micky Hulse
Web Content Editor
The Register-Guard
3500 Chad Drive
Eugene, OR 97408
Phone: (541) 338-2621
Fax: (541) 683-7631
Web: 

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



Re: extending the User profile - which way to go?

2011-08-21 Thread Axel Bock
Thanks for all your replies, it makes sense to wait until it's a performance 
problem :)

Greetings, 
Axel.



Am 21.08.2011 um 22:14 schrieb Simon Connah:

> On 21 Aug 2011, at 19:37, Shawn Milochik wrote:
> 
>> Using a OneToOne field does the same thing as a FK with unique set to true, 
>> and simplifies queryset syntax.
> 
> Good point.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

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



CSS question

2011-08-21 Thread Joshua Russo
I know this is a bit off topic but I know this place is full of very 
helpful intelligent people. :o)

Ok so I have an html block (div, p, doesn't matter what kind), and I fill it 
with a label and an input text field. The input is always larger than the 
label (rightly so), but the label is always aligned to the top of the block. 
I want to center the label in the block but for the life of me, I can't 
figure out how.

Any ideas on how to fix it or where to go to get an answer?

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



Re: Best approach to handling different types of Users

2011-08-21 Thread Joshua Russo
Things will break in the sense that, if you add another app that accesses 
the User model they will only see the original implementation. They won't 
get your subclass. Other than that, other apps that use the User model 
should "work" just fine.

Unless I'm missing something, and in that case someone can kindly correct 
me. :o)

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



Re: Django beginner question

2011-08-21 Thread Christian Ramsey
Ok I see.  I like the idea of this I will try it, aha!! I truly understand, 
thank you so much and I will post my outcome!


Christian
On 21 Aug 2011, at 10:17, Gelonida N wrote:

> On 08/21/2011 03:25 AM, Christian Ramsey wrote:
>> Hi and thank you so much,  this provided a ton of clarity, especially
>> the modelling of the order table with a foreign key to a user, I was
>> locked on thinking the user table needed to somehow have the orders
>> within it. But I see I needed to step back.
>> 
>> I've already started to implement all of this and I am trying to
>> understand the  additional table, if the Order table already contains
>> the user it belongs to, then what will the additional table be set
>> for, from my perspective would this be to keep the original order?
>> 
>>> 
>>> I never implemented a shopping application and  what I suggest is very
>>> probably neither the most elegant nor the most efficient solution.
>>> But what is clear is, that you should use at least one table more.
>>> 
>>> Example Suggestion:
>>> 
>>> User: contains info about the user
>>> 
>>> Product: info about a product and it's price (though price might be in a
>>> separate table)
>>> 
>>> Order: Info about the order, which could be ForeignKey to a user, the
>>> order date, and perhaps payment status.
>>> 
>>> And one table more, which would store one entry of a order:
>>> it would store a oeign Key to a Product, the selected amount and a
>>> ForeignKey to the order it belongs to.
>>> 
> 
> My suggestion was, that the Order just contains the customer, the order
> date, and all other data, that is unique for one order,
> but not the items, that have been ordered. tey would be stored in the
> 4th table.
> 
> So the 4th table could be called OrderItem.
> 
> each order item would contain
> - to which order it belongs to (Freign key)
> - what product has been ordered ( foreign key)
> - how many items of the product has been ordered.
> 
> So basically a customer command cosists of all OrderItems belonging to
> one Order.
> 
> As I said before there's many solutions, this is just one.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

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



Re: Djangonaut is looking for a job

2011-08-21 Thread Eugeny Belykh
http://www.donanza.com/jobs/django
also going to be checked

2011/8/22 Eugeny Belykh 

> ok))
>
>
> 2011/8/19 Andre Terra 
>
>> http://djangogigs.com/
>> https://www.djangoproject.com/rss/community/jobs/
>>
>> 2011/8/19 Eugeny Belykh 
>>
>>> hi))
>>> i think yes,we should keep  trying
>>>
>>>
>>> 2011/8/17 枯藤天涯 
>>>
 hello,I am from China。And I am looking a job about python/django .Just
 same as you .Remote (telecommuting) only.Can we find the job like
 this?

 2011/8/5 Eugeny Belykh :
 > Hi everybody.I am Django newbee based in Russia. I am looking for a
 > Django related job.Remote (telecommuting) only. 1 django-powered site
 > in portfolio.Are there any vacancies?
 >
 > --
 > You received this message because you are subscribed to the Google
 Groups "Django users" group.
 > To post to this group, send email to django-users@googlegroups.com.
 > To unsubscribe from this group, send email to
 django-users+unsubscr...@googlegroups.com.
 > For more options, visit this group at
 http://groups.google.com/group/django-users?hl=en.
 >
 >

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


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

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



Re: Django beginner question

2011-08-21 Thread Christian Ramsey
Taking a look at this now!
Cheers.
On 20 Aug 2011, at 19:14, kenneth gonsalves wrote:

> On Sat, 2011-08-20 at 17:03 -0700, Christian Ramsey wrote:
>> Thank you for your response, I was trying to explain it in detail, I
>> believe I get the greater whole of the project which I've specified by
>> explaining the project but the parts I don't I've asked a question
>> about. Maybe my approach is incorrect, I did not mean that my
>> informative parts were suppose to be answered but again merely a poke
>> at trying not to be short, but thank you, I will read the Prepare the
>> question section and see if I can recreate my collection of queries in
>> a refined way in which I hope you and everyone else would consider
>> "industrious" and possibly feel the ability to help rather than to
>> lecture.
> 
> also read something about normal forms, as your question is not so much
> django related as rdbms related. Hint: look at foreign keys.
> -- 
> regards
> Kenneth Gonsalves
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

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



Re: Djangonaut is looking for a job

2011-08-21 Thread Eugeny Belykh
ok))

2011/8/19 Andre Terra 

> http://djangogigs.com/
> https://www.djangoproject.com/rss/community/jobs/
>
> 2011/8/19 Eugeny Belykh 
>
>> hi))
>> i think yes,we should keep  trying
>>
>>
>> 2011/8/17 枯藤天涯 
>>
>>> hello,I am from China。And I am looking a job about python/django .Just
>>> same as you .Remote (telecommuting) only.Can we find the job like
>>> this?
>>>
>>> 2011/8/5 Eugeny Belykh :
>>> > Hi everybody.I am Django newbee based in Russia. I am looking for a
>>> > Django related job.Remote (telecommuting) only. 1 django-powered site
>>> > in portfolio.Are there any vacancies?
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> > For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>> >
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: Best approach to handling different types of Users

2011-08-21 Thread dfolland
Like I said use the "Groups" and then like what was suggested
"Permissions".  That should handle what your are trying to do and not
introduce any conflicts.

On Aug 18, 9:17 am, dfolland  wrote:
> Try using "Groups" that is part of the Django user authentication.
>
> https://docs.djangoproject.com/en/dev/topics/auth/
>
> On Aug 18, 6:56 am, Cameron  wrote:
>
>
>
>
>
>
>
> > Hi, I'm wondering if anyone can help shed some light on the best
> > approach is too creating different Users. I'm trying to make a online
> > shop, that features two types of Users, "Customers" and "Merchants".
> > The power of each Users vary greatly, Customers can buy items from
> > Merchants and Merchants can (as you would expect) list new products,
> > edit them. Merchants required additional information compared to
> > Customers (such as Address, Contact Info, Payment details).
>
> > Now hows the best way to handle this? I've read that subclassing the
> > User class is bad (I'm not entirely sure why though). Most examples
> > try to extend the User class, with a UserProfile class with a OneToOne
> > relationship to the User class (like thishttp://pastebin.com/GQVLrVTx).
> > Is it better to extend that to a UserProfileMerchant and
> > UserProfileCustomer, or have a single UserProfile, and have a boolean
> > field to indicate if the account is a Merchant? (both examples in the
> > following -http://pastebin.com/F8ZenCa1)
>
> > Any advice on the matter would be greatly appreciated!

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



Re: Admin Stopped Saving Record Changes!

2011-08-21 Thread Yaşar Arabacı
Well, that is because no error occured :)

2011/8/21 Lee 

> Solved: in the process of fixing indentation errors I accidentally
> indented "obj.save()" so that it only fired on inserts not updates.
> Interesting that Admin still generated the "Successful" message when
> no save occurred.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: Admin Stopped Saving Record Changes!

2011-08-21 Thread Lee
Solved: in the process of fixing indentation errors I accidentally
indented "obj.save()" so that it only fired on inserts not updates.
Interesting that Admin still generated the "Successful" message when
no save occurred.

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



Help installing django-sentry

2011-08-21 Thread tharshan muthulingam
Hi, 
I have been having alot of trouble trying to install and run django-sentry. 
My project directory is ~/django_projects/Project

Inside there i have the simple polls app from the tutorial, and I have 
installed sentry using pip. I have added it to the list of installed apps.

When I go to the sentry directory I got this error:
http://127.0.0.1:8000/sentry/

ViewDoesNotExist at /sentry/Tried result in module polls.views. Error was: 
'module' object has no attribute 'result'

I honestly have no clue what that means, and I would really appreciate some 
help with fixing this.

Thank you!!

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



Re: extending the User profile - which way to go?

2011-08-21 Thread Simon Connah
On 21 Aug 2011, at 19:37, Shawn Milochik wrote:

> Using a OneToOne field does the same thing as a FK with unique set to true, 
> and simplifies queryset syntax.

Good point.

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



Re: Port of Django Template Language to PHP

2011-08-21 Thread Yaşar Arabacı
I am considering writing about it, but I want to test it first. Since I am
not on my own computer, that will need to wait a little :)

2011/8/21 Rune Kaagaard 

> @Yaşar: Thanks a lot, would love to see the post if you really do write it!
>
> @Kenneth+@Masklinn: You are right, there are a lot of template
> languages already, but this particular wheel is - unlike twig - not a
> compiled language but implemented in pure PHP as an Iterator, allowing
> it to blend in as an extension to your existing PHP templates.
>
> Thanks for your interest!
>
> On Sun, Aug 21, 2011 at 4:09 AM, kenneth gonsalves
>  wrote:
> > On Sat, 2011-08-20 at 21:28 +0200, Masklinn wrote:
> >> > Those of you moonlighting in PHP, might be interested in a pure PHP
> >> > port of the Django Template Language that I've just released. It's
> >> > called Chano and has doc pages at http://chano.readthedocs.org and a
> >> > github account at https://github.com/runekaagaard/php-chano .
> >> This sounds like a huge duplication of effort: there's already
> >> Twig[0],
> >> a port of Jinja2[1] which is basically a reimplementation and
> >> extension
> >> of Django's own templating language.
> >
> > if people did not keep reinventing the wheel we would be still in the
> > age of oxcarts.
> > --
> > regards
> > Kenneth Gonsalves
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Admin Stopped Saving Record Changes!

2011-08-21 Thread Lee
I've been happily tuning my Admin app the last few days, and suddenly
noticed record changes (UPDATE) are no longer being saved to the
database. Adds (INSERT) are working fine. I DO get the 'The ModelName
"_unicode_" was changed successfully' message, but the database record
is not affected, and editing the supposedly saved record in Admin
shows the old version without changes.

I'm using Apache not the development server. Backend is Postgres. Any
help would be greatly appreciated.

Lee

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



Re: extending the User profile - which way to go?

2011-08-21 Thread Shawn Milochik
Using a OneToOne field does the same thing as a FK with unique set to true,
and simplifies queryset syntax.

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



Re: extending the User profile - which way to go?

2011-08-21 Thread Simon Connah
My personal preference is to just create a new model class with a ForeignKey 
field pointing to the User model with unique=True set. That way you can extend 
the User object in as many different apps as you want. For instance in a forum 
app you could have a model tracking the number of posts a user made and in a 
blog app you could have a model tracking the number of comments the user has 
made.

The advantage of this method is that you can seperate all the data you store 
about a User into different apps rather than just having one site wide 
UserProfile model which would need to store lots of different types of data 
that would probably benefit from being stored in seperate models.

On 21 Aug 2011, at 14:52, Matt Schinckel wrote:

> You haven't really provided a reason why to 'do it the django way', rather 
> than inheriting from User.
> 
> You do make a valid point about the separate data being in a different table: 
> the difference would be that with using UserProfile, you need to either do 
> the .select_related() yourself, of have a second db query when you do a 
> .get_profile(). With the inheritance method, django will do the joins for you.
> 
> This may actually bite: there are some circumstances where a join is more 
> expensive than a second query. In either case, right now is probably not the 
> time to worry about it. Wait until it becomes a performance issue.

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



Re: Django beginner question

2011-08-21 Thread Gelonida N
On 08/21/2011 03:25 AM, Christian Ramsey wrote:
> Hi and thank you so much,  this provided a ton of clarity, especially
> the modelling of the order table with a foreign key to a user, I was
> locked on thinking the user table needed to somehow have the orders
> within it. But I see I needed to step back.
> 
> I've already started to implement all of this and I am trying to
> understand the  additional table, if the Order table already contains
> the user it belongs to, then what will the additional table be set
> for, from my perspective would this be to keep the original order?
> 
>>
>> I never implemented a shopping application and  what I suggest is very
>> probably neither the most elegant nor the most efficient solution.
>> But what is clear is, that you should use at least one table more.
>>
>> Example Suggestion:
>>
>> User: contains info about the user
>>
>> Product: info about a product and it's price (though price might be in a
>> separate table)
>>
>> Order: Info about the order, which could be ForeignKey to a user, the
>> order date, and perhaps payment status.
>>
>> And one table more, which would store one entry of a order:
>> it would store a oeign Key to a Product, the selected amount and a
>> ForeignKey to the order it belongs to.
>>

My suggestion was, that the Order just contains the customer, the order
date, and all other data, that is unique for one order,
but not the items, that have been ordered. tey would be stored in the
4th table.

So the 4th table could be called OrderItem.

each order item would contain
- to which order it belongs to (Freign key)
- what product has been ordered ( foreign key)
- how many items of the product has been ordered.

So basically a customer command cosists of all OrderItems belonging to
one Order.

As I said before there's many solutions, this is just one.



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



Re: How to create a sub-app directly

2011-08-21 Thread Subhranath Chunder
>From what I understood, by "sub-apps" Jim meant creating the application in
a sub-directory, or more specifically maybe inside another python package,
using the manage.py command for the sake of convenience and creating using a
single command.


On Sun, Aug 21, 2011 at 10:13 PM, Praveen Krishna R <
rpraveenkris...@gmail.com> wrote:

> *Is there  a concept of sub-apps exist in Django !?*
> *I knew some concepts like independant reusable apps.*
> *You can easily handle the rest with your urls right ?! correct me?
> *
>
> On Sun, Aug 21, 2011 at 6:27 PM, Subhranath Chunder 
> wrote:
>
>> Extend the manage.py functionality, by adding your custom command.
>> https://docs.djangoproject.com/en/dev/howto/custom-management-commands/
>>
>>
>> On Sun, Aug 21, 2011 at 8:52 PM, Jim  wrote:
>>
>>> Hello folks,
>>>
>>> Here is the story. I created a site, mysite, with this command django-admin
>>> startproject mysite. Then, under the directory mysite/, I created an app
>>> named apps with this command ./manage.py startapp apps. apps is meant to
>>> hold all applications for mysite. Now, here comes the question:
>>> *How do I create a sub-app under apps with manage.py directly?*
>>>
>>> I tried
>>> ../manage.py startapp someapp
>>> under apps/, but that created the someapp under mysite/ rather than under
>>> apps/.
>>>
>>> I also tried
>>> ./manage.py startapp apps/someapp
>>> and
>>> ./manage.py startapp apps.someapp
>>> under mysite/, but neither worked.
>>>
>>> So, my current work-around is to create a sub-app under mysite/ first,
>>> then move it into apps/ manually. But that seems dumb, and I suspect there
>>> is a simpler way to do this.
>>>
>>> Thanks for reading this. Any help is certainly appreciated.
>>>
>>> Jim
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/django-users/-/QtvEmvU5QvMJ.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Thanks,
>> Subhranath Chunder.
>> www.subhranath.com
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Thanks and Regards,
> *Praveen Krishna R*
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks,
Subhranath Chunder.
www.subhranath.com

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



Re: How to create a sub-app directly

2011-08-21 Thread Praveen Krishna R
*Is there  a concept of sub-apps exist in Django !?*
*I knew some concepts like independant reusable apps.*
*You can easily handle the rest with your urls right ?! correct me?
*
On Sun, Aug 21, 2011 at 6:27 PM, Subhranath Chunder wrote:

> Extend the manage.py functionality, by adding your custom command.
> https://docs.djangoproject.com/en/dev/howto/custom-management-commands/
>
>
> On Sun, Aug 21, 2011 at 8:52 PM, Jim  wrote:
>
>> Hello folks,
>>
>> Here is the story. I created a site, mysite, with this command django-admin
>> startproject mysite. Then, under the directory mysite/, I created an app
>> named apps with this command ./manage.py startapp apps. apps is meant to
>> hold all applications for mysite. Now, here comes the question:
>> *How do I create a sub-app under apps with manage.py directly?*
>>
>> I tried
>> ../manage.py startapp someapp
>> under apps/, but that created the someapp under mysite/ rather than under
>> apps/.
>>
>> I also tried
>> ./manage.py startapp apps/someapp
>> and
>> ./manage.py startapp apps.someapp
>> under mysite/, but neither worked.
>>
>> So, my current work-around is to create a sub-app under mysite/ first,
>> then move it into apps/ manually. But that seems dumb, and I suspect there
>> is a simpler way to do this.
>>
>> Thanks for reading this. Any help is certainly appreciated.
>>
>> Jim
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/QtvEmvU5QvMJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Thanks,
> Subhranath Chunder.
> www.subhranath.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

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



Re: How to create a sub-app directly

2011-08-21 Thread Subhranath Chunder
Extend the manage.py functionality, by adding your custom command.
https://docs.djangoproject.com/en/dev/howto/custom-management-commands/


On Sun, Aug 21, 2011 at 8:52 PM, Jim  wrote:

> Hello folks,
>
> Here is the story. I created a site, mysite, with this command django-admin
> startproject mysite. Then, under the directory mysite/, I created an app
> named apps with this command ./manage.py startapp apps. apps is meant to
> hold all applications for mysite. Now, here comes the question:
> *How do I create a sub-app under apps with manage.py directly?*
>
> I tried
> ../manage.py startapp someapp
> under apps/, but that created the someapp under mysite/ rather than under
> apps/.
>
> I also tried
> ./manage.py startapp apps/someapp
> and
> ./manage.py startapp apps.someapp
> under mysite/, but neither worked.
>
> So, my current work-around is to create a sub-app under mysite/ first, then
> move it into apps/ manually. But that seems dumb, and I suspect there is a
> simpler way to do this.
>
> Thanks for reading this. Any help is certainly appreciated.
>
> Jim
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/QtvEmvU5QvMJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks,
Subhranath Chunder.
www.subhranath.com

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



How to create a sub-app directly

2011-08-21 Thread Jim
Hello folks,

Here is the story. I created a site, mysite, with this command django-admin 
startproject mysite. Then, under the directory mysite/, I created an app 
named apps with this command ./manage.py startapp apps. apps is meant to 
hold all applications for mysite. Now, here comes the question: 
*How do I create a sub-app under apps with manage.py directly?*

I tried 
../manage.py startapp someapp 
under apps/, but that created the someapp under mysite/ rather than under 
apps/. 

I also tried 
./manage.py startapp apps/someapp 
and 
./manage.py startapp apps.someapp
under mysite/, but neither worked.

So, my current work-around is to create a sub-app under mysite/ first, then 
move it into apps/ manually. But that seems dumb, and I suspect there is a 
simpler way to do this. 

Thanks for reading this. Any help is certainly appreciated.

Jim

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



Re: DB based translations?

2011-08-21 Thread Joshua Russo
Ooo that looks like what I'm looking for. Thanks for the tip. 

Do you have any experience with it?

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



Re: Port of Django Template Language to PHP

2011-08-21 Thread Rune Kaagaard
@Yaşar: Thanks a lot, would love to see the post if you really do write it!

@Kenneth+@Masklinn: You are right, there are a lot of template
languages already, but this particular wheel is - unlike twig - not a
compiled language but implemented in pure PHP as an Iterator, allowing
it to blend in as an extension to your existing PHP templates.

Thanks for your interest!

On Sun, Aug 21, 2011 at 4:09 AM, kenneth gonsalves
 wrote:
> On Sat, 2011-08-20 at 21:28 +0200, Masklinn wrote:
>> > Those of you moonlighting in PHP, might be interested in a pure PHP
>> > port of the Django Template Language that I've just released. It's
>> > called Chano and has doc pages at http://chano.readthedocs.org and a
>> > github account at https://github.com/runekaagaard/php-chano .
>> This sounds like a huge duplication of effort: there's already
>> Twig[0],
>> a port of Jinja2[1] which is basically a reimplementation and
>> extension
>> of Django's own templating language.
>
> if people did not keep reinventing the wheel we would be still in the
> age of oxcarts.
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: extending the User profile - which way to go?

2011-08-21 Thread Matt Schinckel
You haven't really provided a reason why to 'do it the django way', rather 
than inheriting from User.

You do make a valid point about the separate data being in a different 
table: the difference would be that with using UserProfile, you need to 
either do the .select_related() yourself, of have a second db query when you 
do a .get_profile(). With the inheritance method, django will do the joins 
for you.

This may actually bite: there are some circumstances where a join is more 
expensive than a second query. In either case, right now is probably not the 
time to worry about it. Wait until it becomes a performance issue.

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



Re: Import problem

2011-08-21 Thread Cal Leeming [Simplicity Media Ltd]
I could be wrong but ,i dont think the word 'global' is allowed anywhere in
a file name ,import reference, class name etc.. i could be wrong tho. Try
with global2 ??
On Aug 21, 2011 2:10 PM, "Jim"  wrote:
> Hello folks,
>
> I am new to both Python and Django. And the story is a little long. So,
> please bear with me.
>
> Recently I created a site named djangoSite to practice the Django
framework.
> The first thing I want to do is to create a SQLite database to hold global

> data of the site. As simple as it sounds, the actual process I went
through
> wasn't so simple.
>
> First, I created an apps/ subdirectory under djangoSite/ to hold all
> potential applications I may have. Then, I created an empty file
__init__.pyto makeapps/a package.Then, I wanted to create an app
> global to make models for holding global data. I tried the following to do

> this.
> djangoSite/ >$ cd apps
> apps/ >$ ../manage.py startapp global
> It turns out the app global was created under djangoSite/ rather than
under
> apps/. So, here is one question. *How do I create a sub-app under apps/
with
> manage.py?* Anyway, I didn't stop there. I moved the folder global/ into
> apps/. I assumed that this would make global a subapp of apps, so that
> something like this would work under manage.py shell: import apps.global.
> However, I didn't test it right after moving the folder global/, which I
> should have. Instead, I proceeded and created a model in
> apps/global/models.py named NavItem. Then, I added
'djangoSite.apps.global'
> to settings.INSTALLED_APPS.
>
> Then, I added a SQLite3 database 'global' in settings.DATABASES, and
created
> a Python file dbrouter.py under djangoSite/, in which I created a class
> DBRouter to route the databases. Accordingly, I added DATABASE_ROUTERS =
> ['djangoSite.dbrouter.DBRouter'] to settings.py. Here is another question.

> When creating the class DBRouter, I basically copied the example (only the

> master class) in the Django documentation Multiple Databases<
https://docs.djangoproject.com/en/dev/topics/db/multi-db/#topics-db-multi-db-routing>.

> It seems to me the newly created routing class, which is DBRouter in my
> case, inherits a class named object, because of this statement: class
> DBRouter(object). However, the example in the document I mentioned earlier

> doesn't import anything at all, so the question is *where this class
> 'object' come from*?
>
> Anyway, I kept moving. Under djangoSite/, I ran ./manage.py validate,
which
> gave 0 error. Then, I ran ./manage.py syncdb. And I got a bunch of errors.
I
> suspected that the database routing may not work. So, commented out the
> DATABASE_ROUTERS settings, and ran ./manage.py syncdb again. This time, it

> went through without errors. Now I am guessing that I need to import
> something to make DBRouter work.
>
> So I started tracking down the problem. I invoked manage.py shell, and
> wanted to create an instance of NavItem. I tried the following import
> statements, but none of these worked. All of the them get a syntax error.
> Here thery are.
>
 from apps.global.models import NavItem
> File "", line 1
> from apps.global.models import NavItem
> ^
> SyntaxError: invalid syntax
 from global.models import NavItem
> File "", line 1
> from global.models import NavItem
> ^
> SyntaxError: invalid syntax
 from djangoSite.apps.global.models import NavItem
> File "", line 1
> from djangoSite.apps.global.models import NavItem
> ^
> SyntaxError: invalid syntax
 from global.models import NavItem
> File "", line 1
> from global.models import NavItem
> ^
> SyntaxError: invalid syntax
>
>
> Now I am running out of ideas about what went wrong. I know this is a bit
> long, so I really appreciate your help. Thank you very much.
>
> Jim
>
>
>
> , I also created and an subdirectory apps to hold all my django
> applications. I created an empty file __init__.py to make the folder apps
a
> package. Then, I meant to create an app named global to hold global data
of
> the site.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/3cTQeJLV05gJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>

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



Re: FW: MySQLdb version doesn't match _mysql version

2011-08-21 Thread Ramiro Morales
On Sun, Aug 21, 2011 at 5:08 AM, Hadassa Golovenshitz  wrote:
>
>
> Hi everyone,
>
> Thank you for taking the time to look at my question.
>
>
>
> I’m setting up a django project that I got from a code repository, and in
> trying to run ./manage.py syncdb I get the following error:
>
>
>
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
> this is MySQLdb version (1, 2, 3, 'final', 0), but _mysql is version (1, 2,
> 2, 'final', 0).

Seems you mysqldb (the Python DB-API 2.0 compatible library to access
MySQL databases) installation is borked.

mysqldb is composed of two layers:

_mysql is a low level one, a more or less thin wrapper over the C mysql client
libraries.

On top of that there is mysldb itself, that uses the services of _mysql
and implemets the DB-API specification.

You seem to have a a corrupt copy because both pieces are released together,
and when a correct installation has been performed, they are built and installed
together with matching version IDs.

You might find better answers in a mailing list or IRC channel
devoted to mysqldb. This isn't a Django -related or -specific issue.

Regards,

-- 
Ramiro Morales

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



Re: Newbe DateTimeField Question

2011-08-21 Thread dm03514
you can set default=None, that way you don't have to explicityly save
that value as none every time you save an object.

On Aug 21, 7:33 am, Torsten  wrote:
> Hi
>
> I simply want the DateTime to be set to null.
>
> payed_at = models.DateTimeField(null=True)
>
> but always get this as an error:
>
> IntegrityError at /admin/invoice/invoice/add/
> invoice_invoice.payed_at may not be NULL
>
> Thanks for help.
>
> Torsten

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



Newbe DateTimeField Question

2011-08-21 Thread Torsten
Hi

I simply want the DateTime to be set to null.

payed_at = models.DateTimeField(null=True)

but always get this as an error:

IntegrityError at /admin/invoice/invoice/add/
invoice_invoice.payed_at may not be NULL


Thanks for help.

Torsten

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



FW: MySQLdb version doesn't match _mysql version

2011-08-21 Thread Hadassa Golovenshitz
 

Hi everyone,

Thank you for taking the time to look at my question.

 

I'm setting up a django project that I got from a code repository, and in
trying to run ./manage.py syncdb I get the following error:

 

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
this is MySQLdb version (1, 2, 3, 'final', 0), but _mysql is version (1, 2,
2, 'final', 0).

 

I get the same error when running import MySQLdb at the python command line
interpreter. Does anyone have any ideas? I've spent hours searching for
similar posts, but no solutions seem to help me.

 

I'd appreciate any suggestions!



__ Information from ESET NOD32 Antivirus, version of virus signature
database 6397 (20110821) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

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



Import problem

2011-08-21 Thread Jim
Hello folks,

I am new to both Python and Django. And the story is a little long. So, 
please bear with me. 

Recently I created a site named djangoSite to practice the Django framework. 
The first thing I want to do is to create a SQLite database to hold global 
data of the site. As simple as it sounds, the actual process I went through 
wasn't so simple. 

First, I created an apps/ subdirectory under djangoSite/ to hold all 
potential applications I may have. Then, I created an empty file __init__.pyto 
makeapps/a package.Then, I wanted to create an app 
global to make models for holding global data. I tried the following to do 
this.
djangoSite/ >$ cd apps
apps/ >$ ../manage.py startapp global
It turns out the app global was created under djangoSite/ rather than under 
apps/. So, here is one question. *How do I create a sub-app under apps/ with 
manage.py?* Anyway, I didn't stop there. I moved the folder global/ into 
apps/. I assumed that this would make global a subapp of apps, so that 
something like this would work under manage.py shell: import apps.global. 
However, I didn't test it right after moving the folder global/, which I 
should have. Instead, I proceeded and created a model in 
apps/global/models.py named NavItem. Then, I added 'djangoSite.apps.global' 
to settings.INSTALLED_APPS.

Then, I added a SQLite3 database 'global' in settings.DATABASES, and created 
a Python file dbrouter.py under djangoSite/, in which I created a class 
DBRouter to route the databases. Accordingly, I added DATABASE_ROUTERS = 
['djangoSite.dbrouter.DBRouter'] to settings.py. Here is another question. 
When creating the class DBRouter, I basically copied the example (only the 
master class) in the Django documentation Multiple 
Databases.
 
It seems to me the newly created routing class, which is DBRouter in my 
case, inherits a class named object, because of this statement: class 
DBRouter(object). However, the example in the document I mentioned earlier 
doesn't import anything at all, so the question is *where this class 
'object' come from*? 

Anyway, I kept moving. Under djangoSite/, I ran ./manage.py validate, which 
gave 0 error. Then, I ran ./manage.py syncdb. And I got a bunch of errors. I 
suspected that the database routing may not work. So, commented out the 
DATABASE_ROUTERS settings, and ran ./manage.py syncdb again. This time, it 
went through without errors. Now I am guessing that I need to import 
something to make DBRouter work. 

So I started tracking down the problem. I invoked manage.py shell, and 
wanted to create an instance of NavItem. I tried the following import 
statements, but none of these worked. All of the them get a syntax error. 
Here thery are.

>>> from apps.global.models import NavItem
  File "", line 1
from apps.global.models import NavItem
   ^
SyntaxError: invalid syntax
>>> from global.models import NavItem
  File "", line 1
from global.models import NavItem
  ^
SyntaxError: invalid syntax
>>> from djangoSite.apps.global.models import NavItem
  File "", line 1
from djangoSite.apps.global.models import NavItem
  ^
SyntaxError: invalid syntax
>>> from global.models import NavItem
  File "", line 1
from global.models import NavItem
  ^
SyntaxError: invalid syntax


Now I am running out of ideas about what went wrong. I know this is a bit 
long, so I really appreciate your help. Thank you very much.

Jim



, I also created and an subdirectory apps to hold all my django 
applications. I created an empty file __init__.py to make the folder apps a 
package. Then, I meant to create an app named global to hold global data of 
the site. 

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



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

2011-08-21 Thread Subhranath Chunder
No, it's working is not a mistake by itself. Because now, the regular
expression is extracting an absolute path, and not a relative url path.

But, you are surely using things "the wrong way". :)


On Sun, Aug 21, 2011 at 4:57 PM, Andre Lopes  wrote:

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


-- 
Thanks,
Subhranath Chunder.
www.subhranath.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" 

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

2011-08-21 Thread Andre Lopes
Hi,

Thanks for the reply.

I have discovered that If I use this:

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

Instead of:

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

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

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


PS: Sorry my english.

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

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



Re: DB based translations?

2011-08-21 Thread rebus_
On 21 August 2011 04:41, Joshua Russo  wrote:
> Ok, I've been looking into the different database based translation
> solutions out there and I can't find what I really had in mind. I need to
> have non-technical people easily update the translations. So I wanted a
> solution where I could create an interface to ease the process.
> One problem is that none of the solutions seem to talk about translating
> static text. I'm thinking I need to create a site_content table to handle my
> static text translations and then use one of these solutions against it.
>
> If this is an appropriate solution, what are people's experience with the
> different database driven translation solutions? I tried
> django_multilingual, and django_multilingual_ng but they seemed to have
> issues with South. (Of course that was a few months back and I can't
> remember the exact problems I was having.) I'm now looking at
> django_modeltranslation, but none of these products really give the
> impression of being production worthy.
> I'm willing to give them a shot because I need something and it's small
> enough project that I can take a little more risk. What are people's
> experience with them?
> Thanks in advance
> Josh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/4sSq3y1mGKcJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

Check django-datatrans [0] out

[0] https://github.com/citylive/django-datatrans

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



Re: why i cannot load css from django lib?

2011-08-21 Thread smith jack
Thank you, but i am not using django with apache, but with python
manage.py runserver command, i find it confused, if i set the debug
mode to be true, then things may go well, what happened?

2011/8/21 zhijun wu :
> I've encountered such a problem, so maybe I can help.
> I solved that like this:
> First, make sure you have the right permission to the folder 'media'.
> Then,
> #setting.py
> MEDIA_ROOT='' #Use absolute path
> ADMIN_MEDIA_PAREFIX='' #'/media/', focus on the 2 slashs
> #httpd.conf
>
> Alias /media
> /usr/local/lib/python2.6/site-packages/django/contrib/admin/media  #end
> without slash
>
>   "/usr/local/lib/python2.6/site-packages/django/contrib/admin/media">
> #absolute path
>
> AllowOverride None
>
> Options None
>
> Order allow,deny
>
> Allow from all
>
> 
>
>   #2 slashs
>
> SetHandler None
>
> 
>
>  
>
> SetHandler None
>
> 
>
> 2011/8/21 smith jack 
>>
>> face a strange problem, now i am using django.contrib.admin module
>> with its default page, but i cannot load css code now, so the web page
>> is ugly
>> what's wrong?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

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



Re: why i cannot load css from django lib?

2011-08-21 Thread zhijun wu
I've encountered such a problem, so maybe I can help.
I solved that like this:

First, make sure you have the right permission to the folder 'media'.

Then,
#setting.py
MEDIA_ROOT='' #Use absolute path
ADMIN_MEDIA_PAREFIX='' #'/media/', focus on the 2 slashs

#httpd.conf

Alias /media
/usr/local/lib/python2.6/site-packages/django/contrib/admin/media #end
without slash

 
#absolute path

AllowOverride None

Options None

Order allow,deny

Allow from all



  #2 slashs

SetHandler None



 

SetHandler None



2011/8/21 smith jack 

> face a strange problem, now i am using django.contrib.admin module
> with its default page, but i cannot load css code now, so the web page
> is ugly
> what's wrong?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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