Re: Blog styling

2019-12-26 Thread sagar podilapu
Good luck. Now what help do you need?

On Thu, Dec 26, 2019 at 6:34 PM Anwar Ali  wrote:

> Hi guys,
>
> I am converting my site to A.I blog so I wanna know what styles of writing
> and options I have for giving my blog a decent look like many WordPress
> blogs have ... like styling, writing options in comments and posts etc.
>
>
> Thanks in advance
>
> Annu
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2b578808-1577-478c-8431-c4055e58bf31%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABZR%2BaM-%3DS0KEHn%3D192FDSPiQ_s5WOtunHtfsmq2EAvEnbx_cQ%40mail.gmail.com.


Re: no styling

2018-04-09 Thread James Farris
Hi Paul,

Have you read this part of the docs? 
https://docs.djangoproject.com/en/2.0/howto/static-files/

You will need a static files directory and will need to tell Django where it is 
In settings.py

Sent from my mobile device

> On Apr 9, 2018, at 5:04 AM, Paul Baforh  wrote:
> 
> Please, my django development page is without css. How do I go about it. 
> Thanks
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8ff37f92-652c-4380-88fa-67b609147638%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C21BA56C-F7FD-45A1-9EFD-5F13470F40F6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No styling in Chapter 6 in djangobook

2013-05-21 Thread djingo django
Thanks, Mike, for your reply.

This turned to be a very common problem...

Following your suggestion, I checked the page source (I am running
Safari browser on OSX 10.8) and indeed saw the references to the CSS
stylesheets:

Site administration | Django site admin



That, as well as your explanation, helped me realize that it was
looking for some STATIC directory, specified by variables such as
STATIC_ROOT or STATICFILES_DIR.

As I am running the built-in Django webserver, using,

   python manage.py runserver

I had expected it to be able to find its own stylesheets, and was
perplexed as to why it was unable to. I checked with the Django
documentation once again, at

https://docs.djangoproject.com/en/dev/howto/static-files/

and noticed that it states:

   Configuring static files

   1. Make sure that django.contrib.staticfiles is included in your
INSTALLED_APPS.

That was it. I uncommented 'django.contrib.staticfiles', and lo and
behold, the admin pages are now styled properly because the
application can now find the STATIC directory containing the required
CSS files.

The Djangobook.com chapter does not mention this step in its
description of how to activate the admin interface

---
Activating the Admin Interface

The Django admin site is entirely optional, because only certain types
of sites need this functionality. That means you’ll need to take a few
steps to activate it in your project.

First, make a few changes to your settings file:

Add 'django.contrib.admin' to the INSTALLED_APPS setting. (The order
of INSTALLED_APPS doesn’t matter, but we like to keep things
alphabetical so it’s easy for a human to read.)
Make sure INSTALLED_APPS contains 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.messages' and
'django.contrib.sessions'. The Django admin site requires these three
packages. (If you’re following along with our ongoing mysite project,
note that we commented out these four INSTALLED_APPS entries in
Chapter 5. Uncomment them now.)


so perhaps that portion of the book should be updated to make certain
that django.contrib.staticfiles' also gets uncommented.

Many thanks for your helpful comments. They led me to finding out how
STATIC files were organized in Django.



On May 20, 10:02 pm, Mike Dewhirst  wrote:
> On 21/05/2013 11:07am, djingo django wrote:
>
>
>
> > I'm starting to learn Django and have been reading through the
> > djangobook.com. I am able to get the code running when  I come to
> > Chapter 6: The Django Admin Site, but it looks nothing like the
> > well-formed and well-styled screenshots in the documentation. The text
> > appears ragged and unstyled.
>
> > Am I missing a CSS stylesheet to make the admin interface line up and
> > get styled properly? How can I fix this?
>
> Yes. If you "View page source" in your browser you should see something
> like this ...
>
> 
>  href="/static/admin/css/dashboard.css" />
>
> So if the stylesheets cannot be found, which web server are you using?
>
> If you are not using the Django dev server, you need to configure your
> web server to look for such static files in a particular location
> (defined in settings.py as STATIC_ROOT) then run "manage.py
> collectstatic" to put them there.
>
> https://docs.djangoproject.com/en/1.5/howto/static-files/
>
>
>
>
>
>
>
>
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group athttp://groups.google.com/group/django-users?hl=en.
> > For more options, visithttps://groups.google.com/groups/opt_out.

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




Re: No styling in Chapter 6 in djangobook

2013-05-20 Thread Mike Dewhirst

On 21/05/2013 11:07am, djingo django wrote:


I'm starting to learn Django and have been reading through the
djangobook.com. I am able to get the code running when  I come to
Chapter 6: The Django Admin Site, but it looks nothing like the
well-formed and well-styled screenshots in the documentation. The text
appears ragged and unstyled.

Am I missing a CSS stylesheet to make the admin interface line up and
get styled properly? How can I fix this?


Yes. If you "View page source" in your browser you should see something 
like this ...



href="/static/admin/css/dashboard.css" />


So if the stylesheets cannot be found, which web server are you using?

If you are not using the Django dev server, you need to configure your 
web server to look for such static files in a particular location 
(defined in settings.py as STATIC_ROOT) then run "manage.py 
collectstatic" to put them there.


https://docs.djangoproject.com/en/1.5/howto/static-files/



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




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




Re: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
Progress!! I had to add

Alias /adminmedia "/usr/lib/pymodules/python2.6/django/contrib/admin/media"

and set ADMIN_MEDIA_PREFIX to the same url /adminmedia/

I don't understand everything yet, and will probably have more problems
soon. But at least I got this far. Thanks for all the help!!

On Thu, Feb 17, 2011 at 1:10 PM, Mike Ramirez  wrote:

>  On Thursday, February 17, 2011 09:23:47 am you wrote:
>
> > I'm still having trouble. My directory structure is:
>
> >
>
> > /usr/local/www/static
>
> >
>
> > +- contrib/admin/media -- symlink to django/contrib/admin/media
>
> >
>
> > +- media/admin/base_site.html -- modified version of base_site.html
>
> >
>
> > I've tried every combination of the following, but nothing is working:
>
> >
>
> All you need here is the /usr/local/www/static any subdirectories here
> should be served as normal, like http://localhost/contrib/admin/media
>
> The admin template, You do not want it here. it should be in your template
> dir see the doc below this for that.
>
>
> http://docs.djangoproject.com/en/1.2/intro/tutorial02/#customize-the-admin-look-and-feel
>
> > DocumentRoot /usr/local/www/static
>
> > - does this need to be set at all?
>
> >
>
> No.
>
>  > Alias /media/ /usr/loca/www/static/...
>
> > - not quite sure which directory this should point to
>
> > - I've tried all sensible options, but none work
>
> >
>
> Should be the absolute path to where you store your project media.
>
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> > - Does this simply have to be equal to whatever URL is used in the Alias
>
> > directive above?
>
> >
>
> It needs to be another alias to the absolute path of the adminmedia.
>
> > Thank you.
>
> >
>
>  Ok, this is a setup I have working (when the site/backend isn't broken
> ;)), This one is meant to work with nginx as a gateway serving my media and
> proxying back to my apache config, but it should work fine without nginx.
> This is also mod_wsgi specific, but you can add mod_python settings.
>
>  Please read the comments, domain is the domain of this box. $USER is the
> username on the system. (these removed for security reasons).
>
>  
>
> # basics for named based virtual hosts
>
> ServerName priss.domain.com
>
> ServerAlias domain.homelinux.org
>
> ServerAdmin webmas...@domain.com
>
>  # this is the root url path.
>
> # I believe this can be omitted.. graham can verify or deny
>
> # either way it works as expected with this set
>
> ServerPath /
>
>  # custom log paths.
>
> ErrorLog
> /home/$USER/Server_Files/httpd/domain_com/apache/priss.domain.com.error_log
>
> CustomLog
> /home/$USER/Server_Files/httpd/domain_com/apache/priss.domain.com.access_log
> combined
>
>  # mod wsgi settings.
>
> # adjust threads per system.
>
> # wrap with the IfModule so I can also add mod_python directives
>
> # and let apache decide what to used based on the module loaded/used.
>
> 
>
> WSGIDaemonProcess blog user=$USER group=$USER threads=100
>
> WSGIDaemonProcess pastebin user=$USER group=$USER threads=100
>
>  # paster
>
> # this is a custom pastebin project that is served on a
>
> # subpath of the main url. this comes first before the main site
>
> # is served so that the main projects urls.py does not search
>
> # for this path
>
> # please note this is a completely different project served
>
> # as part of the main site.
>
> # (no control over subdomains on this box).
>
> #
>
>  WSGIScriptAlias /paster
> /home/srv/$USER/web/projects/pastebin/apache/paster.wsgi
>
>  
>
> # to make sure this runs in it's own interpretter.
>
> WSGIApplicationGroup pastebin
>
> Order deny,allow
>
> Allow from all
>
> 
>
>  # this is the main project/site served on the root of the urls path
>
> .
>
> WSGIScriptAlias / /home//srv/$USER/gufy/domain_com/apache/gm.wsgi
>
>  
>
> WSGIApplicationGroup blog
>
> Order deny,allow
>
> Allow from all
>
> 
>
>  
>
>  ### these are the parts you want.
>
>  # /media serves all my main projects media.
>
> # these do not conflict with WSGIScriptAlias
>
> # Alias has a higher precedence than WSGIScriptAlias.
>
> # MEDIA_ROOT = /var/www/htm/media
>
> #
>
> Alias /media /var/www/html/media
>
> 
>
> SetHandler None
>
> Order deny,allow
>
> Allow from all
>
> 
>
>  # this is the admin media.
>
> # ADMIN_MEDIA_URL = "/adminmedia/"
>
> # serves admin media for both projects.
>
> # /var/www/html/adminmedia is a copy of the django admin media found in
>
> # django/contrib/admin/media ... I'm not a fan of symlinks here.
>
> # But you can. make sure to set the right option.
>
> #
>
> Alias /adminmedia /var/www/html/adminmedia
>
> 
>
> SetHandler None
>
> Order deny,allow
>
> Allow from all
>
> 
>
>   # this handles all my paster projects media files.
>
> # like /media for the main project.
>
> Alias /paster/media /var/www/html/pastebinmedia
>
> 
>
> SetHandler None
>
> Order deny,allow
>
> Allow from all
>
> 
>
>  
>
>  HTH
>
> Mike
>
> --
>
> The closest to perfection a person ever comes is when he fills out a job
>
> application form.
>
> 

Re: site styling works with development server but not apache

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 09:23:47 am you wrote:
> I'm still having trouble. My directory structure is:
> 
> /usr/local/www/static
> 
> +- contrib/admin/media -- symlink to django/contrib/admin/media
> 
> +- media/admin/base_site.html -- modified version of base_site.html
> 
> I've tried every combination of the following, but nothing is working:
> 

All you need here is the /usr/local/www/static  any subdirectories here should 
be served as normal, like http://localhost/contrib/admin/media

The admin template,  You do not want it here. it should be in your template 
dir see the doc below this for that.  

http://docs.djangoproject.com/en/1.2/intro/tutorial02/#customize-the-admin-
look-and-feel

> DocumentRoot /usr/local/www/static
> - does this need to be set at all?
> 

No.


> Alias /media/ /usr/loca/www/static/...
> - not quite sure which directory this should point to
> - I've tried all sensible options, but none work
> 

Should be the absolute path to where you store your project media.

> ADMIN_MEDIA_PREFIX = '/media/'
> - Does this simply have to be equal to whatever URL is used in the Alias
> directive above?
> 
 It needs to be another alias to the absolute path of the adminmedia.
> Thank you.
> 


Ok, this is a  setup I have working (when the site/backend isn't broken ;)), 
This one is meant to work with nginx as a gateway serving my media and 
proxying back to my apache config, but it should work fine without nginx. This 
is also mod_wsgi specific, but you can add mod_python settings.

  Please read the comments, domain is the domain of this box. $USER is the 
username on the system. (these removed for security reasons).



# basics for named based virtual hosts
ServerName priss.domain.com
ServerAlias domain.homelinux.org
ServerAdmin webmas...@domain.com

 # this is the root url path.
 # I believe this can be omitted.. graham can verify or deny
# either way it works as expected with this set
ServerPath /

 # custom log paths.
ErrorLog
/home/$USER/Server_Files/httpd/domain_com/apache/priss.domain.com.error_log
CustomLog   
/home/$USER/Server_Files/httpd/domain_com/apache/priss.domain.com.access_log 
combined

# mod wsgi settings.
# adjust threads per system.
 # wrap with the IfModule so I can also add mod_python directives 
 # and let apache decide what to used based on the module loaded/used.

WSGIDaemonProcess blog user=$USER group=$USER threads=100
WSGIDaemonProcess pastebin user=$USER group=$USER threads=100

# paster
# this is a custom pastebin project that is served on a 
# subpath of the main url. this comes first before the 
main site
# is served so that the main projects urls.py does not 
search
# for this path
# please note this is a completely different project 
served 
# as part of the main site.  
# (no control over subdomains on this box).
#

WSGIScriptAlias /paster 
/home/srv/$USER/web/projects/pastebin/apache/paster.wsgi


 # to make sure this runs in it's own 
interpretter.
WSGIApplicationGroup pastebin
Order deny,allow
Allow from all


# this is the main project/site served on the root of 
the urls path
.
WSGIScriptAlias / /home//srv/$USER/gufy/domain_com/apache/gm.wsgi


WSGIApplicationGroup blog
Order deny,allow
Allow from all




### these are the parts you want.

 # /media serves all my main projects media.
 # these do not conflict with WSGIScriptAlias
 # Alias has a higher precedence than WSGIScriptAlias.
 # MEDIA_ROOT = /var/www/htm/media
#
Alias /media /var/www/html/media

SetHandler None
Order deny,allow
Allow from all


 # this is the admin media.  
 # ADMIN_MEDIA_URL = "/adminmedia/"
 # serves admin media for both projects.
 # /var/www/html/adminmedia is a copy of the django admin media found 
in 
 # django/contrib/admin/media ... I'm not a fan of symlinks here. 
 # But you can.  make sure to set the right option.
#
Alias /adminmedia /var/www/html/adminmedia

SetHandler None
Order deny,allow
Allow from all



# this handles all my paster projects media files.
# like /media for the main project.
Alias /paster/media /var/www/html/pastebinmedia

SetHandler None
Order deny,allow
Allow from all





HTH

Mike
-- 
The closest to perfection a person ever comes is when he fills out a job
application form.
-- Stanley J. Randall

-- 
You 

Re: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
I'm using WSGI and tried your suggestion, but something is still missing.
The generated HTML refers for example to a stylesheet
href="/media/css/base.css". But this is in the django install directory,
which is not being served. So I feel there has to be an Alias pointing
there. Even if I did that, I'm confused about how I can overlay the modified
base_site.html that the tutorial had us construct. My full VirtualHost
configuration is:


ServerAdmin user@foo

Alias /media "/usr/local/www/static/media/"

Order allow,deny
Allow from all


WSGIScriptAlias / /usr/local/www/scripts/sequme.wsgi

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined



Thanks for all the help!


On Thu, Feb 17, 2011 at 12:44 PM, Marcos Moyano wrote:

> This is the relevant VirtualHost configuration for admin media
>
> WSGI
> Alias /media "/usr/local/www/static/media/"
> 
> Order allow,deny
> Allow from all
> 
>
> MOD_PYTHON
>  
>SetHandler None
>   
>
> If this doesn't work perhaps you shoud could paste your VirtualHost
> configuration.
>
> Rgds,
> Marcos
>
>
>
> On Thu, Feb 17, 2011 at 2:23 PM, Ashish Agarwal wrote:
>
>> I'm still having trouble. My directory structure is:
>>
>> /usr/local/www/static
>> |
>> +- contrib/admin/media -- symlink to django/contrib/admin/media
>> |
>> +- media/admin/base_site.html -- modified version of base_site.html
>>
>> I've tried every combination of the following, but nothing is working:
>>
>> DocumentRoot /usr/local/www/static
>> - does this need to be set at all?
>>
>>  Alias /media/ /usr/loca/www/static/...
>> - not quite sure which directory this should point to
>> - I've tried all sensible options, but none work
>>
>> ADMIN_MEDIA_PREFIX = '/media/'
>> - Does this simply have to be equal to whatever URL is used in the Alias
>> directive above?
>>
>> Thank you.
>>
>>
>> On Thu, Feb 17, 2011 at 10:30 AM, Mike Ramirez wrote:
>>
>>>  On Thursday, February 17, 2011 07:14:16 am ashish wrote:
>>>
>>> > Hi all. I followed the tutorial to setup a basic django site and run
>>>
>>> > it with the development server. Everything looks fine. Then, I
>>>
>>> > configured to use apache. Everything seems to work except the styling.
>>>
>>> > The login and admin pages have no formatting. On IRC I was told the
>>>
>>> > issue is that the development server automatically serves the
>>>
>>> > necessary media, but that you have to explicitly configure apache to
>>>
>>> > serve static media.
>>>
>>> >
>>>
>>> > Okay, but which media needs to be served for the styling to work? I
>>>
>>> > have not found the answer in the docs. Thank you for any help.
>>>
>>>  normally the path assigned to MEDIA_ROOT and ADMIN_MEDIA ... see below
>>> for the configuration settings (pick your production environment)
>>>
>>> http://docs.djangoproject.com/en/1.2/howto/deployment
>>>
>>> Mike
>>>
>>> --
>>>
>>> If God had not given us sticky tape, it would have been necessary to
>>> invent it.
>>>
>>>  --
>>> 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.
>>
>
>
>
> --
> Some people, when confronted with a problem, think “I know, I'll use
> regular expressions.” Now they have two problems.
>
> Jamie Zawinski, in comp.emacs.xemacs
>
>  --
> 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: site styling works with development server but not apache

2011-02-17 Thread Marcos Moyano
This is the relevant VirtualHost configuration for admin media

WSGI
Alias /media "/usr/local/www/static/media/"

Order allow,deny
Allow from all


MOD_PYTHON
 
   SetHandler None
  

If this doesn't work perhaps you shoud could paste your VirtualHost
configuration.

Rgds,
Marcos



On Thu, Feb 17, 2011 at 2:23 PM, Ashish Agarwal wrote:

> I'm still having trouble. My directory structure is:
>
> /usr/local/www/static
> |
> +- contrib/admin/media -- symlink to django/contrib/admin/media
> |
> +- media/admin/base_site.html -- modified version of base_site.html
>
> I've tried every combination of the following, but nothing is working:
>
> DocumentRoot /usr/local/www/static
> - does this need to be set at all?
>
>  Alias /media/ /usr/loca/www/static/...
> - not quite sure which directory this should point to
> - I've tried all sensible options, but none work
>
> ADMIN_MEDIA_PREFIX = '/media/'
> - Does this simply have to be equal to whatever URL is used in the Alias
> directive above?
>
> Thank you.
>
>
> On Thu, Feb 17, 2011 at 10:30 AM, Mike Ramirez  wrote:
>
>>  On Thursday, February 17, 2011 07:14:16 am ashish wrote:
>>
>> > Hi all. I followed the tutorial to setup a basic django site and run
>>
>> > it with the development server. Everything looks fine. Then, I
>>
>> > configured to use apache. Everything seems to work except the styling.
>>
>> > The login and admin pages have no formatting. On IRC I was told the
>>
>> > issue is that the development server automatically serves the
>>
>> > necessary media, but that you have to explicitly configure apache to
>>
>> > serve static media.
>>
>> >
>>
>> > Okay, but which media needs to be served for the styling to work? I
>>
>> > have not found the answer in the docs. Thank you for any help.
>>
>>  normally the path assigned to MEDIA_ROOT and ADMIN_MEDIA ... see below
>> for the configuration settings (pick your production environment)
>>
>> http://docs.djangoproject.com/en/1.2/howto/deployment
>>
>> Mike
>>
>> --
>>
>> If God had not given us sticky tape, it would have been necessary to
>> invent it.
>>
>>  --
>> 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.
>



-- 
Some people, when confronted with a problem, think “I know, I'll use regular
expressions.” Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

-- 
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: site styling works with development server but not apache

2011-02-17 Thread Ashish Agarwal
I'm still having trouble. My directory structure is:

/usr/local/www/static
|
+- contrib/admin/media -- symlink to django/contrib/admin/media
|
+- media/admin/base_site.html -- modified version of base_site.html

I've tried every combination of the following, but nothing is working:

DocumentRoot /usr/local/www/static
- does this need to be set at all?

Alias /media/ /usr/loca/www/static/...
- not quite sure which directory this should point to
- I've tried all sensible options, but none work

ADMIN_MEDIA_PREFIX = '/media/'
- Does this simply have to be equal to whatever URL is used in the Alias
directive above?

Thank you.


On Thu, Feb 17, 2011 at 10:30 AM, Mike Ramirez  wrote:

>  On Thursday, February 17, 2011 07:14:16 am ashish wrote:
>
> > Hi all. I followed the tutorial to setup a basic django site and run
>
> > it with the development server. Everything looks fine. Then, I
>
> > configured to use apache. Everything seems to work except the styling.
>
> > The login and admin pages have no formatting. On IRC I was told the
>
> > issue is that the development server automatically serves the
>
> > necessary media, but that you have to explicitly configure apache to
>
> > serve static media.
>
> >
>
> > Okay, but which media needs to be served for the styling to work? I
>
> > have not found the answer in the docs. Thank you for any help.
>
>  normally the path assigned to MEDIA_ROOT and ADMIN_MEDIA ... see below
> for the configuration settings (pick your production environment)
>
> http://docs.djangoproject.com/en/1.2/howto/deployment
>
> Mike
>
> --
>
> If God had not given us sticky tape, it would have been necessary to invent
> it.
>
>  --
> 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: site styling works with development server but not apache

2011-02-17 Thread Mike Ramirez
On Thursday, February 17, 2011 07:14:16 am ashish wrote:
> Hi all. I followed the tutorial to setup a basic django site and run
> it with the development server. Everything looks fine. Then, I
> configured to use apache. Everything seems to work except the styling.
> The login and admin pages have no formatting. On IRC I was told the
> issue is that the development server automatically serves the
> necessary media, but that you have to explicitly configure apache to
> serve static media.
> 
> Okay, but which media needs to be served for the styling to work? I
> have not found the answer in the docs. Thank you for any help.



normally the path assigned to MEDIA_ROOT and ADMIN_MEDIA ... see below for the 
configuration settings (pick your production environment)

http://docs.djangoproject.com/en/1.2/howto/deployment

Mike
-- 
If God had not given us sticky tape, it would have been necessary to invent 
it.

-- 
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: site styling works with development server but not apache

2011-02-17 Thread Tom Evans
On Thu, Feb 17, 2011 at 3:14 PM, ashish  wrote:
> Hi all. I followed the tutorial to setup a basic django site and run
> it with the development server. Everything looks fine. Then, I
> configured to use apache. Everything seems to work except the styling.
> The login and admin pages have no formatting. On IRC I was told the
> issue is that the development server automatically serves the
> necessary media, but that you have to explicitly configure apache to
> serve static media.
>
> Okay, but which media needs to be served for the styling to work? I
> have not found the answer in the docs. Thank you for any help.
>

http://docs.djangoproject.com/en/1.2/howto/deployment/modpython/#serving-the-admin-files

Cheers

Tom

-- 
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: A naive question re: text styling tags

2008-01-29 Thread Rajesh Dhawan



On Jan 29, 1:02 pm, LRP <[EMAIL PROTECTED]> wrote:
> Hello,
>
> The models documentation in the Django site 
> (http://www.djangoproject.com/documentation/model-api/)
> shows an admin screen for inputting articles.
>
> Simple enough, but suppose we need to style some of the text in the
> content field, e.g., italicize a word, display a string of words in
> boldface, etc.
>
> Does the person entering the text have to know how to insert the html
> styling tags? Or is there some other method  for handling text styling
> within a content block?

Use a textual markup language like Markdown, Textile, Restructered
Text. Django/ and Pythong support them perfectly. See
http://code.djangoproject.com/wiki/UsingMarkup for some ideas.

You could also embed a WYSIWIG type Javascript editor. See
http://code.djangoproject.com/wiki/CookBookAdminTools

-Rajesh
--~--~-~--~~~---~--~~
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: A naive question re: text styling tags

2008-01-29 Thread code_berzerker

I'd integrate javascript WYSIWYG editor like FCKEditor or TinyMCE to
edit TextField type fields.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



A naive question re: text styling tags

2008-01-29 Thread LRP

Hello,

The models documentation in the Django site (http://
www.djangoproject.com/documentation/model-api/)
shows an admin screen for inputting articles.

Simple enough, but suppose we need to style some of the text in the
content field, e.g., italicize a word, display a string of words in
boldface, etc.

Does the person entering the text have to know how to insert the html
styling tags? Or is there some other method  for handling text styling
within a content block?

How do they do it at lawrence.com?

Many thanks,

Lloyd




--~--~-~--~~~---~--~~
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: url styling

2007-08-10 Thread Filipe Correia

>From a REST perspective, I think the best would be to make the action
part of the query string.
However, I also know not everyone agrees with this, so don't take my
word for it.

--
Filipe

On Aug 10, 6:21 am, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> is there any advantage or disadvantage or best practices in forming
> urls? like which set are much better?
>
> domain/employee/1
> domain/edit_employee/1
> domain/inactive_employee/1
>
> or
>
> domain/employee/1
> domain/employee/1/edit/
> domain/employee/1/inactive/
>
> thanks
> james


--~--~-~--~~~---~--~~
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: url styling

2007-08-10 Thread Nicola Larosa

[RESTafarian zealotry follows: you have been warned. ;-) ]

james_027 wrote:
> is there any advantage or disadvantage or best practices in forming
> urls?

Yes, there is. By following web architecture principles, as formalized in
the REST (REpresentational State Transfer) methodology, you gain benefits
of simplicity, uniformity, interoperability and scalability.

This series of articles by Joe Gregorio is a good introduction to REST:

The Restful Web
http://www.xml.com/pub/at/34

Work on REST for Django is being done by Andreas Stuhlmüller within the
Google Summer Of Code initiative, here's his last report:

GSoC 2007 Status Update VI: Django REST interface
http://groups.google.com/group/django-developers/browse_thread/thread/f86bd8ea6579baaa/dd5598af026e62f2


> like which set are much better?
> 
> domain/employee/1
> domain/edit_employee/1
> domain/inactive_employee/1
> 
> or
> 
> domain/employee/1
> domain/employee/1/edit/
> domain/employee/1/inactive/

Neither. :-)

According to REST, you don't put verbs in your URLs. Verbs are already
contained in the HTTP protocol: GET and POST are usable by current
browsers, then there's PUT and DELETE (and a few others), accessible by
Django via this snippet:

HttpMethodsMiddleware
http://www.djangosnippets.org/snippets/174/

Here's a quick rundown of how your URLs could be refactored.

> domain/employee/1

GET /domain/employee/1

This one would return the default, read-only representation of the resource.


> domain/employee/1/edit/

I like using parameters for identifying alternate representations of
resources. In this case:

GET /domain/employee/1;editable

(notice the semicolon) would return the editable representation of the
resource. You could then edit it, and POST the data:

POST /domain/employee/1;editable


> domain/employee/1/inactive/

Is this meant to set the employee status? You could use the above POST to
just send the enable flag, or else you could separate the resource metadata
in a distinct representation, and POST that instead:

POST /domain/employee/1;metadata
Enabled: false


-- 
Nicola Larosa - http://www.tekNico.net/

Being online demands a tremendous amount of discipline. You must shut
out the world around you and focus exclusively on a glowing screen.
You must sit in a chair for hours on end and will your body to remain
still. You are at an altar, but you are both priest and supplicant.
 -- Scott Jason Cohen, July 2000



--~--~-~--~~~---~--~~
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: url styling

2007-08-10 Thread Sean Perry

On Aug 9, 2007, at 10:21 PM, james_027 wrote:

>
> hi,
>
> is there any advantage or disadvantage or best practices in forming
> urls? like which set are much better?
>
> domain/employee/1
> domain/edit_employee/1
> domain/inactive_employee/1
>
> or
>
> domain/employee/1
> domain/employee/1/edit/
> domain/employee/1/inactive/
>


Better is always subjective. From a technical perspective, here is  
what the URL patterns look like:

a)
simple form
r'domain/(?:(\w+)_)?(\w+)/(\d+)'

one where you get all of the items nicely named:
r'domain/(?:(?P\w+)_)?(?P\w+)/(?P\d+)'

b)
r'domain/(\w+)/(\d+)(?:/(\w+))?'

r'domain/(?P\w+)/(?P\d+)(?:/(?P\w+))?'

I see the first URL set as being function oriented and the second set  
being more object oriented. Just depends on how you prefer to see the  
world I suppose.

Personally, I would probably do the second one.

May I suggest the first choice get turned around slightly:
domain/employee_edit/1
Like I said, I see the first grouping as more functional style and it  
is good practice to name the object first in function names. You end  
up with a regex like this:
r'domain/(?P\w+)(?:_(?P\w+))?/(?P\d+)'
which reads better in my opinion.

BTW, the (?:) syntax lets you group things without adding more items  
to the groupdict result. Purely optional, I just like to be really  
explicit about my regexes.

--~--~-~--~~~---~--~~
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: url styling

2007-08-10 Thread Lucky B

I think the second is better because you're being consistent in your
hierarchy order.
IE you're going from least specific to most specific:
domain -> object -> instance ->action

Instead, in the first one you're going:
domain -> action -> object -> instance

Then again, it's purely preference.

On Aug 10, 1:21 am, james_027 <[EMAIL PROTECTED]> wrote:
> hi,
>
> is there any advantage or disadvantage or best practices in forming
> urls? like which set are much better?
>
> domain/employee/1
> domain/edit_employee/1
> domain/inactive_employee/1
>
> or
>
> domain/employee/1
> domain/employee/1/edit/
> domain/employee/1/inactive/
>
> thanks
> james


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