Dear user,
I am novice with Django,
I have developed some applications but each time they have the same
URL as in physical path.
like URL: http:<IP>/testlab and on file system was /opt/Django/testlab
with view.py etc.
Now I would like to develop application called SSO
where all url.py, view.py will be stored in /srv/www/sso/htdocs2 and
in browser will be called over http://<IP>/SSO/
How shall I config settings.py and url.py
My settings.py and their important parts are:
linux-6cic:/srv/www/sso/htdocs2 # cat settings.py
# Django settings for htdocs2 project.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if
using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for
default. Not used with sqlite3.
}
}
# Absolute filesystem path to the directory that will hold user-
uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = '/srv/www/sso/htdocs2/media'
# URL that handles the media served from MEDIA_ROOT. Make sure to use
a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/
media/"
MEDIA_URL = ''
ROOT_URLCONF = 'htdocs2.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/
django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
'/srv/www/sso/htdocs2/templates',
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'SSO',
)
}
linux-6cic:/srv/www/sso/htdocs2 #
linux-6cic:/srv/www/sso/htdocs2 # cat urls.py
from django.conf.urls.defaults import patterns, include, url
from htdocs2.views import index, config_page
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
(r'^$', index),
(r'^status/$', index),
(r'^config/$', config_page),
)
linux-6cic:/srv/www/sso/htdocs2 #
Is this settings OK?
Thnak you in advance
Petr
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.