Re: flatpage error

2008-12-16 Thread prem1er

Rebooted my server and started working for no reason.  Don't know what
was going on.

On Dec 16, 8:25 pm, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Tue, 2008-12-16 at 13:22 -0800, prem1er wrote:
> > Just walked through this 
> > guidehttp://docs.djangoproject.com/en/dev/ref/contrib/flatpages/?from=olddocs
> > to get a flatpage working on my site.  After trying to access my admin
> > page I am now getting an error while trying to log in.
>
> > In template /home/dev/djprojects/afterthebeep/djTemplates/admin/
> > base.html, error at line 25
>
> > Caught an exception while rendering: 'str' object has no attribute
> > 'regex'
>
> So somewhere you've made a mistake in following the instructions, since
> flatpages aren't inherently broken. All I can suggest is backing out the
> changes you made (or the ones you think/remember you made) and make sure
> things work again. Then go through the steps again very carefully.
>
> Regards,
> 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
-~--~~~~--~~--~--~---



flatpage error

2008-12-16 Thread prem1er

Just walked through this guide 
http://docs.djangoproject.com/en/dev/ref/contrib/flatpages/?from=olddocs
to get a flatpage working on my site.  After trying to access my admin
page I am now getting an error while trying to log in.

In template /home/dev/djprojects/afterthebeep/djTemplates/admin/
base.html, error at line 25

Caught an exception while rendering: 'str' object has no attribute
'regex'

{% trans 'Welcome,' %} {% if
user.first_name %}{{ user.first_name|escape }}{% else %}
{{ user.username }}{% endif %}. {% block userlinks %}{% url
django-admindocs-docroot as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %}{% trans 'Change password' %} / {% trans 'Log out' %}{%
endblock %}
--~--~-~--~~~---~--~~
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 + mail server

2008-12-15 Thread prem1er

Didn't know about this. Where do I set the EMAIL_HOST parameter?

On Dec 15, 1:35 pm, "Karen Tracey" <kmtra...@gmail.com> wrote:
> On Mon, Dec 15, 2008 at 1:01 PM, prem1er <michaelconso...@gmail.com> wrote:
>
> > Hey everyone,
> >   I'm trying to create a registration page on my website using Django
> > forms.  I just realized that I needed to install a mail server in
> > order to send confirmation messages to my users through the forms.
> > What type of setup is everyone using for this?  i.e. Postfix + mutt.
> > Thanks in advance.
>
> Why do you have to install a mail server?  Can you not simply set
> EMAIL_HOST, etc. to point to an existing mail server that you have access to
> and authority to send mail through?
>
> http://docs.djangoproject.com/en/dev/topics/email/
>
> Karen
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Django + mail server

2008-12-15 Thread prem1er

Hey everyone,
   I'm trying to create a registration page on my website using Django
forms.  I just realized that I needed to install a mail server in
order to send confirmation messages to my users through the forms.
What type of setup is everyone using for this?  i.e. Postfix + mutt.
Thanks in advance.
--~--~-~--~~~---~--~~
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: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er

w00t.  Thanks.  After a bunch more import statements I finally got it
working. Thanks again!!!

On Dec 9, 4:22 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Still no luck. I have this line added to the top of views.py.
>
> > from xxx.register.forms import ContactForm
>
> > It can't seem to find forms 'No module named forms'.
>
> Sorry, I misread your original post. For some reason you have put your
> form in your models.py, so that's what you'll need to import - ie
> from whatever.register.models import ContactForm
>
> I would however recommend keeping your forms in a forms.py file,
> separate from your models.
> --
> DR.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er

Still no luck. I have this line added to the top of views.py.

from xxx.register.forms import ContactForm

It can't seem to find forms 'No module named forms'.


On Dec 9, 3:45 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Thank you. That cleared that up. Now getting the error. "global name
> > 'ContactForm' is not defined" in my 'views.py' file.  Any ideas?
>
> Well, as with all Python code, if you define an object in one file and
> refer to it in another, you have to import it. So at the top of your
> views.py you'll need something like:
> from xxx.forms import ContactForm
>
> --
> DR.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: 'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er

Thank you. That cleared that up. Now getting the error. "global name
'ContactForm' is not defined" in my 'views.py' file.  Any ideas?

On Dec 9, 3:35 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Trying to follow along with the Form Tutorial on the Django site and
> > I'm running into a problem.  I keep getting the error page 'module'
> > object has not attribute 'ContactForm', when I just simply copy and
> > pasted the code from the tutorial into my models.py.  Here is my
> > source.  I feel like it has something to do with my urls.py since I'm
> > trying to use the template system.
> > 
> > Models.py
>
> > from django import forms
>
> > class ContactForm(forms.Form):
> >     subject = forms.CharField(max_length=100)
> >     message = forms.CharField()
> >     sender = forms.EmailField()
> >     cc_myself = forms.BooleanField(required=False)
> > 
> > urls.py
>
> > from django.conf.urls.defaults import *
> > from xxx django.contrib import admin
>
> > # Uncomment the next two lines to enable the admin:
> > #admin.autodiscover()
>
> > urlpatterns = patterns('xxx.register.views',
> >     (r'^$', 'ContactForm'),
>
> >     # Uncomment the next line to enable the admin:
> >     #(r'^admin/(.*)', admin.site.root),
>
> >     # Uncomment the admin/doc line below and add
> > 'django.contrib.admindocs'
> >     # to INSTALLED_APPS to enable admin documentation:
> >     # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> > )
> > 
> > views.py
>
> > def contact(request):
>
> 
>
> You're right in thinking the problem is in your urls.py. It's here:
>     urlpatterns = patterns('xxx.register.views',
>         (r'^$', 'ContactForm'),
>
> This is looking in the views.py for a view called 'ContactForm'. But
> your view isn't called that, it's called 'contact', so that's what you
> should put in the second line above.
>
> --
> DR.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



'module' object has no attribute 'ContactForm' (view does not exist)

2008-12-09 Thread prem1er

Trying to follow along with the Form Tutorial on the Django site and
I'm running into a problem.  I keep getting the error page 'module'
object has not attribute 'ContactForm', when I just simply copy and
pasted the code from the tutorial into my models.py.  Here is my
source.  I feel like it has something to do with my urls.py since I'm
trying to use the template system.

Models.py

from django import forms

class ContactForm(forms.Form):
subject = forms.CharField(max_length=100)
message = forms.CharField()
sender = forms.EmailField()
cc_myself = forms.BooleanField(required=False)

urls.py

from django.conf.urls.defaults import *
from xxx django.contrib import admin

# Uncomment the next two lines to enable the admin:
#admin.autodiscover()

urlpatterns = patterns('xxx.register.views',
(r'^$', 'ContactForm'),

# Uncomment the next line to enable the admin:
#(r'^admin/(.*)', admin.site.root),

# Uncomment the admin/doc line below and add
'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

)

views.py

def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST
data
if form.is_valid(): # All validation rules pass

subject = form.cleaned_data['subject']
message = form.cleaned_data['message']
sender = form.cleaned_data['sender']
cc_myself = form.cleaned_data['cc_myself']

recipients = ['[EMAIL PROTECTED]']

if cc_myself:
recipients.append(sender)

from django.core.mail import send_mail
send_mail(subject, message, sender, recipients)
return HttpResponseRedirect('/thanks/')

else:
form = ContactForm()

return render_to_response('contact.html', {'form': form,})




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Where are you developing your python?

2008-11-21 Thread prem1er

Just wondering where everyone is developing there pythong code?
Anyone using development environments, if so which 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: imagefield write error

2008-11-17 Thread prem1er

Ok, I figured that one out.  I should be writing to within my Django
project.  How would I get this to work with apache permission?

On Nov 17, 8:51 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Trying to write an image to my server for a user.  I keep getting the
> error 'SuspiciousOperation, Attempted access to '.../' denied.  I
> tried adding read write and execute permissions to this directory and
> still no luck.
>
> from django.db import models
>
> class user(models.Model):
>         avatar = models.ImageField(upload_to='/tmp')
>
>         def __unicode__(self):
>                 return self.userName
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



imagefield write error

2008-11-17 Thread prem1er

Trying to write an image to my server for a user.  I keep getting the
error 'SuspiciousOperation, Attempted access to '.../' denied.  I
tried adding read write and execute permissions to this directory and
still no luck.


from django.db import models

class user(models.Model):
avatar = models.ImageField(upload_to='/tmp')

def __unicode__(self):
return self.userName


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Python and/or django book

2008-11-17 Thread prem1er

I mean, yes they are always there, but I always like a good physical
reference.  I have experience in OO languages, but not much server-
side programming just a little ASP .Net.

On Nov 17, 3:09 pm, bruno desthuilliers
<[EMAIL PROTECTED]> wrote:
> On 17 nov, 20:53, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Just trying to figure out what the best book to purchase for a
> > newcomer to Django and python.
>
> Depends on your background...  But if you have prior experience with
> 1/ another (preferably but not necessarily object oriented) language
> and 2/ server-side web programming, the 'official' tutorials and docs
> might be enough.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Python and/or django book

2008-11-17 Thread prem1er

Just trying to figure out what the best book to purchase for a
newcomer to Django and python.  Thanks for your suggestions.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



polls tutorial question

2008-11-14 Thread prem1er

Trying to mess with the styling of the polls view from the tutorial.
Where is it reading it's CSS from?  Or where is it 'extending' its
style from.  I tried to incorporate a CSS sheet from within that
directory and it wouldn't read it.  It would only read HTML that I
placed in the document itself.  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: admin's media on apache

2008-11-12 Thread prem1er

Overlooked that. AMAZING thank you thank you!

On Nov 12, 4:36 pm, Brian Neal <[EMAIL PROTECTED]> wrote:
> On Nov 12, 3:32 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
>
>
> > Still having a problem from the other day.  I can't get the media (css
> > + images) to show up on my admin pages after I moved it over to
> > Apache.  I tried a sym link from /home/dev/Django-1.0/django/contrib/
> > admin/media/ to /home/dev/djprojects/xxx/media (my site root) and
> > still no luck.  I have also tried to add an Alias in my Apache
> > config.  Here is my Apache config as of now.  Anyone else have
> > suggestions I would appreciate it.
>
> > 
> >     ServerNamewww.dev.xxx.us
> >     ServerAlias dev.xxx.us
> >     DocumentRoot /home/dev/djprojects/xxx/
> >         
> >                 Options Indexes FollowSymLinks MultiViews
> >                 AllowOverride None
> >                 Order allow,deny
> >                 allow from all
> >                 AddHandler mod_python .py
> >                 PythonDebug On
> >         
> >         
> >                 SetHandler python-program
> >                 PythonHandler django.core.handlers.modpython
> >                 SetEnv DJANGO_SETTINGS_MODULE xxx.settings
> >                 PythonDebug On
> >                 PythonPath "['/home/dev/djprojects'] + sys.path"
> >         
> > 
>
> You still don't have a SetHandler None on your media directory. You
> need to let Apache serve your media, not django. 
> Seehttp://docs.djangoproject.com/en/dev/howto/deployment/modpython/#id1
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



admin's media on apache

2008-11-12 Thread prem1er

Still having a problem from the other day.  I can't get the media (css
+ images) to show up on my admin pages after I moved it over to
Apache.  I tried a sym link from /home/dev/Django-1.0/django/contrib/
admin/media/ to /home/dev/djprojects/xxx/media (my site root) and
still no luck.  I have also tried to add an Alias in my Apache
config.  Here is my Apache config as of now.  Anyone else have
suggestions I would appreciate it.



ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/djprojects/xxx/

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonDebug On


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE xxx.settings
PythonDebug On
PythonPath "['/home/dev/djprojects'] + sys.path"



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django not reading css after switch to apache

2008-11-11 Thread prem1er

No sorry that extra slash was removed and yes I did reload apache and
clear my cache on the browser.

On Nov 11, 3:09 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote:
> Alias /media /home/dev//Django-1.0/django/contrib/admin/media
>                                               ^
> could be that extra slash.  i assume you reloaded apache after the change?
>
> keith
>
> On Tue, Nov 11, 2008 at 2:55 PM, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Still no good.  Is this what you wanted me to do?
>
> > 
> >    ServerNamewww.dev.xxx.us
> >     ServerAlias dev.xxx.us
> >    DocumentRoot /home/dev/djprojects/xxx
> >     Alias /media /home/dev//Django-1.0/django/contrib/admin/media
> >         
> >                Options Indexes FollowSymLinks MultiViews
> >                AllowOverride None
> >                Order allow,deny
> >                allow from all
> >                AddHandler mod_python .py
> >                PythonDebug On
> >        
> >        
> >                SetHandler python-program
> >                PythonHandler django.core.handlers.modpython
> >                SetEnv DJANGO_SETTINGS_MODULE xxx.settings
> >                PythonDebug On
> >                PythonPath "['/home/dev/djprojects'] + sys.path"
> >        
> > 
>
> > On Nov 11, 2:29 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote:
> > > You can add an alias in the  directive that maps to where
> > the
> > > admin media files are.  Like so:
>
> > > Alias /media /home/dev//Django-1.0/django/contrib/admin/media
>
> > > keith
>
> > > On Tue, Nov 11, 2008 at 2:15 PM, prem1er <[EMAIL PROTECTED]>
> > wrote:
>
> > > > This is the location of my css files.  /home/dev//Django-1.0/django/
> > > > contrib/...
>
> > > > On Nov 11, 1:49 pm, prem1er <[EMAIL PROTECTED]> wrote:
> > > > > Just got django to work on apache thanks to everyone on this group.
> > > > > After I switched, I can no longer get the CSS to work with the admin
> > > > > page or the 'polls' from the tutorial.  Here is my apache config.
> > > > > When I run the same site from my localhost on django's server
> > > > > everything is fine.
>
> > > > > 
> > > > >     ServerNamewww.dev.xxx.us
> > > > >     ServerAlias dev.xxx.us
> > > > >     DocumentRoot /home/dev/djprojects/xxx
> > > > >         
> > > > >                 Options Indexes FollowSymLinks MultiViews
> > > > >                 AllowOverride None
> > > > >                 Order allow,deny
> > > > >                 allow from all
> > > > >                 AddHandler mod_python .py
> > > > >                 PythonDebug On
> > > > >         
> > > > >         
> > > > >                 SetHandler python-program
> > > > >                 PythonHandler django.core.handlers.modpython
> > > > >                 SetEnv DJANGO_SETTINGS_MODULE xxx.settings
> > > > >                 PythonDebug On
> > > > >                 PythonPath "['/home/dev/djprojects'] + sys.path"
> > > > >         
> > > > > 
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django not reading css after switch to apache

2008-11-11 Thread prem1er

Still no good.  Is this what you wanted me to do?


ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/djprojects/xxx
Alias /media /home/dev//Django-1.0/django/contrib/admin/media

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonDebug On


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE xxx.settings
PythonDebug On
PythonPath "['/home/dev/djprojects'] + sys.path"



On Nov 11, 2:29 pm, "Keith Eberle" <[EMAIL PROTECTED]> wrote:
> You can add an alias in the  directive that maps to where the
> admin media files are.  Like so:
>
> Alias /media /home/dev//Django-1.0/django/contrib/admin/media
>
> keith
>
> On Tue, Nov 11, 2008 at 2:15 PM, prem1er <[EMAIL PROTECTED]> wrote:
>
> > This is the location of my css files.  /home/dev//Django-1.0/django/
> > contrib/...
>
> > On Nov 11, 1:49 pm, prem1er <[EMAIL PROTECTED]> wrote:
> > > Just got django to work on apache thanks to everyone on this group.
> > > After I switched, I can no longer get the CSS to work with the admin
> > > page or the 'polls' from the tutorial.  Here is my apache config.
> > > When I run the same site from my localhost on django's server
> > > everything is fine.
>
> > > 
> > >     ServerNamewww.dev.xxx.us
> > >     ServerAlias dev.xxx.us
> > >     DocumentRoot /home/dev/djprojects/xxx
> > >         
> > >                 Options Indexes FollowSymLinks MultiViews
> > >                 AllowOverride None
> > >                 Order allow,deny
> > >                 allow from all
> > >                 AddHandler mod_python .py
> > >                 PythonDebug On
> > >         
> > >         
> > >                 SetHandler python-program
> > >                 PythonHandler django.core.handlers.modpython
> > >                 SetEnv DJANGO_SETTINGS_MODULE xxx.settings
> > >                 PythonDebug On
> > >                 PythonPath "['/home/dev/djprojects'] + sys.path"
> > >         
> > > 
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django not reading css after switch to apache

2008-11-11 Thread prem1er

This is the location of my css files.  /home/dev//Django-1.0/django/
contrib/...

On Nov 11, 1:49 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Just got django to work on apache thanks to everyone on this group.
> After I switched, I can no longer get the CSS to work with the admin
> page or the 'polls' from the tutorial.  Here is my apache config.
> When I run the same site from my localhost on django's server
> everything is fine.
>
> 
>     ServerNamewww.dev.xxx.us
>     ServerAlias dev.xxx.us
>     DocumentRoot /home/dev/djprojects/xxx
>         
>                 Options Indexes FollowSymLinks MultiViews
>                 AllowOverride None
>                 Order allow,deny
>                 allow from all
>                 AddHandler mod_python .py
>                 PythonDebug On
>         
>         
>                 SetHandler python-program
>                 PythonHandler django.core.handlers.modpython
>                 SetEnv DJANGO_SETTINGS_MODULE xxx.settings
>                 PythonDebug On
>                 PythonPath "['/home/dev/djprojects'] + sys.path"
>         
> 
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django not reading css after switch to apache

2008-11-11 Thread prem1er

Just got django to work on apache thanks to everyone on this group.
After I switched, I can no longer get the CSS to work with the admin
page or the 'polls' from the tutorial.  Here is my apache config.
When I run the same site from my localhost on django's server
everything is fine.


ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/djprojects/xxx

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonDebug On


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE xxx.settings
PythonDebug On
PythonPath "['/home/dev/djprojects'] + sys.path"



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-10 Thread prem1er

Hey everyone, thanks for all your help.

I'm currently able to get django running now on apache.  But the style
sheets aren't working so I'm guessing I have the paths wrong somewhere
in my apache config.  Anyone see a problem?  I feel like it has to do
with

PythonOption django.root /

When I have this line in the config the admin site doesn't work.  When
I don't the admin works, but with no style sheet.


On Nov 10, 7:19 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 10, 5:50 pm, "DULMANDAKH Sukhbaatar" <[EMAIL PROTECTED]>
> wrote:
>
> > > Ok.  But are the configuration lines any different or will they
> > > change.  If anyone has a good tutorial written could you please post
> > > it.  Also, What does this line mean ?
> > > SetEnv DJANGO_SETTINGS_MODULE mysite.settings
>
> > Seehttp://httpd.apache.org/docs/2.2/mod/mod_env.html. I suggest you
> > to do some research by yourself.
>
> Note that SetEnv in Apache is traditionally used for CGI scripts and
> would dictate what operating system environment variables are set in
> the separate process created to run the CGI script. It does not in
> itself change operating system environment variables for the Apache
> child worker processes where Django runs itself.
>
> When Django is run with mod_python however, Django is taking the
> variables set by SetEnv and forcibly updating os.environ and as a side
> affect also updating the operating system environment variables as
> well. This is actually somewhat bad practice for anything running
> directly under an Apache module as it will affect code running under
> other Apache modules as well, eg, PHP. Things can get even worse if
> running multiple Django instances in a multithreaded server
> configuration and setting overlapping sets of variables to different
> values as you can end up with race conditions on values of operating
> system environment variables as seen by C code or other Apache
> modules.
>
> In other words, it isn't that simple and Django in the long term
> should target getting rid of reliance on variables in os.environ.
>
> FWIW, with mod_wsgi anything defined using SetEnv only populates the
> per request WSGI environment dictionary and not the process level
> operating system environment variables. At this stage though, Django
> cannot use per request environment that WSGI provides and so manual
> step of setting os.environ still required. At least updating
> os.environ is only done once when WSGI script loaded and not on every
> request like mod_python.
>
> So, it isn't as simple as you may think. :-)
>
> Graham
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-10 Thread prem1er


ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/djprojects/xxx

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE xxx.settings
PythonOption django.root /
PythonDebug On
PythonPath "['/home/dev/djprojects/'] + sys.path"



Yes so I figured that part out.  And the settings file for Django is
finally being found!  BUT, when I try and go the the admin site to
login, I receive this error.

TypeError at admin

'NoneType' object is not iterable

Request Method: GET
Request URL:http://dev.xxx.usadmin
Exception Type: TypeError
Exception Value:

'NoneType' object is not iterable

Exception Location: /usr/lib/python2.5/site-packages/django/core/
handlers/base.py in get_response, line 77
Python Executable:  /usr/bin/python
Python Version: 2.5.2
Python Path:['/home/dev/djprojects/', '/usr/lib/python25.zip', '/usr/
lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/
lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/
site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/
python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/
PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/var/lib/python-
support/python2.5', '/usr/lib/python2.5/site-packages/gtk-2.0', '/var/
lib/python-support/python2.5/gtk-2.0']
Server time:Mon, 10 Nov 2008 15:55:35 -0600

I feel like it has to do with the line
Request URL:http://dev.xxx.usadmin

There is no trailing '/' between the subdomain and the admin
parameter.

On Nov 10, 4:06 pm, Brandon Martin <[EMAIL PROTECTED]> wrote:
> On Mon, 10 Nov 2008 12:55:44 -0800 (PST), prem1er
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > Ok this is where I'm at.  Here is my config file for sites-available.
>
> > 
> >     ServerNamewww.dev.xxx.us
> >     ServerAlias dev.xxx.us
> >     DocumentRoot /home/dev/djprojects/xxx
> >         
> >                 Options Indexes FollowSymLinks MultiViews
> >                 AllowOverride None
> >                 Order allow,deny
> >                 allow from all
> >                 AddHandler mod_python .py
> >                 PythonHandler mod_python.publisher
> >                 PythonDebug On
> >         
> >         
> >                 SetHandler python-program
> >                 PythonHandler django.core.handlers.modpython
> >                 SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> >                 PythonDebug On
> >                 PythonPath "['/home/dev/djprojects/xxx'] + sys.path"
> >         
> > 
>
> > And I'm getting this error.
>
> > Could not import settings 'mysite.settings' (Is it on sys.path? Does
> > it have syntax errors?): No module named mysite.settings
>
> > I understand that mysite.settings is supposed to be the location of my
> > settings.py, but is it just supposed to be the path of that file?
>
> Try removing the mysite part so it is juat
>
> SetEnv DJANGO_SETTINGS_MODULE settings
>
> --
> Brandon Martin
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-10 Thread prem1er

Ok this is where I'm at.  Here is my config file for sites-available.


ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/djprojects/xxx

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On


SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
PythonPath "['/home/dev/djprojects/xxx'] + sys.path"



And I'm getting this error.

Could not import settings 'mysite.settings' (Is it on sys.path? Does
it have syntax errors?): No module named mysite.settings

I understand that mysite.settings is supposed to be the location of my
settings.py, but is it just supposed to be the path of that file?


On Nov 10, 3:32 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Thanks for your replies everyone.  I'm looking into it more now and
> will let you know if I have any other questions.
>
> On Nov 10, 8:44 am, Brandon Martin <[EMAIL PROTECTED]> wrote:
>
> > I would just like to note here that when I first installed django with
> > apache and mod_python most of the problem I had was on the apache side
> > with vhosts not django. Each operating system handles apache configs a
> > little different. The guide on django's web site is great for the base
> > information. You just might need to adjust slightly for you OS.
>
> > Steve Holden wrote:
> > > If you read your httpd.conf file you will find at some point there is a
> > > line that includes the configuration data from the sites-enabled
> > > directory. This idea is to be able to switch sites on and off by adding
> > > and removing symbolic links from sites-enabled.
>
> > > Make sure you *always* edit the files in sites-available! If you edit in
> > > site-enabled, some editors will replace the original symbolic link in
> > > sites-enabled with an updated copy of the file itself, and then you will
> > > lose you configuration data if you decide to switch the site off
> > > temporarily ...
>
> > > The configuration commands are exactly the same for a configuration
> > > sub-file: it's exactly as though they had appeared in the main
> > > configuration file at the point of inclusion, so once you understand the
> > > relationship between the sites-available and sites-enabled directories
> > > and your main configuration file you should be good to go.
>
> > > You *could* put the configuration commands in http.conf itself, but this
> > > goes against the Debian/Ubuntu organization scheme, and so probably
> > > wouldn't be helpful long-term.
>
> > > The Django setup instructions aren't bad, but there are so many
> > > different ways that Apache is organized that the authors couldn't hope
> > > to cover them all.
>
> > > regards
> > >  Steve
>
> > >> On Nov 9, 10:33 pm, "DULMANDAKH Sukhbaatar" <[EMAIL PROTECTED]>
> > >> wrote:
>
> > >>> Please follow instructions 
> > >>> onhttp://docs.djangoproject.com/en/dev/howto/deployment/modpython/to
> > >>> setup django and mod_python.
>
> > >>> And it's interesting that how do you know that mod_python is working?
>
> > >>> --
> > >>> Regards
> > >>> Dulmandakh
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-10 Thread prem1er

Thanks for your replies everyone.  I'm looking into it more now and
will let you know if I have any other questions.

On Nov 10, 8:44 am, Brandon Martin <[EMAIL PROTECTED]> wrote:
> I would just like to note here that when I first installed django with
> apache and mod_python most of the problem I had was on the apache side
> with vhosts not django. Each operating system handles apache configs a
> little different. The guide on django's web site is great for the base
> information. You just might need to adjust slightly for you OS.
>
> Steve Holden wrote:
> > If you read your httpd.conf file you will find at some point there is a
> > line that includes the configuration data from the sites-enabled
> > directory. This idea is to be able to switch sites on and off by adding
> > and removing symbolic links from sites-enabled.
>
> > Make sure you *always* edit the files in sites-available! If you edit in
> > site-enabled, some editors will replace the original symbolic link in
> > sites-enabled with an updated copy of the file itself, and then you will
> > lose you configuration data if you decide to switch the site off
> > temporarily ...
>
> > The configuration commands are exactly the same for a configuration
> > sub-file: it's exactly as though they had appeared in the main
> > configuration file at the point of inclusion, so once you understand the
> > relationship between the sites-available and sites-enabled directories
> > and your main configuration file you should be good to go.
>
> > You *could* put the configuration commands in http.conf itself, but this
> > goes against the Debian/Ubuntu organization scheme, and so probably
> > wouldn't be helpful long-term.
>
> > The Django setup instructions aren't bad, but there are so many
> > different ways that Apache is organized that the authors couldn't hope
> > to cover them all.
>
> > regards
> >  Steve
>
> >> On Nov 9, 10:33 pm, "DULMANDAKH Sukhbaatar" <[EMAIL PROTECTED]>
> >> wrote:
>
> >>> Please follow instructions 
> >>> onhttp://docs.djangoproject.com/en/dev/howto/deployment/modpython/to
> >>> setup django and mod_python.
>
> >>> And it's interesting that how do you know that mod_python is working?
>
> >>> --
> >>> Regards
> >>> Dulmandakh
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-09 Thread prem1er

Ok.  But are the configuration lines any different or will they
change.  If anyone has a good tutorial written could you please post
it.  Also, What does this line mean ?
SetEnv DJANGO_SETTINGS_MODULE mysite.settings

Thanks.


On Nov 9, 11:56 pm, "DULMANDAKH Sukhbaatar" <[EMAIL PROTECTED]>
wrote:
> > Thank you, but as I've mentioned I have tried to follow these
> > instructions and have had no luck.  Why is it instructing me to
> > configure my httpd.conf file when my sub domain exists in sites-
> > available/sites-enabled?
>
> It seems that you use Debian based distro. Debian based systems have
> separate site files instead of one big config file. And you should do
> it that way. You may consider using default or you 
> own.https://help.ubuntu.com/8.04/serverguide/C/httpd.html
>
> --
> Regards
> Dulmandakh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: apache and django

2008-11-09 Thread prem1er

Thank you, but as I've mentioned I have tried to follow these
instructions and have had no luck.  Why is it instructing me to
configure my httpd.conf file when my sub domain exists in sites-
available/sites-enabled?  I know that mod_python is working because I
set up a test .py file that displays correctly on the sub domain that
I want Django to run on. Here is a copy of my sites-available file.
This is the domain where I want django to run on.  The files for
django are located at /home/dev/djprojects/afterthebeep.  Thanks.


ServerName www.dev.xxx.us
ServerAlias dev.xxx.us
DocumentRoot /home/dev/public_html

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On





On Nov 9, 10:33 pm, "DULMANDAKH Sukhbaatar" <[EMAIL PROTECTED]>
wrote:
> Please follow instructions 
> onhttp://docs.djangoproject.com/en/dev/howto/deployment/modpython/to
> setup django and mod_python.
>
> And it's interesting that how do you know that mod_python is working?
>
> --
> Regards
> Dulmandakh
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



apache and django

2008-11-09 Thread prem1er

Hey everyone,
   I'm new to django and python, but I have just completed the
tutorial with everything up and running correctly.  I'm trying to move
django over to apache for further development at dev.mysite.com.  I
have have looked at the documentation on the django site and also at
others from around the net, with no luck.  My mod_python is working
fine on the dev.mysite.com, but I can't figure out for the life of me
how to get django working on it.  Any suggestions or good tutorials
that you know about could you please let me know.  If you need any
more information from me such as my apache configs or django directory
structure let me know.  Thanks in advance.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---