Thursday, August 1, 2013

Re: Upgrading to 1.5 on Centos

Move at least your settings.py into a new sub-directory named for the project (as with new projects in 1.4 or 1.5 -- you might make one if you haven't just to look at the directory structure), and add an __init__.py to that directory.

You may need to (probably should) move your top level urls.py there as well.

You may also need a wsgi.py file there (again, look at a newly made 1.5 project).

Additionally, if you have any app directories as siblings to your (original location of) manage.py, and you are refering to them prefixed by your project name, you will either need to fix all the references (INSTALLED_APPS, when one module imports another) to not include the project name, or you will need to move those apps into the new subdirectory.  (This is because the top directory is no longer a loaded package relative to which you can import, though it is still on sys.path, so you can import things in it *without* using the project name.  There was a lot of clever fiddling in pre 1.4 to get that package imported.)


On Thu, Aug 1, 2013 at 11:43 AM, Larry Martell <larry.martell@gmail.com> wrote:
On Thu, Aug 1, 2013 at 9:27 AM, Tom Evans <tevans.uk@googlemail.com> wrote:
> On Thu, Aug 1, 2013 at 4:10 PM, Larry Martell <larry.martell@gmail.com> wrote:
>> Thanks very much Tom. This explains a lot - we were using the 1.3
>> manage file with 1.4. I'm very close now, but I'm not sure what to put
>> in for project_name - my project is called 'motor'. I tried
>> motor.settings, but I got 'could not import motor.settings: No module
>> named motor.settings'. I tried just 'settings' and that made manage
>> happy, but then it could not import any of my installed apps (which
>> all start with motor.).
>
> This is all covered by the same link I gave you earlier. You may need
> to restructure your project and/or adjust what you import your apps
> as.

OK, I see. Moving manage.py one dir level up makes it all work, but
that dir is not part of our project structure and not under version
control. If I leave it where it is I have to change a lot of
references that start with 'motor.' - not just the few in settings,
but all over the place. I guess I'm going to go with the latter and
make it part of the install procedure to copy manage. Ugh.

Thanks!
-larry

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate