imgiitroorkee / django-filemanager Goto Github PK
View Code? Open in Web Editor NEWA simple Django app to browse files on server
License: MIT License
A simple Django app to browse files on server
License: MIT License
How to use it in django 2.2.7. If it can't. How to upgrade it ? thanks
The code is not consistent with PEP-8 style guidelines. There are some simple tools like pycodestyle which could be used to solve this.
Currently the maximum permissible number of folders are 50 and maximum storage limit is 5 Mb. I think this needs to be increased.
One of the very important requirements of open source packages is being able to test them. Django's tests are good enough as they use unittest framework of python. This is something that needs to be done soon.
There are a lot of catchall excepts in the code. These can hide exceptions that should actually bubble up through the stack.
We should make all except clauses use exception classess for the specific type of exception we are expecting and handling.
After trying typing in browser /abc/ url
Exception Type: WindowsError
Exception Value: [Error 2] The system cannot find the file specified: '/media/user_folder'
Exception Location: C:\myproject\filemanager\__init__.py in directory_structure, line 210
#filemanager/__init__.py
def directory_structure(self):
self.idee = 0
dir_structure = {'':{'id':self.next_id(),'open':'yes','dirs':{},'files':[]}}
os.chdir(self.basepath) #<-----line 210
for directory,directories,files in os.walk('.'):
directory_list = directory[1:].split('/')
current_dir = None
nextdirs = dir_structure
for d in directory_list:
current_dir = nextdirs[d]
nextdirs = current_dir['dirs']
if directory[1:]+'/' == self.current_path:
self.current_id = current_dir['id']
current_dir['dirs'].update(dict(map(lambda d:(d,{'id':self.next_id(),'open':'no','dirs':{},'files':[]}),directories)))
current_dir['files'] = files
return dir_structure
The code uses +
to compose strings instead of using the modern python standard of u''.format
There are also some instances of %
formatting.
We should convert all of the above to use u''.format
.
Add the badges of Travis, Coveralls, Requirements etc to README.md which imply the code details.
As of now, for cut/ copy we'll need to click on a directory to see the actions possible which is not really intuitive. The goal is to enable actions everywhere on right click.
As of now, a lot of code has been written in the __init__.py
file which is a bad practice. The goal is to refactor the code.
The code uses string literals ''
instead of unicode literals u''
in a lot of places. When combined with potential unicode characters from database content this will break on encoding errors.
We should convert all regular string literals to unicode literals.
This thread shall have all the discussion related to the frontend tests and possible linters that can be used. Suggestions are welcome.
AttributeError at /admin/home/homepage/1/
'module' object has no attribute 'CKEditorWidget'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/home/homepage/1/
Django Version: 1.7
Exception Type: AttributeError
Exception Value:
'module' object has no attribute 'CKEditorWidget'
Exception Location: C:\djangoproject\filemanager\models.py in formfield, line 16
This is models.py of app 'home'
class HomePage(models.Model):
homecopy = CKEditorField(filemanager_url='/app/abc/')
class Meta:
verbose_name=verbose_name_plural="1. Main Page"
def __unicode__(self):
return 'Main Page'
When I change
from filemanager.models import CKEditorField
to
from filemanager.widgets import CKEditorWidget
I have no errors, but CKEditor dissapears and I don't even have any text areas in my django admin panel.
Views of my djangoproject urls.py
urlpatterns = patterns('',
url(r'^abc/'+path_end,'view'),
url(r'^$','home.views.index'),
url(r'^ckeditor/', include('ckeditor.urls')),
url(r'^admin/', include(admin.site.urls)),
)+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Hi, the question is dead or works for compatible version django 1.10.x???
thank
File names containing special characters shall be parsed using urllib to prevent errors.
im trying to integrate file manager with django 3.8.0 but it always giving error :ImportError: cannot import name 'path_end' from 'filemanager'.
I want to know that is this project compatible with django 3.8.0
the default root folder is the parent of filemanager folder.
The code base breaks when the file containing spaces is uploaded. The task is to sanitize the input filenames.
after installing the package i'm unable to import FileManager according to the instructions in the readme
Right click isn't working. The goal is to make it functional
I believe this issue stems from here: https://github.com/IMGIITRoorkee/django-filemanager/blob/master/filemanager/static/filemanager/js/script.js#L41. I believe that this was a bug in Firefox long ago: https://bugzilla.mozilla.org/show_bug.cgi?id=701353 and has since been fixed, making the extra click redundant. Removing the extra click function fixes Firefox 24, and does not break Chrome 32.0.1700.107. I wanted to confirm the reason for this code block before issuing a pull request to remove it. Let me know if this is the correct way to proceed.
Thanks!
SB
Hey,
i am new in using the filemanger and after installation I get this error, when using the brwoser inspector:
ReferenceError: CKEDITOR is not defined
Generally, is it possible to use the filemanger in Django 2.1.7?
Hello,
I just tried this plugin, but I have an issue :
Refused to execute script from 'http://127.0.0.1:8000/abc/filemanager/js/script.js' because its MIME type ('image/png') is not executable.
Every script has the same error message in the console log (Chrome for Linux)
In my settings, I have :
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATIC_URL = '/static/'
MEDIA_ROOT = '/home/steph/Téléchargements/'
I ran collectstatic, and I can see elements from filemanager in the "static" directory. The js url should not contain "static" somewhere ?
The code uses "
for some strings and '
for others. This is poor style, we should pick one. There is no preference for either one, so whoever fixes this issue gets the freedom to choose.
How can I setup this repo in order to contribute?
Please add the contribution guidelines so that it will be easier to setup for development.
We could use Travis CI, Circle CI or any other CI depending on what is beneficial. Continuous integration is basically used to build the repo and check for errors. Which will play a major role after the tests have been written and make things easier. Just need to add some files which will instruct the CI to do so. #15 needs to be completed as soon as possible.
Can be seen at https://travis-ci.org/IMGIITRoorkee/django-filemanager/. Most of them are linting errors as of now. #14 shall be closed with this too.
This should contain all the python packages that are necessary to run the app.
In order to view a particular file, as of now we'll need to download it first. A file preview feature in the browser is something desirable.
There seems to be issue in installing some package when running python setup.py develop
. The goal is to fix it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.