Hi All,
I've spent the last hour or so looking for a clear and simple explanation to
this but I've been unsuccessful. Maybe someone here could help me (please!)
What do I need to do to make sure my created apps are useable?
This is the structure of my "XMLmunger" project.
In order to simplify my project I want to use different apps for the major
functional bits of the project. First stop is the "upload" application.
I cannot figure out why my upload app is not being recognised by django.
Note, at the moment I'm only using views / urls and templates. No models at
all.
<root>
├── apps
│ ├── __init__.py (empty)
│ └── upload
│ ├── __init__.py (empty)
│ ├── urls.py
│ └── views.py
├── __init__.py (empty)
├── manage.py
├── public
│ └── static (css, js and images)
├── settings.py
├── templates
│ └── (all of my templates)
├── urls.py
└── views.py
- In my <root>/settings.py I added "upload" to "INSTALLED_APPS".
- In my apps directory I have __init__.py (empty) to allow all sub dirs to
be imported as modules.
- I would like to pass all urls for an app to the urls.py in that app
directory: (r"^/upload$", include('upload.urls'))
Now the dev server won't start, complaining:
>python manage.py runserver
Error: No module named upload
OK. Let's change "upload" to "apps.upload" in INSTALLED_APPS.
Now the dev server starts but any page I try to go to gives: NameError at /
"name 'apps' is not defined".
I have a feeling I'm missing something very obvious but everything
djangoesque is still forming in my mind and I'm really not sure where the
problem is.
I've been trying "from XMLMunger.view import *" in my root urls.py without
success. I am thinking that I do need to import but I'm just not sure where
and what...
Thanks in advance...
W
--
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.