Skip to content

Instantly share code, notes, and snippets.

@raprasad
Last active December 7, 2016 20:18
Show Gist options
  • Select an option

  • Save raprasad/58fc81961b63c78144312bb6bf8a25e6 to your computer and use it in GitHub Desktop.

Select an option

Save raprasad/58fc81961b63c78144312bb6bf8a25e6 to your computer and use it in GitHub Desktop.
home page to list plants
  • File to change: greenhousedb/plants/urls.py

1. Make home page the plant listing page

Change 'apps.greenhousedb.views.home' to 'apps.greenhousedb.views.view_plants'

Current lines

  # Examples:
    url(r'^$', 'apps.greenhousedb.views.home', name='home'),

    url(r'^list-plants/$', 'apps.greenhousedb.views.view_plants', name='view_plants'),

Updated

Have two urls go to the "list plants" page: /list-plants AND the homepage

  # Examples:
    url(r'^$', 'apps.greenhousedb.views.view_plants', name='home'),

    url(r'^list-plants/$', 'apps.greenhousedb.views.view_plants', name='view_plants'),

2. Change the commonly used '/admin' url

Change ^admin/ to something else, e.g. '^arboretum-admin/

Current

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),

Updated

    # Uncomment the next line to enable the admin:
    url(r'^arboretum-admin/', include(admin.site.urls)),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment