> I'm not a programmer by profession, but I use Python a lot. For 
> example, I use it to interface with the 90+ tables of Drupal directly 
> to avoid php. Drupal is just horrible  with all dependencies and 
> trying to get the proper data displayed. Php just isn't my thing and 
> you seem to spend ages with troubleshooting, figuring out how to do 
> things. 
>
> In Python I can easily get the data I want, but I don't really 
> understand the advanced templating and URLconfig in Django yet. I 
> think I can make the apps I want (or rebuild existing ones), but 
> putting these together is my problem. On internet and in the books not 
> a lot of information can be found on integrating say 10 different apps 
> on a single page.


It doesn't sound like you're using Drupal in a "drupally" way so there will 
be less of a transition-shock than might be the case. You still might want 
to look into a Django based CMS, though, because Drupal provides a lot of 
functionality that Django obviously won't out of the box. Here's a handy 
list: http://djangopackages.com/grids/g/cms/

To answer your original questions:
1 - Common practice is to use a SlugField for what you're calling a "page 
id" and making it part of your models. You can make it unique or unique in 
combination with other fields within Django. If you use a CMS built on top 
of Django, you'll likely get a Page model already built that will handle a 
lot of your requirements. If you use a concrete base class  for you Models 
(not usually recommended), you can enforce uniqueness on the slugs at the 
database level (at the cost of additional joins). Check out the docs for 
SlugField and model inheritance. 

2 - Unless you build or use a 3rd-party app, there is no auto-assignment of 
templates in the same way as Drupal's baroque theming system. Again, a 
pre-built CMS system should have a simple way of mapping pages to layouts, 
and it isn't too difficult to build a Page model that has a layout as a 
property or a system that introspects the request and assigns templates 
based on rules. You can get an analog of Drupal's template override system 
with a few lines of Python and  django.template.loader.select_template(**). 
I would read up on the template loading mechanism or take advantage of 
whatever CMS you are using (if you decide to go that route).

V

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/0n3B7lp4cpoJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to