RoomFiles is a web-application made with the Django framework. It's core functions are:
- Create virtual rooms with other users.
- To join rooms, users should have the room's secret code (UUID).
- Room's secret codes can be shared through QR codes, and plain text.
- These rooms are places where you can upload files and post announcements for other users to see and collaborate with.
- Room creator's can manage the people joining in their room. They can ban any users they don't want inside their room.
- Django Framework
- Django Google Drive Storage
- Django REST Framework (Handling AJAX requests)
- Bootstrap Material Design
- QRCode.js (QR Code generator)
- js-cookie (For easier csrf_token fetching)
- waypoints (For infinite scrolling)
- django_heroku (For seamless Heroku deployment)
To setup a local development server of this app:
- Clone this repository.
- Set up a Python virtual environment (I used virtualenvwrapper)
- Make a virtual environment:
mkvirtualenv ENV_NAME
- Activate the venv:
workon ENV_NAME
- Install the dependencies in ./requirements.txt. Open a terminal in the project folder then run:
pip install -r ./requirements.txt
- Make a virtual environment:
- Download and install PostgreSQL.
- After installation, create a new database for the app.
- Modify the database settings in ./roomfiles/settings.py file. (
roomfiles.settings.DATABASES.default
)
- Reset the migrations, because these includes custom migrations I made that involves data migrations to preserve data I had already by other users. But for a new setup, this is irrelevant.
- Delete all files inside
./rooms/migrations/
and./users/migrations/
folders, EXCEPT__init__.py
files. - Run initial migration:
python manage.py makemigrations python manage.py migrate
- Delete all files inside
- Import static images for Avatars and Room Backgrounds using:
python manage.py import_avatars python manage.py import_roombg
- Change other variables in the settings file:
- Change DEBUG to True:
DEBUG = True
- Generate a new SECRET_KEY by:
- Opening a shell:
python manage.py shell
- Then running these commands:
>>> from django.core.management.utils import get_random_secret_key >>> print(get_random_secret_key()) copy_this_secret_key
- Opening a shell:
- Set the newly generated secret key to your settings:
SECRET_KEY = 'paste_secret_here'
- Change DEBUG to True:
- Optional: To get the reset password feature to work, you need to add a Google App Password with your google account (preferably not using your personal account). Then change these settings variables:
EMAIL_HOST_USER = 'your_email_here@gmail.com'
EMAIL_HOST_PASSWORD = 'your_app_password_here'
At this point, you can run the local development server, but uploading files won't work because it uses django-googledrive-storage
as the media storage for file uploads.
To set this up, follow the documentation at django-googledrive-storage. For the general steps, you need to:
- Set up a project and application in a Google Developer Console.
- Enable the Google Drive API from the Console.
- Obtain the JSON private key file. Copy the contents of the file to an environment variable with the name
GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS
.- Alternatively, you can just copy the path where the JSON file is stored, then assign it to the settings variable
roomfiles.settings.GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE
.
- Alternatively, you can just copy the path where the JSON file is stored, then assign it to the settings variable
After all those steps, you are ready to run the local dev. server! Just make sure to activate your venv then run:
python manage.py runserver
Avatars are made by Freepik from www.flaticon.com. See LICENSES folder.
Rooms' background artworks made by Freepik