codio / boxparts

Simple package manager
https://codio.com
Other
29 stars 26 forks source link

Optional Command Line Parameters #326

Open landyman opened 8 years ago

landyman commented 8 years ago

Is there a way to pass optional command line parameters into boxparts when installing?

For example; if I wanted to install mod_wsgi and use python3; can I setup a boxpart so I can do something like: parts install apache2_mod_wsgi --with-python=/usr/bin/python3 where the optional parameter would be passed into the ./configure part of the installation.

I'm asking partly because I'm wondering if I should try and augment the current boxpart (and update it), or if I should just make a new boxpart that is specifically for python3.

Thanks.

ijobling commented 8 years ago

HI, no you can't pass parameters but can you expand more on exactly what you are looking to do here? Just wondering as you could create your project using the Python3 Stack and then install the apache2_mod_wsgi box part which perhaps gives you what you want here?

landyman commented 8 years ago

Thanks.

What I'm trying to do is run Django (Wagtail) with Python3 in a virtualenv. I tried the Python3 stack with apache2 and apache2_mod_wsgi boxparts last night. The apache2_mod_wsgi boxpart is compiled with Python 2, which I don't think will work according to the errors I was seeing in the apache log. I deleted the project, but I can start up another public project with the settings I used if you'd like to see it.

Thinking that I need a mod_wsgi compiled with Python 3, I was going to see if I could edit the current boxpart so you can target different python versions (since the Python3 stack has both python 2 and 3 on it). But, if I can't do that; then I was just going to make a box part for apache2_mod_wsgi_py3 or something that was compiled with the same python3 that's on the Python3 Stack.

If there is a better way to run Django with Python3 in a virtualenv; then I'm open to other ideas on how to do it. Making a boxpart just seemed to be the most reasonable to me yesterday. There may be other setup options I can do too without mod_wsgi to get it working.

ijobling commented 8 years ago

To be honest haven't heard of anyone doing this for Python3 so far, but you mention errors... not all errors you see may cause problems. See http://deeb.me/20140324/django-on-codio that another user did a while back (python2 I know but he does also explain how to troubleshoot)

but also... are any components you need available already as python packages? pip is built in to python3

landyman commented 8 years ago

I can use other app servers like gunicorn and have them pass them through to web server (usually nginx). Those are available in pip. The wsgi stuff for apache, however, needs to be compiled as far as I know.

I think I'll switch to using gunicorn for now -- it's probably better in my production environment anyhow; mod_wsgi was just easier to initially setup for me. Always good to learn something new though!