krisfields / django-baker

Adds a management command that generates views, forms, urls, admin, and templates based off the contents of models.py
BSD 3-Clause "New" or "Revised" License
389 stars 51 forks source link

Fixed wrong URLconf #4

Closed richardcornish closed 9 years ago

krisfields commented 9 years ago

Actually, it's correct the way I have it. In this example, a urls directory would be created inside of the pastries app, and an init.py would be created, the contents of which would be:

from django.conf.urls import patterns, include

urlpatterns = patterns('',

    (r'^danishes/', include('pastries.urls.danish_urls')),  # NOQA
    (r'^tarts/', include('pastries.urls.tart_urls')),
)

So if you add (r'^pastries/', include('pastries.urls')), to your URLCONF, it'll create urls to danishes and tarts (ie. example.com/pastries/danishes/create/). The other option is to add each of the above urlpatterns somewhere else if you want a different url schema.