This repository contains the code for an image bookmarking application like a social website. That used Django Social Auth to add social authentication to your site using Facebook, Google, and Twitter. That runs in a development server with HTTPS on your local machine using Django Extensions. Customized the social authentication pipeline to create a user profile for new users automatically.
- Clone the repository:
git clone [email protected]:JoseJulianMosqueraFuli/bookmarks.git
- Navigate into the repository:
cd bookmarks
- Create the
.env
file for authentication, similar to the.env.example
file:
FACEBOOK_APP_ID = <App Identifier>
FACEBOOK_APP_SECRET = <App Secret Key>
TWITTER_API_KEY = <App Identifier>
TWITTER_API_SECRET = <App Secret Key>
GOOGLE_CLIENT_ID = <App Identifier>
GOOGLE_CLIENT_SECRET = <App Secret Key>
- Run the docker command:
docker-compose up --build
- Clone the repository:
git clone [email protected]:JoseJulianMosqueraFuli/bookmarks.git
- Create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Navigate into the cloned directory:
cd bookmarks
- Create the
.env
file for authentication, similar to the.env.example
file:
FACEBOOK_APP_ID = <App Identifier>
FACEBOOK_APP_SECRET = <App Secret Key>
TWITTER_API_KEY = <App Identifier>
TWITTER_API_SECRET = <App Secret Key>
GOOGLE_CLIENT_ID = <App Identifier>
GOOGLE_CLIENT_SECRET = <App Secret Key>
- Start docker and run:
docker pull redis
docker run -it --rm --name redis -p 6379:6379 redis
- Apply the database migrations:
python manage.py migrate
- Start the development server:
python manage.py runserver
-
Optional: If you want to run the development server with HTTPS, use:
NOTE: Remember that you have to configure your hosts for https configuration.
python manage.py runserver_plus --cert-file cert.pem
Now, you can access the application in your browser at http://127.0.0.1:8000/. Enjoy using the bookmarking application!
- User registration: Users can create an account by providing their username, email, and password.
- User login: Registered users can log in to their accounts using their credentials.
- User logout: Users can securely log out of their accounts.
- Password management: Users can change their passwords and reset them if they forget.
- Custom user profiles: A model is implemented to store additional information about each user, such as their date of birth and profile photo.
- Custom authentication backend: An authentication backend is added to allow users to log in using their email address instead of their username.
- Creating many-to-many relationships
- Customizing behavior for forms
- Using JavaScript with Django
- Building a JavaScript bookmarklet
- Generating image thumbnails using easy-thumbnails
- Implementing asynchronous HTTP requests with JavaScript and Django
- Building infinite scroll pagination
- Building a follow system
- Creating an activity stream application
- Adding generic relations to models
- Optimizing QuerySets for related objects
- Using signals for denormalizing counts
- Using Django Debug Toolbar to obtain relevant debug information
- Counting image views with Redis
- Creating a ranking of the most viewed images with Redis
These improvements could cover the following points:
- Create Test
- Always could improve
This project is licensed under the MIT License.
Build it by Jose Julian Mosquera Fuli.