Django
Learn how to configure Django for use with Filebase
Last updated
Was this helpful?
Learn how to configure Django for use with Filebase
Last updated
Was this helpful?
Django is a Python web framework designed for rapid, highly-scalable development and deployment of web applications. Django offers a clean, pragmatic and secure design that enables developers to create web apps quickly and efficiently. Django is free and open source.
Read below to learn how to create a basic Django web app that communicates with your Filebase account and Filebase buckets.
This guide was written using Ubuntu 20.04. Commands may vary depending on your operating system.
This guide shows a sample configuration and how to connect a Django application to Filebase. Filebase is unable to provide debugging for custom applications due to their individualized nature.
pip install django
django-admin
This command will return a list of django core commands.
django-admin startproject projectname
This command will create a Django project with the base level framework.
Your project’s directory will be a sub directory of where you ran the startproject
command. In this example, the project is located at /home/filebase/testproject
.
python3 manage.py runserver
You should see the following webpage:
Start by installing django-storages with the following command:
pip install django-storages
pip install boto3
python3 manage.py collectstatic
When prompted, enter ‘yes’. The output should resemble the following:
From here, you can interact with the Filebase bucket from within your Django project.
Add the following lines to the file, replacing values as necessary to match your configuration: