Hi Josh,

I answered your questions below, but then realized that my "my_proj" 
project app didn't have an __init__.py. After realizing how things are 
supposed to work I changed my INSTALLED_APPS to use "field_experiments" 
instead of the "my_proj.field_experiments" I was using. I had to change a 
few other things too. I'm getting pages not found now from the database so 
I need to track that down, but I think for the original problem it's 
solved. Thanks.

See my original answers below:


> Are there two copies of field_experiments right now?  The error message 
> seems to imply that you have my_proj/my_proj/field_experiments/models.py 
> and my_proj/field_experiments.'
>
> In the code there is only that one "field_experiments" directory. That 
duplicate that it's talking about I think is because it is finding the 
"field_experiments" directory relative to the manage.py (or current 
directory) and its finding the installed package 
"my_proj.field_experiments".
 

> How is field_experiements referenced in your INSTALLED_APPS?
>

I kept it the same as I had which was " 

>
> You're layout looks right and is similar to what I did in the blog post, 
> in that case moving theme out of the project app.  As long as it isn't in 
> the inner my_proj you shouldn't have an issue.
>
> Did you update your manage.py or are you using the same one you've had all 
> along?
>

> For reference I think this is the old manage.py, 
> https://github.com/stephenmcd/mezzanine/blob/3a336635ff24de2d451a5f0bf88a3da365f23ffd/mezzanine/project_template/manage.py,
>  
> and the new one is 
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/manage.py
>
>
I'm using the new manage.py and at first it was using "my_proj" as the 
project name, but I got an error (ImportError: No module named 
'my_proj.settings') because it was finding the installed package first 
instead of the one in the current directory. I then changed it to 
"my_proj.my_proj" which points to the correct location, the project app.
 

> What is currently in my_proj/my_proj?
>

templates/
local_settings.py
settings.py
urls.py
wsgi.py

So from what I can tell, having the outer directory installed as a package 
in my python environment is causing all the problems. It seems like 
manage.py and everything related is finding the outer "my_proj" package 
instead of the current directory's "my_proj" project app directory. 


> On Wed, Aug 5, 2015 at 5:28 PM, David Hoese <[email protected] 
> <javascript:>> wrote:
>
>> I'm fairly new to Mezzanine and Django and I'm having trouble with moving 
>> my old layout to the new layout. I'm following this blog post that was 
>> linked to here earlier, 
>> http://bitofpixels.com/blog/upgrading-to-mezzanine-4/. I usually have 
>> all my python code in python packages so I originally had my mezzanine 
>> project in a python package that I could install...even if it was from a 
>> git clone.
>>
>> My old layout:
>>
>> my_proj_pkg_dir
>> setup.py
>> my_proj
>> __init__.py
>> settings.py
>> field_experiments  # custom django app
>> urls.py
>> wsgi.py
>> manage.py
>> ...
>>
>> My new layout that I'm trying to do:
>>
>> my_proj_pkg_dir
>> setup.py
>> my_proj
>> __init__.py
>> my_proj # mezz project app
>> field_experiments # custom django app
>> manage.py
>> ...
>>
>> From what I understand django now loads things from the "project app" 
>> instead of from the directory so since I have the "my_proj" package I made 
>> it conflicts with the "my_proj" project application. So I get errors when 
>> it accesses the models like:
>>
>> RuntimeError: Conflicting 'experiment' models in application 
>> 'field_experiments': <class 'my_proj.field_experiments.models.Experiment'> 
>> and <class 'field_experiments.models.Experiment'>.
>>
>> So I think my options are to either move the field_experiments app 
>> outside of the project dir and make it its own package or stop 
>> making/installing the my_proj package. If someone could provide me with 
>> some guidance it would be much appreciated. Thanks in advance.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Mezzanine Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to