tokibito / django-ftpserver Goto Github PK
View Code? Open in Web Editor NEWFTP server application that used user authentication of Django.
Home Page: https://django-ftpserver.readthedocs.org/en/latest/
License: MIT License
FTP server application that used user authentication of Django.
Home Page: https://django-ftpserver.readthedocs.org/en/latest/
License: MIT License
When running manage.py ftpserver
with a non-root user I get a Permissions denied error. What directory/file is causing this? Or is a root user necessary to run the command?
Here is the complete traceback:
Traceback (most recent call last):
File "/app/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python3.9/site-packages/django_ftpserver/management/commands/ftpserver.py", line 147, in handle
server = self.make_server(
File "/usr/local/lib/python3.9/site-packages/django_ftpserver/management/commands/ftpserver.py", line 61, in make_server
return utils.make_server(
File "/usr/local/lib/python3.9/site-packages/django_ftpserver/utils.py", line 67, in make_server
return server_class(host_port, handler)
File "/usr/local/lib/python3.9/site-packages/pyftpdlib/servers.py", line 114, in __init__
self.bind_af_unspecified(address_or_socket)
File "/usr/local/lib/python3.9/site-packages/pyftpdlib/ioloop.py", line 1018, in bind_af_unspecified
raise socket.error(err)
OSError: [Errno 13] Permission denied
Trying to see if there's a way to speed up the listdir function. If I have a large folder with 100+ files, it takes quite some time for the listdir function to return--I'm using the StorageFS class.
This returns very quickly when I time it, so unsure where the latency is hidden.
directories, files = self.storage.listdir(path)
.
It must be somewhere in pyftpdlib?
Does anyone have any suggestions on how to speed this up?
Hi, I have a test server directly on the internet. But when I try to connect to this from a computer behind NAT I get this error:
python3 manage.py ftpserver -v 3 95.xxx.178.66:8002
[I 2021-09-07 10:39:18] concurrency model: async
[I 2021-09-07 10:39:18] masquerade (NAT) address: None
[I 2021-09-07 10:39:18] passive ports: None
[I 2021-09-07 10:39:18] >>> starting FTP server on 95.xxx.178.66:8002, pid=90532 <<<
[I 2021-09-07 10:39:21] 80.xxx.72.162:64707-[] FTP session opened (connect)
[I 2021-09-07 10:39:21] 80.xxx.72.162:64707-[BOX-001] USER 'BOX-001' logged in.
[W 2021-09-07 10:39:22] 80.xxx.72.162:64707-[BOX-001] Rejected data connection to foreign address 192.168.1.101:64708.
And then it drops the connection. Any idéers what to do here? I think I'm missing some piece of the puzzle but can't find it ;)
\Zapster
Request document on securing the FTP
and also running with gunicorn
I got this error when I ran python manage.py ftpserver 10021
as per your documentation
RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead self.fetch_command(subcommand).run_from_argv(self.argv)
It also threw OSError: [Errno 13] Permission denied
error. How to handle it?
Getting errors after running FTP server for a while:
OperationalError: (2006, 'MySQL server has gone away')
Trying to find best way to resolve it. I tried making the SQL connection persistent in the settings.py file. Is there someplace I can close the connection when idol? Another way to resolve?
Hi I'm using your package with django 1.9 and I got an error when I tried to run ./manage.py ftpserver
This is the error
/path/to/django_ftpserver/management/commands/ftpserver.py in <module>()
10 from django.conf import settings
11 from django.core.management.base import BaseCommand, CommandError
---> 12 from django.utils.daemonize import become_daemon
13
14 from django_ftpserver.authorizers import FTPAccountAuthorizer
ImportError: No module named 'django.utils.daemonize'
I managed to install ftp server and works great with windows and Mac folders but fails when connected to it using Filezilla.
Any one has tried this before ?
Appreciate help here.
On Django 3.0 django-ftpserver will cause a fatal exception
ImportError: cannot import name 'python_2_unicode_compatible'
caused by using the Python 2 compatible API that has been depracated since 2.0 but has been removed in 3.0. It might be useful to use the PR used to make django-simple-history 3.0 compatible available here as guidance for fixing the issue here too.
This package seems not compatible with Django 2.x:
Traceback (most recent call last): File "manage.py", line 17, in <module> execute_from_command_line(sys.argv) File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 357, in execute django.setup() File "/usr/local/lib/python3.5/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.5/site-packages/django/apps/registry.py", line 112, in populate app_config.import_models() File "/usr/local/lib/python3.5/site-packages/django/apps/config.py", line 198, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 673, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 662, in exec_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed File "/usr/local/lib/python3.5/site-packages/django_ftpserver/models.py", line 31, in <module> class FTPUserAccount(models.Model): File "/usr/local/lib/python3.5/site-packages/django_ftpserver/models.py", line 33, in FTPUserAccount get_user_model_path(), verbose_name=_("User")) TypeError: __init__() missing 1 required positional argument: 'on_delete'
Since Django 2.x, on_delete is required. (Django Documentation)
I'm unable to use django-ftpserver on a windows platform.
ImportError: No module named pwd
I develop on a Windows 7 and deploy on an Ubunutu, any work around?
Edit: Confirmed not working in Windows, does not support: getgid, getuid, pwd, seteguid, seteuid, getpwnam, etc.
Hey,
I have setup django-ftpserver in my application. On my localhost runs everything as expected. But if I try to run the django application in my docker machine with docker-compose the ftp-client don´t have access to the user-dir. Do you have an idea what I need to setup in addition? Unfortunatelly I didn´t get any error-logs.
Many thanks,
Fabian
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.