Were there any things peculiar to the Raspberry Pi environment to get it running? If so, it would a cool thing to blog about, or add a recipie to Pyramid Community Cookbook under Deployment.

https://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/deployment/

--steve


On 3/1/18 at 12:10 PM, [email protected] (Darren Jones) pronounced:

Michael - thanks a million! That was what I needed (and another hour of work!) to get it up and running - just got it running now. Now that I have it up and running I will be able to get it all working much more smoothly (I think something is awry with the current setup and permissions), but I have something to work from now. Thanks again, your advice was invaluable!
Darren

On Thursday, 1 March 2018 19:20:49 UTC, Michael Merickel wrote:

The easiest way to see if your code is installed properly is to make sure you are not in the folder with your code and then try to import it.

$ cd /
$ /srv/venv/bin/python
import gdpr_permissions

If this doesn't work then it's not installed correctly either using `/srv/venv/bin/pip install -e <path/to/folder/with/setup.py>` or without the `-e` depending on your goals.

Further if you want to test that your ini file is pointing at your code properly then you can do that similarly.

$ cd /
$ /srv/venv/bin/python
from pyramid.paster import get_app
app = get_app('/srv/myapp/gdpr_permissions/production.ini')

This command is almost exactly what uwsgi is doing to load your code and it will fail with the same DistributionNotFound error you're seeing.

- Michael


On Thu, Mar 1, 2018 at 10:40 AM, Michael Merickel <[email protected] <javascript:>> wrote:

The DistributionNotFound error basically always means that your code is not installed into the virtualenv being used by uwsgi. In this case it's /srv/venv. You should ensure that you've run /srv/venv/bin/pip install appropriately.

- Michael

On Thu, Mar 1, 2018 at 5:57 AM, Darren Jones <[email protected] <javascript:>> wrote:

Dear all.

I've written my first (worthwhile!) app using Pyramid, and want to deploy it to a raspberry pi. I've got the pi up and running, and nginx working fine - it can serve a static page or even a simple (test, three line) wsgi app. However, I am hitting a brick wall on getting the pyramid app up and running using uWSGI. I've spent the last three days (solidly!) trying to get this up and running, and still I can't get it going. I've tried loads, but my current issue appears to be that I can't get uWSGI to run the pyramid app from the command line - my current launch command is sudo uwsgi --plugin python3 -H /srv/venv production.ini --socket/srv/myapp/uwsgi.sock

When I run this, I just get [uWSGI] getting INI configuration from production.ini, and then back to the command line.

Yesterday, I got as far as sudo uwsgi --plugin python3 -H /srv/venv --paste config:/srv/myapp/gdpr_permissions/production.ini --socket /srv/myapp/uwsgi.sock which was giving me more output (what looks to be the uWSGI startup info), but then errors such as

pkg_resources.DistributionNotFound: the gdpr_permissions distribution was not found and is required by gdpr_permissions

I don't seem to be able to find an authoratitive tutorial on this - they either say 'simply enter uWSGI production.ini and away you go', or seem to be 5+ years out of date, and I'll get so far and then run aground again - many of the links given searching on this list for nginx uwsgi lead me to either dead links, things I've already tried, or impenetrably complex explanations that don't go into details relevant to pyramid apps.

If someone could point me in the right direction, it would be immensely helpful. I don't -think- I'm a complete idiot (I'm happy doing sysadmin stuff, and have compiled from source back in the RH5 days,etc), but it seems everyone else must be able to just get this working without issues given the lack of discussion on the subject. I'm at the point of giving up.

Thanks

Darren

-- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <javascript:>. To post to this group, send email to [email protected] <javascript:>.
 To view this discussion on the web visit
https://groups.google.com/d/msgid/pylons-discuss/6e882888-2ab4-42d7-8502-6c89423104cf%
40googlegroups.com

<https://groups.google.com/d/msgid/pylons-discuss/6e882888-2ab4-42d7-8502-6c89423104cf%
40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.






------------------------
Steve Piercy, Eugene, OR

--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/r473Ps-10126i-40676EB9824143F281D2CE50BF53EA2F%40Steves-iMac.local.
For more options, visit https://groups.google.com/d/optout.

Reply via email to