Hi,
Thanks for your quick reply. I tried what you showed me but it didn't
work. Below are the contents of my settings.py and urls.py files.
Could you please study them and point out where am going wrong?

SETTINGS.PY
===========================================================
import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_em...@domain.com'),
)

PROJECT_DIR = os.path.dirname(__file__)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'django_bookmarks',                      # Or path to
database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': 'toor',                  # Not used with sqlite3.
        'HOST': 'localhost',                      # Set to empty
string for localhost. Not used with sqlite3.
        'PORT': '3306',                      # Set to empty string for
default. Not used with sqlite3.
    }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as
your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as
not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(PROJECT_DIR,'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash if there is a path component (optional in other
cases).
# Examples: "http://media.lawrence.com";, "http://example.com/media/";
MEDIA_URL = 'http://127.0.0.1:8000/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure
to use a
# trailing slash.
# Examples: "http://foo.com/media/";, "/media/".
ADMIN_MEDIA_PREFIX = '/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'xjz$(&oq0oz_c!3(%nkzp%@0zv)^!-c#2tbcqiix*bpu1303ml'

# List of callables that know how to import templates from various
sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
#     'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'django_bookmarks.urls'

TEMPLATE_DIRS = (
    os.path.join(PROJECT_DIR,'templates')
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django_bookmarks.bookmarks',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

URLS.PY
===================================
from django.conf.urls.defaults import *
from django.contrib import admin
from bookmarks.views import main_page
admin.autodiscover()

urlpatterns = patterns('',
     (r'^$',main_page),
     (r'^admin/', include(admin.site.urls)),
     (r'^media/(?P<path>.*)$','django.views.static.serve'),
)

MAIN_PAGE.HTML
=====================================
<html>
<head>
<title>{{head_title}}</title>
<link rel="stylesheet" type="text/css" href="media/css/layout.css"/>
</head>
<body>
<h1>{{page_title}}</h1>
<p>{{page_body}}</p>
</body>
</html>

On Feb 4, 10:13 pm, ozgur yilmaz <yelb...@gmail.com> wrote:
> In your template:
>
> <link href="/site_media/css/style.css" media="screen" rel="stylesheet"
> type="text/css" />
>
> In your urls.py:
>
> site_media = os.path.join(os.path.dirname(__file__),'site_media')
>
> urlpatterns = patterns('',
>             (r'^site_media/(?P<path>.*)$' ,
> 'django.views.static.serve',{'document_root':site_media}),
> )
>
> Maybe helps...
>
> 2011/2/4 h@ck5t0ck <hackstock...@gmail.com>
>
> > Hi guys,
> > am very new to django and am having troubles adding css to my pages
> > even though i've found some tutorials online
> > and followed it word for word.
> > Can anyone please help me urgently? I really appreciate your help.
> > Best Wishes,
> > h@ck5t0ck
>
> > --
> > 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<django-users%2bunsubscr...@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.

Reply via email to