My guess is that you don't have mysite on your python path. Try making sure
that is the case, then try:
DJANGO_PROJECT = 'mysite'
ROOT_URLCONF = 'mysite.urls'

One other thing, make sure you do have an __init__.py file in your mysite
directory.

-Chris

On Sun, Sep 6, 2009 at 2:05 AM, bab <[email protected]> wrote:

>
> Hi,
>
> I'm new to Satchmo and following
> http://www.satchmoproject.com/docs/svn/new_installation.html
> am able to get a site working with Apche+mod_wsgi but only if I use
> ROOT_URLCONF = 'satchmo_store.urls' in settings.py (around line 88 of
> settings.py as copied and modified from satchmo base store example),
> whereas if I do "django-admin.py startproject mysite" in Django it
> should be ROOT_URLCONF = 'mysite.urls'.
>
> How can I set ROOT_URLCONF='mysite.urls' and get Satchmo to work???
>
>
> My store layout is...
>
> ~/projects/mysite
>    |-- local_settings.py       <--- via to/satchmo/projects/base/, then
> modified
>    |-- manage.py
>    |-- media/
>    |   |-admin/                        <--- symlink to Django admin media
>    |-- satchmo.log
>    |-- settings.py                     <--- via to/satchmo/projects/base/,
> then
> modified
>    |-- static/                 <--- via satchmo_copy_static
>    |   |-css/
>    |   |-images/
>    |   |-js/
>    |-templates/                        <--- currently empty
>    `-- urls.py
>
>
> settings.py (have tried changing line8 to satchmo_store
> ----------------
> 2.      # If you have an existing project, then ensure that you modify
> local_settings-c$
> 3.      # and import it from your main settings file. (from local_settings
> import *)
> 4.      import os
> 5.
> 6.      DIRNAME = os.path.abspath(os.path.dirname(__file__).decode
> ('utf-8'))
> 7.
> 8.      DJANGO_PROJECT = 'satchmo'
> 9.      DJANGO_SETTINGS_MODULE = 'satchmo_store.settings'
> 10.
> 11.     LOCAL_DEV = True
> 12.     DEBUG = True
> 13.     TEMPLATE_DEBUG = DEBUG
> 14.
> 15.     ADMINS = (
> 16.          ('', ''),
> 17.     )
> 18.
> 19.     MANAGERS = ADMINS
> 20.
> 21.     DATABASE_ENGINE = ''           # 'postgresql_psycopg2',
> 'postgresql', 'mysql', $
> 22.     # The following variables should be configured in your
> local_settings.py file
> 23.     #DATABASE_NAME = ''             # Or path to database file if
> using sqlite3.
> 24.     #DATABASE_USER = ''             # Not used with sqlite3.
> 25.     #DATABASE_PASSWORD = ''         # Not used with sqlite3.
> 26.     DATABASE_HOST = ''             # Set to empty string for
> localhost. Not used wi$
> 27.     DATABASE_PORT = ''             # Set to empty string for default.
> Not used with$
> 28.
> 29.     # Local time zone for this installation. All choices can be found
> here:
> 30.     #
> http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIM$
> 31.     TIME_ZONE = 'Europe/London'
> 32.
> 33.     # Language code for this installation. All choices can be found
> here:
> 34.     # http://www.i18nguy.com/unicode/language-identifiers.html
> 35.     # For windows, you must use 'us' instead
> 36.     LANGUAGE_CODE = 'en-gb'
> 37.
> 38.     SITE_ID = 1
> 39.
> 40.     # Absolute path to the directory that holds media.
> 41.     # Example: "/home/media/media.lawrence.com/"
> 42.     # Image files will be stored off of this path.
> 43.     MEDIA_ROOT = os.path.join(DIRNAME, 'static/')
> 44.     # URL that handles the media served from MEDIA_ROOT. Use a
> trailing slash.
> 45.     # Example: "http://media.lawrence.com/";
> 46.     MEDIA_URL = '/static/'
> 47.     # URL that handles the media served from SSL.  You only need to
> set this
> 48.     # if you are using a non-relative url.
> 49.     # Example: "https://media.lawrence.com";
> 50.     # MEDIA_SECURE_URL = "https://foo.com/";
> 51.     # URL prefix for admin media -- CSS, JavaScript and images. Make
> sure to use a
> 52.     # trailing slash.
> 53.     # Examples: "http://foo.com/media/";, "/media/".
> 54.     ADMIN_MEDIA_PREFIX = '/media/admin/'
> 55.
> 56.     # Make this unique, and don't share it with anybody.
> 57.     # SECRET_KEY = ''
> 58.
> 59.     # List of callables that know how to import templates from various
> sources.
> 60.     TEMPLATE_LOADERS = (
> 61.         'django.template.loaders.filesystem.load_template_source',
> 62.
> 'django.template.loaders.app_directories.load_template_source',
> 63.     #     'django.template.loaders.eggs.load_template_source',
> 64.     )
> 65.
> 66.     MIDDLEWARE_CLASSES = (
> 67.         "django.middleware.common.CommonMiddleware",
> 68.         "django.contrib.sessions.middleware.SessionMiddleware",
> 69.         "django.middleware.locale.LocaleMiddleware",
> 70.         "django.contrib.auth.middleware.AuthenticationMiddleware",
> 71.         "django.middleware.doc.XViewMiddleware",
> 72.         "threaded_multihost.middleware.ThreadLocalMiddleware",
> 73.         "satchmo_store.shop.SSLMiddleware.SSLRedirect",
> 74.     #    "satchmo_ext.recentlist.middleware.RecentProductMiddleware",
> 75.     )
> 76.
> 77.     #this is used to add additional config variables to each request
> 78.     # NOTE: If you enable the recent_products context_processor, you
> MUST have the
> 79.     # 'satchmo_ext.recentlist' app installed.
> 80.     TEMPLATE_CONTEXT_PROCESSORS = (
> 81.         'django.core.context_processors.auth',
> 82.         'django.core.context_processors.media',
> 83.     #    'satchmo_ext.recentlist.context_processors.recent_products',
> 84.         'satchmo_store.shop.context_processors.settings',
> 85.         'django.core.context_processors.i18n'
> 86.     )
> 87.
> 88.     ROOT_URLCONF = 'satchmo_store.urls'                             #
> oringinally 'mysite.urls'
> 89.
> 90.     TEMPLATE_DIRS = (
> 91.         # Put strings here, like "/home/html/django_templates".
> 92.         # Always use forward slashes, even on Windows.
> 93.         os.path.join(DIRNAME, "templates"),
> 94.     )
> 95.
> 96.     INSTALLED_APPS = (
> 97.         'satchmo_store.shop',
> 98.         'django.contrib.admin',
> 99.         'django.contrib.admindocs',
> 100.        'django.contrib.auth',
> 101.        'django.contrib.contenttypes',
> 102.        'django.contrib.comments',
> 103.        'django.contrib.sessions',
> 104.        'django.contrib.sitemaps',
> 105.        'django.contrib.sites',
> 106.        'registration',
> 107.        'sorl.thumbnail',
> 108.        #'satchmo',
> 109.        'keyedcache',
> 110.        'livesettings',
> 111.        'satchmo_store.contact',
> 112.        'product',
> 113.        # ****
> 114.        # * Optional feature, product brands
> 115.        # * Uncomment below, and add the brand url in your
> satchmo_urls setting
> 116.        # * usually in local_settings.py
> 117.        # ****
> 118.        #'satchmo_ext.brand'
> 119.        'shipping',
> 120.        'payment',
> 121.        'payment.modules.giftcertificate',
> 122.        'satchmo_store.contact.supplier',
> 123.        # *****
> 124.        # * Optional feature - admin toolbar for satchmo
> 125.        # * Uncomment below to enable
> 126.        # *
> 127.        # *****
> 128.        #'satchmo_ext.satchmo_toolbar',
> 129.        'satchmo_utils',
> 130.        'satchmo_utils.thumbnail',
> 131.        'l10n',
> 132.        'tax',
> 133.        'tax.modules.no',
> 134.        'tax.modules.area',
> 135.        'tax.modules.percent',
> 136.    #    'satchmo_ext.recentlist',
> 137.        'satchmo_ext.wishlist',
> 138.        'satchmo_ext.upsell',
> 139.        'satchmo_ext.productratings',
> 140.        'app_plugins',
> 141.        # ****
> 142.        # * Optional Feature, Tiered shipping
> 143.        # * uncomment below to make that shipping module available in
> your live site
> 144.        # * settings page. enable it there, then configure it in the
> 145.        # * admin/tiered section of the main admin page.
> 146.        # ****
> 147.        #'shipping.modules.tiered'
> 148.        # ****
> 149.        # * Optional feature newsletter
> 150.        # ****
> 151.        #'satchmo_ext.newsletter',
> 152.        # ****
> 153.        # * Optional feature product feeds
> 154.        # * These are usually for googlebase
> 155.        # ****
> 156.        #'satchmo_ext.product_feeds',
> 157.        # ****
> 158.        # * Optional feature, tiered pricing
> 159.        # * uncomment below, then set up in your main admin page.
> 160.        # ****
> 161.        #'satchmo_ext.tieredpricing',
> 162.        # ****
> 163.        # * Highly recommended app - use this to have access to the
> great
> 164.        # * "Jobs" system.  See
> http://code.google.com/p/django-command-extensions/
> 165.        # * Make sure to set up your crontab to run the daily, hourly
> and monthly
> 166.        # * jobs.
> 167.        # ****
> 168.        #'django_extensions',
> 169.
> 170.    )
> 171.
> 172.    AUTHENTICATION_BACKENDS = (
> 173.        'satchmo_store.accounts.email-auth.EmailBackend',
> 174.        'django.contrib.auth.backends.ModelBackend',
> 175.    )
> 176.
> 177.    AUTH_PROFILE_MODULE='contact.Contact'
> 178.    LOGIN_REDIRECT_URL = '/accounts/'
> 179.
> 180.    # Locale path settings.  Needs to be set for Translation
> compilation.
> 181.    # It can be blank
> 182.    # LOCALE_PATHS = ""
> 183.
> 184.    # Language code for this installation. All choices can be found
> here:
> 185.    # http://www.i18nguy.com/unicode/language-identifiers.html
> 186.    LANGUAGE_CODE = 'en-gb'
> 187.
> 188.    # Languages for your site.  The language name
> 189.    # should be the utf-8 encoded local name for the language.
> 190.    gettext_noop = lambda s:s
> 191.
> 192.    LANGUAGES = (
> 193.        ('en', gettext_noop('English')),
> 194.    )
> 195.
> 196.    #from django.conf.urls.defaults import patterns, include
> 197.
> 198.    SATCHMO_SETTINGS = {
> 199.        # this will override any urls set in the store url modules
> 200.        # 'SHOP_URLS' : patterns('',
> 201.            # disable this if you don't want multi-language
> 202.        #     (r'^i18n/', include('l10n.urls')),
> 203.
> 204.            # paypal urls need special treatment
> 205.            # (r'^checkout/pay/$',
> 'payment.modules.paypal.checkout_step2.pay_ship_$
> 206.            #     {'SSL': False}, 'satchmo_checkout-step2'),
> 207.            # (r'^checkout/confirm/$',
> 'paypal.checkout_step3.confirm_info',
> 208.            #     {'SSL': False}, 'satchmo_checkout-step3'),
> 209.        # ),
> 210.
> 211.        # This is the base url for the shop.  Only include a leading
> slash
> 212.        # examples: '/shop' or '/mystore'
> 213.        # If you want the shop at the root directory, set SHOP_BASE
> to ''
> 214.        'SHOP_BASE' : '',
> 215.
> 216.        # Set this to true if you want to use the multi-shop features
> 217.        # of satchmo.  It requires the "threaded_multihost"
> application
> 218.        # to be on your pythonpath.
> 219.        'MULTISHOP' : False,
> 220.    }
> 221.
> 222.    # Load the local settings
> 223.    from local_settings import *
>
>
> local_settings.py
> -------------------------
> 1.      # This file is used to store your site specific settings
> 2.      # for database access.
> 3.      #
> 4.      # Modify this file to reflect your settings, then rename it to
> 5.      # local_settings.py
> 6.      #
> 7.      # This file is helpful if you have an existing Django project.
> 8.      # These are specific things that Satchmo will need.
> 9.      # you MUST make sure these settings are imported from your project
> settings fil$
> 10.
> 11.     import os
> 12.     import logging
> 13.
> 14.     # This is useful, since satchmo is not the "current directory"
> like load_data e$
> 15.     # SATCHMO_DIRNAME = ''
> 16.
> 17.     # Only set these if Satchmo is part of another Django project
> 18.     #SITE_NAME = ''
> 19.     #ROOT_URLCONF = ''
> 20.     #MEDIA_ROOT = os.path.join(DIRNAME, 'static/')
> 21.     #DJANGO_PROJECT = 'Your Main Project Name'
> 22.     #DJANGO_SETTINGS_MODULE = 'main-project.settings'
> 23.     DATABASE_ENGINE = 'postgresql_psycopg2'
> 24.     DATABASE_NAME = 'my_django_db'
> 25.     DATABASE_PASSWORD = 'my_django_password'
> 26.     DATABASE_USER = 'my_django_user'
> 27.     SECRET_KEY = 'my_secret_key'
> 28.
> 29.     ##### For Email ########
> 30.     # If this isn't set in your settings file, you can set these here
> 31.     #EMAIL_HOST = 'host here'
> 32.     #EMAIL_PORT = 587
> 33.     #EMAIL_HOST_USER = 'your user here'
> 34.     #EMAIL_HOST_PASSWORD = 'your password'
> 35.     #EMAIL_USE_TLS = True
> 36.
> 37.     #### Satchmo unique variables ####
> 38.
> 39.     #These are used when loading the test data
> 40.     SITE_DOMAIN = "example.com"
> 41.     SITE_NAME = "My Site"
> 42.
> 43.     # These can override or add to the default URLs
> 44.     #from django.conf.urls.defaults import *
> 45.     #URLS = patterns('',
> 46.     #)
> 47.
> 48.     # a cache backend is required.  Do not use locmem, it will not
> work properly at$
> 49.     # Preferably use memcached, but file or DB is OK.  File is faster,
> I don't know$
> 50.     # db, personally.  See:
> http://www.djangoproject.com/documentation/cache/
> for h$
> 51.     # cache backend
> 52.     #CACHE_BACKEND = "memcached://127.0.0.1:11211/"
> 53.     CACHE_BACKEND = "file:///var/tmp/django_cache"
> 54.     CACHE_TIMEOUT = 60*5
> 55.
> 56.     ACCOUNT_ACTIVATION_DAYS = 7
> 57.
> 58.     # modify the cache_prefix if you have multiple concurrent stores.
> 59.     CACHE_PREFIX = "STORE"
> 60.
> 61.     #Configure logging
> 62.     LOGDIR = os.path.abspath(os.path.dirname(__file__))
> 63.     LOGFILE = "satchmo.log"
> 64.     logging.basicConfig(level=logging.DEBUG,
> 65.                         format='%(asctime)s %(name)-12s %
> (levelname)-8s %(message)s$
> 66.                         datefmt='%a, %d %b %Y %H:%M:%S',
> 67.                         filename=os.path.join(LOGDIR, LOGFILE),
> 68.                         filemode='w')
> 69.
> 70.     # define a Handler which writes INFO messages or higher to the
> sys.stderr
> 71.     fileLog = logging.FileHandler(os.path.join(LOGDIR, LOGFILE), 'w')
> 72.     fileLog.setLevel(logging.DEBUG)
> 73.     # set a format which is simpler for console use
> 74.     formatter = logging.Formatter('%(asctime)s %(name)-12s: %
> (levelname)-8s %(messa$
> 75.     # tell the handler to use this format
> 76.     fileLog.setFormatter(formatter)
> 77.     # add the handler to the root logger
> 78.     logging.getLogger('').addHandler(fileLog)
> 79.     logging.getLogger('keyedcache').setLevel(logging.INFO)
> 80.     logging.info("Satchmo Started")
>
>
> urls.py
> ----------
> 81.     from django.conf.urls.defaults import *
> 82.     from satchmo_store.urls import urlpatterns
> 83.
> 84.     # Uncomment the next two lines to enable the admin:
> 85.     from django.contrib import admin
> 86.     admin.autodiscover()
> 87.
> 88.     urlpatterns += patterns('',
> 89.         # Example:
> 90.         # (r'^mysite/', include('mysite.foo.urls')),
> 91.
> 92.         # Uncomment the admin/doc line below and add
> 'django.contrib.admindocs'
> 93.         # to INSTALLED_APPS to enable admin documentation:
> 94.         (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> 95.
> 96.         # Uncomment the next line to enable the admin:
> 97.         (r'^admin/', include(admin.site.urls)),
> 98.     )
>
>
> The files below should not make any difference but are included below
> incase I've missed something silly
>
>
> django.wsgi
> -----------------
> import os, sys
> sys.path.append('/home/gjeos/projects')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
> Apache default configuration file
> ----------------------------------------------
> 1.      NameVirtualHost *
> 2.      <VirtualHost *>
> 3.      #        ServerAdmin webmas...@localhost
> 4.      #
> 5.      #        DocumentRoot /var/www/
> 6.      #        <Directory />
> 7.      #                Options FollowSymLinks
> 8.      #                AllowOverride None
> 9.      #        </Directory>
> 10.     #        <Directory /var/www/>
> 11.     #                Options Indexes FollowSymLinks MultiViews
> 12.     #                AllowOverride None
> 13.     #                Order allow,deny
> 14.     #                allow from all
> 15.     #        </Directory>
> 16.     #
> 17.     #        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> 18.     #        <Directory "/usr/lib/cgi-bin">
> 19.     #                AllowOverride None
> 20.     #                Options +ExecCGI -MultiViews
> +SymLinksIfOwnerMatch
> 21.     #                Order allow,deny
> 22.     #                Allow from all
> 23.     #        </Directory>
> 24.     #
> 25.     #        ErrorLog /var/log/apache2/error.log
> 26.     #
> 27.     #        # Possible values include: debug, info, notice, warn,
> error, crit,
> 28.     #        # alert, emerg.
> 29.     #        LogLevel warn
> 30.     #
> 31.     #        CustomLog /var/log/apache2/access.log combined
> 32.     #        ServerSignature On
> 33.     #
> 34.     #    Alias /doc/ "/usr/share/doc/"
> 35.     #    <Directory "/usr/share/doc/">
> 36.     #        Options Indexes MultiViews FollowSymLinks
> 37.     #        AllowOverride None
> 38.     #        Order deny,allow
> 39.     #        Deny from all
> 40.     #        Allow from 127.0.0.0/255.0.0.0 ::1/128
> 41.     #    </Directory>
> 42.
> 43.         Alias /media/ /home/gjeos/projects/mysite/media/
> 44.         <Directory /home/gjeos/projects/mysite/media>
> 45.             Order deny,allow
> 46.             Allow from all
> 47.         </Directory>
> 48.
> 49.         WSGIScriptAlias / /home/gjeos/projects/mysite/apache/
> django.wsgi
> 50.         <Directory /home/gjeos/projects/mysite/apache>
> 51.             Order deny,allow
> 52.             Allow from all
> 53.         </Directory>
> 54.
> 55.     </VirtualHost>
>
> Any help much appreciated as I've tried to work this out myself for a
> while now.
>
> Thanks.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo 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/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to