The cloud panel doesn't into directory in django

66 views
Skip to first unread message

Safa Bayar

unread,
Mar 3, 2018, 8:34:22 AM3/3/18
to Django users

I write cloud panel write python/django. My problem is, urls.py doesn't access next forward directory. I use apache. when it is go to next forward, this page is showing:



my urls.py inside:


from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import TemplateView

admin.autodiscover()

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$','explorer.views.home',name='home'),
    url(r'^servers/$','explorer.views.servers'),
    url(r'^addserver/$','explorer.views.addserver'),
    url(r'^removeserver/$','explorer.views.removeserver'),
    url(r'^manage/(?P<server>[\w]+)/(?P<path>[\w]+)/$','manager.views.filemanager'),
    url(r'^navback/(?P<server>[\w]+)/(?P<path>[\*\w]+)/$','manager.views.navbackward'),
    url(r'^naviforward(?P<server>[\w]+)/(?P<path>[\*\w]+)/(?P<dir>[\w]+)/$','manager.views.navforward'),
    url(r'^edit/(?P<server>[\w]+)/(?P<path>[\*\w]+)/(?P<file>[\.\w]+)$','manager.views.editdata'),
    url(r'^saveandsend/(?P<server>[\w]+)/(?P<path>[\*\w]+)/(?P<file>[\.\w]+)$','manager.views.senddata'),
    url(r'^upload/(?P<server>[\w]+)/(?P<path>[\*\w]+)/$','manager.views.uploadfile'),
    url(r'^delete/(?P<server>[\w]+)/(?P<path>[\*\w]+)/(?P<file>[\.\w]+)$','manager.views.deletefile'),

]

my views.py inside:


https://postimg.org/image/s2c60qr2d/


views.py inside for ssh connection and sftp connection :


https://postimg.org/image/635rdjhxx/


my routing to html file inside:


<
div class="col-md-4">   {% if path != orginalpath %}
 
<a href="http://127.0.0.1:8000/navback/{{ server }}/{{ modpath }}/">
<
span class="glyphicon glyphicon-arrow-left" style="color: #ac2925;height: 30px"></span></a>
 {% endif %} {% for d in dirs %}
<
ul>
  
<li>
       
<span class="glyphicon glyphicon-folder-close" style="color: #eea236"></span>
       
<a href="http://127.0.0.1:8000/naviforward/{{ server }}/{{ modpath }}/{{ d }}/">{{ d }}</a>
   </
li>
</ul>
{% endfor %}
</div>


if you're access to project and image you can be look in link:


https://postimg.org/gallery/3iakj1t7a/


https://gitlab.com/rection/Cloud-Panel-Django.git


How to be solution my problem?


Dylan Reinhold

unread,
Mar 3, 2018, 12:15:17 PM3/3/18
to django...@googlegroups.com
Your sample URL /navforward/DigitalOcean/*root*docker-bench-security/
Does not match anything in your urls

This one looks to be the closest:
url(r'^naviforward(?P<server>[\w]+)/(?P<path>[\*\w]+)/(?P<dir>[\w]+)/$','manager.views.navforward'),

In the url there is no / after navforward, and it going to be looking for a / between *root* and docker-bench

Dylan


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d0d88a09-272b-494d-a1eb-a25cd77a5ffd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Safa Bayar

unread,
Mar 4, 2018, 5:06:28 AM3/4/18
to Django users

It doesn't work and i clap eyes on other link in html file. link is delete file, edit page, download link etc. he did what you said, but it did not work. I got the same mistake.



3 Mart 2018 Cumartesi 20:15:17 UTC+3 tarihinde Dylan Reinhold yazdı:
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
manage.html
urls.py

Jason

unread,
Mar 4, 2018, 7:11:46 AM3/4/18
to Django users
I suspect it's due to the aserisks (*) in your URL with *root*.  

Remove that, and change (?P<path>[\*\w]+)/  to (?P<path>[\w]+)/

While an asterisk is a valid character in the URL, I've never seen it used in practice.  Your experiences here make me suspect you're not escaping both asterisks, and thus the issue.
Message has been deleted

Safa Bayar

unread,
Mar 4, 2018, 9:07:50 AM3/4/18
to Django users


you're right. i am mistake. i try to your say but doesn't work. i changed althought it is not change. why did this made? i don't understand.


4 Mart 2018 Pazar 15:11:46 UTC+3 tarihinde Jason yazdı:
Reply all
Reply to author
Forward
0 new messages