Django app_label with spaces - leads to 404 error in admin -


i've been trying customize name of app displayed , have run issue when using spaces in app_label, results in 404 error page when try visit url. example,

app_label = 'occupational therapy' 

results in text displaying intended, visiting url in admin site gives following, though pages individual models appear correctly. example: url/admin/occupational%20therapy/ returns this:

 page not found (404)  request method:   request url: url/admin/occupational%20therapy/  

but url/admin/occupational%20therapy/model displays correctly.

i've tried using this:

app_label = 'occupational_therapy' 

as django documentation seemed state capitalized , strip out underscore automatically, underscore remains, occupational_therapy displayed. in case, urls work if there way strip out underscore, solve problem. otherwise, assume need edit urls.py file?

app_label used indicate django application model belongs , not alter url. if application named polls example place models polls\models\voting.py , polls\models\results.py. models need:

app_label = 'polls' 

i don't know how change urls applications in admin site. changing them on other parts of site should done using urls.py.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -