python-django charm with subordinate app - help needed

Adam Stokes adam.stokes at ubuntu.com
Mon Jun 9 14:30:21 UTC 2014


I did something like this though I didnt use the python-django charm

https://github.com/battlemidget/juju-apache-gunicorn-django

You may be able to get some ideas from that

On Sun, Jun 8, 2014 at 11:32 PM, Tim Penhey <tim.penhey at canonical.com> wrote:
> Hi all,
>
> I'm looking at using the subordinate charm method for delivering the app
> payload to the python-django charm.
>
> From the pyton-django readme:
>
>> When you add a relation between your charm and the python-django
>> charm, you will be able to get those relation variables from the
>> hook:
>>
>>   settings_dir_path
>>   urls_dir_path
>>   django_admin_cmd
>>   install_root
>>
>> Now your charm will be informed about where it needs to add new
>> settings and urls files and how to run additionnal Django commands.
>> The Django charm reloads Gunicorn after the relation to catch the
>> changes.
>
> Unfortunately the doc doesn't explain what I need to put where.
>
> Lets say I have my django application in revision control, but it isn't
> public (because it will be SAAS :-).  It follows pretty standard django
> format, and testing wise I just use: ./manage.py runserver
>
> I have a settings file, and urls, and dependencies that I use a virtual
> environment and a pip requirements.txt file for.
>
> I'm thinking that I should have the install and upgrade hook use pip to
> install the requirements.  It seems that the current python-django charm
> isn't yet set up to handle virtual environments, is that right?
>
> How then do I hook up the database for example?  I have settings in my
> current settings.py, but this will clearly be superseded by the
> relationship between python-django and postgresql.
>
> Are there examples I could look at for existing charms that do this type
> of thing?
>
> Any help greatly appreciated.
>
> Cheers,
> Tim
>
>
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev



-- 
[ Adam Stokes ]



More information about the Juju-dev mailing list