=========
FilesNow
=========
FilesNow is a Django app to download documnets, images
from AWS S3 and serve is a temporary static content to customers.
FilesNow is a way to serve AWS S3 documents/media files
without giving access to your s3 buckets.
FilesNow itself cleans it's downloaded presentable
files, as such maintainig a healthy file system
Dependecies
-----------
AWS Boto3 Framework : pip install boto3
Configure AWS Credentilas using command : aws configure
Quick start
-----------
1. Add "filesnow" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [
...
'filesnow',
]
2. Include the polls URLconf in your project urls.py like this::
path('filesnow/', include('filesnow.urls'))
3. Start the development server ``python manage.py runserver 0.0.0.0:9090``
4. Visit http://127.0.0.1:9090/filesnow and explore it.
- Create a license file django-filesnow/LICENSE , choose license as per requirement of yours ( GNU, BSD, MIT ) etc, Choose a license website ( https://choosealicense.com/ ) can help you to guide about your required license and it's content. I have used MIT license and you can find it's content within my Github repo.
- Create two setup files within same directory and name it as django-filesnow/setup.cfg and django-filesnow/setup.py with the below content and do replace with your own.
Content of django-filesnow/setup.cfg
[metadata]
name = django-filesnow
version = 0.1
description = A Django app to download cloud contents.
long_description = file: README.rst
url = https://github.com/Jackuna/django-filesnow
author = Jackuna
author_email = admin@cyberkeeda.com
license = MIT License
classifiers =
Environment :: Web Environment
Framework :: Django
Framework :: Django :: 2.2
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content
[options]
include_package_data = true
packages = find:
Content of django-filesnow/setup.py
from setuptools import setup
setup()
Only Python modules and packages are included in the package by default. To include additional files, we’ll need to create a MANIFEST.in file. To include the templates, the README.rst and our LICENSE file, create a file django-polls/MANIFEST.in with the following contents:
Content of django-filesnow/MANIFEST.in
include LICENSE
include README.rst
recursive-include filesnow/static *
recursive-include filesnow/templates *
So now we are all done with creation of required files in order to package your app, lets toggle again into the parent directory ( django-filesnow )and open a terminal/command prompt and run the below command to build our package.
Once command ends with successfully, and additional directory with name "dist" will be created, it contains our bundled and packaged django app, in our case django-filesnow-0.1.tar.gz has been created.
Thus we have packaged our django app by name django-filesnow-0.1.tar.gz, we can distribute it as per your requirement, like uploading to repositories like github, email, uploading to any forum or website.
Let's know how to install our packaged filesnow django app django-filesnow-0.1.tar.gz, use the below command to install it.
# python -m pip install --user django-polls-0.1.tar.gz
Within Above command will install it, for windows we can located the installed application by name "filesnow" under directory.
"C:\Users\Jackuna\AppData\Roaming\Python\Python37\site-packages\filesnow"
Please note:
Above highlighted in red may varry, depending upon your system and package.
Package will be installed by name filesnow only not django-filesnow.
Within next post, we will know the remaining topics !