I am creating a stand alone app.

Everything is working as a .py, when I launch the website everything
is perfect.

When I create my .py into an exe (py2exe) it still works, but the css
is not there.

I have tried many things and cannot figure out the solution.

=======================================================================
this is my urls.py:
=======================================================================
from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': r'C:\dev\incidents\media\\', 'show_indexes': True}),
    (r'^admin_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': r'C:\dev\incidents\media\\', 'show_indexes': True}),
)

=======================================================================
pyweb.py: \
=======================================================================
import os
import sys
import time
from django.core.management import call_command
import threading
import thread
from django.core.management.commands.runserver import Command
import webbrowser

sys.path += [r'c
:\dev']
#sys.path += [r'
p:\Hazard_Inventory']
os.environ['DJANGO_SETTINGS_MODULE'] = 'incidents.settings'

#t = thread.start_new_thread(os.system, (u'C:\\Python25\\python C:\\dev
\\\\incidents\\manage.py runserver > nul', ))

#These are the Imports
import incidents.base.models
import incidents.base.views
import incidents.urls
import incidents.settings
import incidents.manage
import django.template.loaders.filesystem
import django.template.loaders.app_directories
import django.middleware.common
import django.contrib.sessions.middleware
import django.contrib.auth.middleware
import django.middleware.doc
import django.contrib.auth
import django.contrib.auth.backends
import django.contrib.auth.views
import django.contrib.contenttypes
import django.contrib.sessions
import django.contrib.sites
import django.contrib.admin
import django.contrib.admin.templatetags
import django.contrib.admin.templatetags.adminmedia
import django.contrib.admin.templatetags.admin_modify
import django.contrib.admin.templatetags.adminapplist
import django.contrib.admin.templatetags.log
import django.contrib.admin.templatetags.admin_list
import django.contrib.admin.views.main
import django.contrib.admin.views.auth
import django.contrib.admin.views.doc
import django.contrib.admin.views.template
import django.contrib.admin.urls
import django.contrib.humanize
import django.contrib.sessions
import django.contrib.sessions.backends.db
import django.core.cache.backends.locmem
import django.core.cache.backends.db
import django.core.context_processors
import django.conf.urls.shortcut
import django.db.backends.sqlite3.base
import django.db.backends.sqlite3.introspection
import django.db.backends.sqlite3.creation
import django.db.backends.sqlite3.client
import django.template.defaulttags
import django.template.defaultfilters
import django.templatetags.i18n
import django.conf.urls.defaults
import django.views.static
import django.views.defaults
import django.views.i18n
import email.mime.text
import email.mime.multipart
import email.iterators
import email.header
import email
import encodings
import encodings.utf_8
import encodings.cp1252
import encodings.ascii
import django.template.loader_tags
#End of Imports

class RunDevServer(threading.Thread):
    def run(self):
        s = Command()
        s.execute(use_reloader=False)

def start_dev_server():
    t = RunDevServer()
    t.setDaemon(True)
    t.start()

start_dev_server()

webbrowser.open('http://127.0.0.1:8000/admin/base/incident/add/')
time.sleep(1000)

=======================================================================
setup.py:
=======================================================================
from distutils.core import setup
import py2exe
import sys
import glob

if len(sys.argv) == 1:
    sys.argv.append("py2exe")

try:
        setup(
                        options = {"py2exe": {"compressed": 1, "optimize": 2, 
"ascii": 1,
"bundle_files": 1}},
                        zipfile = None,
                        data_files = [(".", [r"C:\dev\incidents\db.sqlite3"]),
                                (r".\templates\admin", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\templates\admin\*.*")),
                                (r".\templates\admin\auth\user", 
glob.glob(r"C:\Python25\Libsite-
packages\django\contrib\admin\templates\admin\auth\user\*.*")),
                                (r"templates\admin_doc", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\templates\admin_doc\*.*")),
                                (r"templates\widget", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\templates\widget\*.*")),
                                (r"templates\registration", 
glob.glob(r"C:\Python25\Lib\site-
packages\django\contrib\admin\templates\registration\*.*")),
                                (r"admin_media\css", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\css\*.*")),
                                (r"admin_media\js", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\js\*.*")),
                                (r"admin_media\img", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\img\*.*")),
                                (r"media\admin\css", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\css\*.*")),
                                (r"media\admin\js", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\js\*.*")),
                                (r"media\admin\img", 
glob.glob(r"C:\Python25\Lib\site-packages
\django\contrib\admin\media\img\*.*")),
                                ],
                        windows = [{"script": 'pyweb.py'}])
except:


        import time
        time.sleep(10)

=======================================================================
I would appreciate any help you can give me!
I have just started programming so I have been having a really hard
time with this..

Thanks :)
Molly


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

Reply via email to