just add before code:
import site
:)

On 10/27/10 15:13, wawa wawawa wrote:
> Hi Piotr,
> 
> On 27 October 2010 15:54, Piotr Zalewa <zal...@gmail.com> wrote:
>> If you want to have the apps in apps folder you need to put them on the
>> python path, so eithor modify the python path environment variable or
>> (prefered) modify manage.py and add
>> site.addsitedir(path('apps'))
> 
> Many thanks for the response.
> 
> A question: I presume this only matters for the dev server then?
> 
> I added this just before "execute_manager(settings)"
> 
> $ python manage.py runserver
> Traceback (most recent call last):
>   File "manage.py", line 11, in <module>
>     site.addsitedir(path('apps'))
> NameError: name 'site' is not defined
> 
> Apologies if I'm being very stupid!
> 
> Thanks
> 
> W
> 
> 
>> zalun
>>
>> On 10/27/10 14:50, wawa wawawa wrote:
>>> 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 django-us...@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.
>>
>>
>> --
>> blog  http://piotr.zalewa.info
>> jobs  http://webdev.zalewa.info
>> twit  http://twitter.com/zalun
>> face  http://facebook.com/zaloon
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-us...@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.
>>
>>
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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