Best Practices for Django App Packaging

Stephen Gallagher sgallagh at redhat.com
Tue Jan 21 18:25:09 UTC 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/21/2014 11:22 AM, John.Florian at dart.biz wrote:
>> On 01/21/2014 03:45 PM, John.Florian at dart.biz wrote:
>>> While I've been packaging Python apps for Fedora for a long
>>> time, I'm a complete novice to Django.  I've just completed my
>>> first app (using the built-in development server) and now want
>>> to get it packaged.  Thus far I've followed my normal model of
>>> using setuptools so that everything very cleanly lands in
>>> /usr/lib/python2.7/site-packages/my_package.  My Django app is
>>> under there, along with other related Python modules that are
>>> used independently of the Django app.
>>> 
>>> I'm not finding any docs in the Fedora package guidelines and
>>> am unaware of existing packages that might serve as excellent
>>> examples.  My web searches are turning up lots, but nothing
>>> much specific to Fedora.
>>> 
>>> At the moment, I'm particularly struggling with how to make my 
>>> /etc/httpd/conf.d/myapp.conf point to my 
>>> /usr/lib/python2.7/site-packages/my_package/my_site/wsgi.py in
>>> a good generic RPM spec sense.  I'd rather not hard-code the
>>> Python version in myapp.conf.
>>> 
>>> Any pointers would be greatly appreciated.
>>> 
>> If you want an exampple, please look at openstack-dashboard: [1]
>> is the config file to be dropped at /etc/httpd/conf.d (for 
>> httpd-2.2) or [2] for httpd-2.4
>> 
>> The spec is here[3] for reference.
>> 
>> HTH, Matthias
>> 
>> 
>> [1] 
>> http://pkgs.fedoraproject.org/cgit/python-django-horizon.git/tree/
>>
>> 
openstack-dashboard.conf
>> [2] 
>> http://pkgs.fedoraproject.org/cgit/python-django-horizon.git/tree/
>>
>> 
openstack-dashboard-httpd-2.4.conf
>> [3] 
>> http://pkgs.fedoraproject.org/cgit/python-django-horizon.git/tree/
>>
>> 
python-django-horizon.spec
> 
> Thanks Matthias!  That's quite a complicated example, although I
> can see there's much I can learn from it.  Unfortunately, it's not
> the ideal example because it moves everything that setup.py builds
> into /usr/share/openstack-dashboard.  I need to keep stuff under 
> /usr/lib/pythonX.Y/site-packages so that the other, non-Django,
> parts continue to work as expected.  (I suppose I could just
> relocate the Django-parts of the build, but sounds like it will
> break more things that it will help.)
> 

Another example you may want to take a look at is ReviewBoard, which
is pretty straightforward.

http://pkgs.fedoraproject.org/cgit/ReviewBoard.git/tree/ReviewBoard.spec

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLeu4UACgkQeiVVYja6o6N22QCeJk4+xNa0tciSy4Iu//UaA8mi
mNYAoIqoD9BCTI2lXX/LqKO0ikA0CYor
=Lsln
-----END PGP SIGNATURE-----


More information about the devel mailing list