Your BASE_DIR value in your settings file is possibly wrong if you have 
reorganised how settings are kept from normal second level to third level 
directory.

If you run:

    python manage.py diffsettings

what does it show for BASE_DIR? Is it the directory above your project 
directory?

Also, what version of Django are you using? If your code base was ported from 
very old Django, the settings file might not even have BASE_DIR, in which case 
runmodwsgi tries to calculate BASE_DIR but it will again be wrong if you have 
moved settings to third level directory.

Either way, the BASE_DIR directory is used for the --working-directory option 
so that the project can be found properly. If your BASE_DIR is wrong but you 
can't change it for some reason, add:

    --working-directory .

when running '--setup-only'.

    python manage.py runmodwsgi --setup-only --server-root /some/path 
--working-directory . 

That presumes your manage.py is still in the directory which is the parent to 
your project directory.

Graham

> On 14 Feb 2018, at 6:26 pm, Rafael Karosuo <rafaelkaro...@gmail.com> wrote:
> 
> I started testing the information you gave me.
> I'm stuck with an import error since I used the server-root option.
> I assumed that doing something like
> export PYTHONPATH='my_project_container_dir/my_parent_module'
> would be enough before doing the apachectl start command, but it is not 
> working correctly
> 
> Dir structure is as follows
> my_project_container_dir/
>    my_parent_module/
>       __init__.py
>       ...(urls, wsgi.py, etc)
>       settings/
>          __init__.py
>          production.py
>    ...(django apps, manage.py, etc, no __init__.py file)
> 
> When I check the error_log, it shows an import error saying that 
> "my_project_container_dir" is not found.
> 
> At this point, I already set up the DJANGO_SETTINGS_MODULE correctly, after 
> doing the python manage.py runmodwsgi, and apachectl start.
> 
> ... I've tested that if I modify the DJANGO_SETTINGS_MODULE in manage.py I 
> can patch this import error (but brake my internal references)
> I think that the problem is not modifying the manage.py, but, is the 
> manage.py executed after doing the apachectl start command? or can you please 
> point me out what am I missing here?
> 
> Thanks a lot in advance for all of your help and time.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to modwsgi+unsubscr...@googlegroups.com 
> <mailto:modwsgi+unsubscr...@googlegroups.com>.
> To post to this group, send email to modwsgi@googlegroups.com 
> <mailto:modwsgi@googlegroups.com>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

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

Reply via email to