Django Social Media App - Social Networking called "People", built to learn the framework
Is a simple, non production ready, Social Media Web Application use for learning and meant to be used as an example.
- Make sure you have Python3.12 installed else please install via --> https://www.python.org/downloads/
- Install MySQL, preferably
MySQL 8
, should work in lower version but I developed using version 8 so can't guarantee it works for older ones.
git clone git@github.com:Koubae/people.git
cd people
# create Python environment
python -m venv env
# Activate (linux)
source env/bin/activate
# Activate (windows)
env/Scripts/activate.bat
# Install
python -m pip install requirements.txt
# (Optional) Install development dependencies
python -m pip install dev_requirements.txt
# Go Inside MySQL
mysql -u<user> -p<password
# create database 'people'
mysql> CREATE DATABASE people;
mysql> USE people;
mysql> SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| people |
+------------+
# exit mysql
mysql> exit
# Cool now, let's create migration to intialize the database
python manage.py makemigrations
python manage.py migrate
# run Django
python manage.py runserver
# Now go to
localhost:8000
Now use can use the demo user to login
- Email:
awesome.guy@demo.com
- Password:
awesome
- Username:
peoplePerson
- First Name:
Guy
- Last Name:
Awesome
- Python3.12
- Django 5
- Django Template intentionally avoiding using any 'big' javascript framework in order to use Django Templating system
- MySQL 8
- Model Structure
- User password for testings:
xPwVOJ-L0vVY3ERaLKgWOg
Here a list of some example I found in github and online
- django-realworld-example-app
- My django project
- E-Commerce Project For Baby Tools
- example.django.mi_aplicacion
- django-blog-example
- simple-django-page
- Simple Django Signals
- django-tutorial-step-by-step
To keep things more organize, rather than have the application in root of the repository, I moved it inside app folder. PyCharm by default starts and expect Django application to be developed at root level, so in order to make it work see the below article
In general simply do
- Go to Settings --> Languages & Frameworks --> Django -->
- Modify
Django Project Root
and make it pointing toapp
Additionally you may want to change Run configuration of PyCharm, set Working Directory
also to app
folder
- Organize django apps inside
- When to create a new app (with startapp) in Django?
- How to execute external script in the Django environment
- How to define default data for Django Models?
- Django - Working with many-to-many intermediary models
- Ordering admin.ModelAdmin objects in Django Admin
- how to have "city" fields depending on "country" field in Django models, without creating their tables
- https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/blob/master/all/all.csv
-
Social web application database design: how can I improve this schema?
-
Going against the grain — Why we chose MySQL for building Social Graph
-
Database 101: How social media “likes” are stored in a database
-
Database Design for Facebook: A Social Network Database Example
-
How to model database tables for implementing Friend relationship? [closed]
-
How to store bidirectional relationships in a RDBMS like MySQL?
-
What is the best way to implement Polymorphic Association in SQL Server?
-
FOAF (FOAF Friend of a Friend)-format. <-- What is it? | ref : https://stackoverflow.com/a/379301/13903942
-
What is Boyce-Codd Normal Form (BCNF) --> https://github.com/j84guo/mysql-social-network/tree/master?tab=readme-ov-file#mysql-schema