For those unfamiliar, DotCloud is a Platform as a Service (PaaS) offering a freemium model. I’m grateful to them for this as the free account provides all I need for my demo.
First, I followed to the letter Phillip Smith’s comprehensive guide on deploying a Perl Catalyst application to the DotCloud service. Next I customised the basic application created in the guide to use AutoCRUD:
basepath
in the configurationsupervisorctl restart uwsgi
)Next I wanted a more tidy looking domain for the demo, so purchased autocrud.pl
through NETIM. My plan is to have demo.autocrud.pl pointing to the DotCloud instance, and sometime in the future to have autocrud.pl
be used for a secret feature I’m still working on. Sadly NETIM only offers HTTP redirects from subdomains, so I delegated hosting of the DNS to ClouDNS.
ClouDNS is another freemium service, again where the free part provides just what I need. They offer not only a bit of a smarter interface than NETIM for DNS zone management, but also HTTP redirects from the zone apex.
I do of course know that nothing lasts forever, particularly with freemium services, and I’m grateful for what’s available because it works very well (I’ve added promotional icons for ClouDNS and DotCloud to the demo site).
The end result of this is that I now have the AutoCRUD demo safely hosted on DotCloud with a friendly URL to pass out in documentation or blog posts
For the list screen:
list_display = ('field1', 'field2')
list_display_links = ['field2']
list_editable = ['field2']
list_filter = ('field1', 'field2')
list_per_page = 20
search_fields = ['field1', 'foreign_key__fieldname']
For the edit screen, it’s possible to control the form layout and displayed fields:
fieldsets = (("Title"|None, options), ) options = { fields : (('one', 'line', 'together'), 'field5', 'field6'), classes : ['collapse', 'wide'] }
or use the following:
fields = ('field1', 'field2') exclude = ('field3', 'field4')
And some other edit screen options:
filter_horizontal|filter_vertical = ('multi_select_field')
radio_fields = ('fk_field', 'choice_field')
save_on_top = True
For further details, see the Admin App documentation. Also useful are the Custom Actions documentation, the DB Queries documentation, and the QuerySet documentation.
]]>db_table = "string"
managed = False
(whether SQL is generated by the manage.py app)ordering = ['column1', '-column2']
(NB admin app only uses the first)order_with_respect_to = 'fk_field'
unique_together = (('column1', 'column2'), )
verbose_name = "String"
verbose_name_plural = "String"
abstract = True
null = True
blank = True
choices = (('db_val', 'displayed_val'), )
db_column = "string"
db_index = True
default = "string"
editable = False
primary_key = True
unique = True
verbose_name = "String"
AutoField
BooleanField
CharField (max_length=integer)
DateField|DateTimeField(auto_now_add=True)
IPAddressField
PositiveIntegerField
TextField
ForeignKey(Class, to_field='related_field')
ManyToManyField(Class, to_field='related_field')
For further details, see the Models documentation, Meta Options documentation and Field Types documentation.
]]>