S
S
Safronov_Alexei2021-01-17 17:16:36
Django
Safronov_Alexei, 2021-01-17 17:16:36

Put Django on CPanel, how to set up routes?

Hi Habr!
Please do not throw tomatoes at me, I didn’t want to install Django on CPanel :D
In general, I installed Django on CPanel and the site worked in example.com mode, but only I went to example.com/gallery page CPanel said 404 error. I fixed this mistake, I should have just created the address folders in public_html, maybe there is a smarter solution, but I found this -_- The
question is how to optimize this for the django admin panel, well, that is,
I add an entry to the addresses admin/ table/add -> created folders admin/table/add in public_html
And if I need to change entry 3, for example, then the address is admin/table/3/change, so how can I automatically create folders after adding an entry or tell me a more convenient method solutions!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Safronov_Alexei, 2021-01-17
@Safronov_Alexei

I close the issue!
I figured out what can be done for those who are faced with the same problem!
Guys put this in your .htaccess

RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ /site.wsgi/$1 [QSA,L,PT]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question