How to merge TinyMCE to django flatpage

2010-06-19 Thread Steven Han
Hi,

I am reading the book of .
I want to merge a simple rich-text editor to flatpage following the chapter
3.

In the url.py ,I have added the link to the urlpatterns. like this:

urlpatterns = patterns('',
(r'^admin/',inlcude(admin.site.urls)),

(r'^tiny_mce/(?P.*)$','django.views.static.serve',{'document_root':'
c:\django_workspace\cms\js\tiny_mce\\'}),
)

// the tiny_mce.js is under the path c:\django_workspace\cms\js\tiny_mce\

and then add the js script in the
templates\admin\flatpage\flatpages\change_form.html
under the {{media}} :



tinyMCE.init(
{mode:"textaresa",
theme:"simple"
}
);



and then run the server . but no useful.

who can tell me how to fix this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 setup the django progject to apache2

2011-05-01 Thread Steven Han
Hi,

I want to develop Django on the Apache2 server. And I have follow the some
instruction about how to setup django app on the apache2 server.
but allows failed.

My system is Ubuntu 10.10. what my step as below:

(1)  sudo apt-get install apache2
(2) sudo apt-get install libapache2-mod-wsgi

when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
and wsgi.load file under the path /etc/apache2/mods-enabled
So Apache2 and Mod_wsgi are installed.

My project "djcms" is under the path /home/zikey/Workspace/Django/djcms. And
the "settings.py" file is under djcms folder.
I modifed the file httpd.conf as below:(original file is empty)
##

ServerAdmin webmaster@localhost

WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
 
 AllowOverride None
Order deny,allow
allow from all
 



###

And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
The content of django.wsgi is like this:
###

import os
import sys

current_dir = os.path.dirname(__file__)

if current_dir not in sys.path:
sys.path.append(current_dir)

os.environ['DJANGO_SETTINGS_MODULE'] = "settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

###

But every time I run the URL http://127.0.0.1:9000
it always displays:
 "Oops! Google Chrome could not connect to 127.0.0.1:9000 "


:(
Do you know what I missed ?

Br,
Steven

-- 
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 setup the django progject to apache2

2011-05-01 Thread Steven Han
Btw, the url.py is like this:


from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView,ListView
from polls.models import Poll


# Uncomment the next two lines to enable the admin:

#zikey
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),

 
url(r'^polls/$',ListView.as_view(queryset=Poll.objects.order_by('-pub_date')[:5],
  context_object_name='latest_poll_list',


   template_name='polls/index.html')),
)

#########



2011/5/1 Steven Han 

> Hi,
>
> I want to develop Django on the Apache2 server. And I have follow the some
> instruction about how to setup django app on the apache2 server.
> but allows failed.
>
> My system is Ubuntu 10.10. what my step as below:
>
> (1)  sudo apt-get install apache2
> (2) sudo apt-get install libapache2-mod-wsgi
>
> when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
> and wsgi.load file under the path /etc/apache2/mods-enabled
> So Apache2 and Mod_wsgi are installed.
>
> My project "djcms" is under the path /home/zikey/Workspace/Django/djcms.
> And the "settings.py" file is under djcms folder.
> I modifed the file httpd.conf as below:(original file is empty)
>
> ##
> 
> ServerAdmin webmaster@localhost
>
> WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
>  
>  AllowOverride None
> Order deny,allow
> allow from all
>  
>
> 
>
>
> ###
>
> And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
> The content of django.wsgi is like this:
>
> ###
>
> import os
> import sys
>
> current_dir = os.path.dirname(__file__)
>
> if current_dir not in sys.path:
> sys.path.append(current_dir)
>
> os.environ['DJANGO_SETTINGS_MODULE'] = "settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
> ###
>
> But every time I run the URL http://127.0.0.1:9000
> it always displays:
>  "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
>
>
> :(
> Do you know what I missed ?
>
> Br,
> Steven
>
>

-- 
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 setup the django progject to apache2

2011-05-01 Thread Steven Han
no , I don't

And I can use pythom manage.py runserver to run the project.
But I just want to use the apache server.

After installing the apache. I didn't modify any files except the httpd.conf
file.


2011/5/1 Robbington 

> Bit confused matey,
>
> Do you have a domain name to serve those pages to?
>
> If you are just trying to run it from localhost, 127.0.0.1: why not
> just use the Django development server?
>
> Rob
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
I got the error like this:

Forbidden

You don't have permission to access / on this server.
--
Apache/2.2.16 (Ubuntu) Server at 127.0.0.1 Port 9000



when I modify the httpd.conf:

Listen 9000

ServerAdmin webmaster@localhost

WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
 DocumentRoot /home/zikey/Workspace/Django/djcms
 
AllowOverride None
 Order deny,allow
allow from all




2011/5/1 Gianluca Sforna 

> On Sun, May 1, 2011 at 12:41 PM, Steven Han  wrote:
> > But every time I run the URL http://127.0.0.1:9000
> > it always displays:
> >
> > "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
> >
> > :(
> > Do you know what I missed ?
>
> This is more an apache question than a django question, however I
> think you're missing to let the server actually listen on port 9000.
>
> Try adding a line like:
> Listen 9000
> outside your virtualhost directive.
>
> See http://httpd.apache.org/docs/2.2/bind.html#virtualhost for details
>
>
> --
> Gianluca Sforna
>
> http://morefedora.blogspot.com
> http://identi.ca/giallu - http://twitter.com/giallu
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: How to setup the django progject to apache2

2011-05-01 Thread Steven Han
under the /etc/apache2/sites-available ,there are two files "default" and
"default-ssl".
when I modify it as the httpd.conf, and the file "000-default" under the
/etc/apache2/sites-enables is updated automatically, and same as "default"
under the sites-available.

then empty the httpd.conf file。

the resault is also "403 Forbidden, no permission to access  "



2011/5/2 George Ajam 

> Did you tried to put your configuration in a file similar to default
> inside /etc/apache2/sites-available
> then try to make an enable to the site using a2ensite follwed by the
> name of your file, and I guess you should leave httpd.conf blank.
> Regards,
> George
>
> On May 1, 1:41 pm, Steven Han  wrote:
> > Hi,
> >
> > I want to develop Django on the Apache2 server. And I have follow the
> some
> > instruction about how to setup django app on the apache2 server.
> > but allows failed.
> >
> > My system is Ubuntu 10.10. what my step as below:
> >
> > (1)  sudo apt-get install apache2
> > (2) sudo apt-get install libapache2-mod-wsgi
> >
> > when I opened 127.0.0.1 . "It works!" displayed. And I can find wsgi.conf
> > and wsgi.load file under the path /etc/apache2/mods-enabled
> > So Apache2 and Mod_wsgi are installed.
> >
> > My project "djcms" is under the path /home/zikey/Workspace/Django/djcms.
> And
> > the "settings.py" file is under djcms folder.
> > I modifed the file httpd.conf as below:(original file is empty)
> >
> ###­###
> > 
> > ServerAdmin webmaster@localhost
> >
> > WSGIScriptAlias / /home/zikey/Workspace/Django/djcms/django.wsgi
> >  
> >  AllowOverride None
> > Order deny,allow
> > allow from all
> >  
> >
> > 
> >
> >
> ###­
> >
> > And put the django.wsgi file under /home/zikey/Workspace/Django/djcms.
> > The content of django.wsgi is like this:
> >
> ###­
> >
> > import os
> > import sys
> >
> > current_dir = os.path.dirname(__file__)
> >
> > if current_dir not in sys.path:
> > sys.path.append(current_dir)
> >
> > os.environ['DJANGO_SETTINGS_MODULE'] = "settings'
> >
> > import django.core.handlers.wsgi
> > application = django.core.handlers.wsgi.WSGIHandler()
> >
> >
> ###­
> >
> > But every time I run the URLhttp://127.0.0.1:9000
> > it always displays:
> >  "Oops! Google Chrome could not connect to 127.0.0.1:9000 "
> >
> > :(
> > Do you know what I missed ?
> >
> > Br,
> > Steven
>

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