A Django project developed for learning purposes.
These instructions will help you set up the project on your local machine.
-
Clone the repository:
git clone https://github.com/MahdiHaeri/Django_Twitter_Server.git
-
Navigate to the project directory:
cd Django_Twitter_Server
-
(Optional) Set up and activate virtual environment:
python -m venv .venv source .venv/bin/activate # for Linux/Mac .venv\Scripts\activate # for Windows
-
Install dependencies using pip:
pip install -r requirements.txt
-
Create and apply migrations:
python manage.py makemigrations python manage.py migrate
-
Create an admin user:
python manage.py createsuperuser
python manage.py runserver
Open your web browser and visit “/admin/” on your local domain (e.g., http://127.0.0.1:8000/admin/) to access the admin interface.
- Admin:
/admin/
- Users:
- List all users:
/api/v1/users/
- Retrieve a user:
/api/v1/users/<int:user_id>/
- List all users:
- Follows:
- List all follows:
/api/v1/follows/
- Retrieve a follow:
/api/v1/follows/<int:follow_id>/
- List all follows:
- Blocks:
- List all blocks:
/api/v1/blocks/
- Retrieve a block:
/api/v1/blocks/<int:block_id>/
- List all blocks:
- Tweets:
- List all tweets:
/api/v1/tweets/
- Retrieve a tweet:
/api/v1/tweets/<int:tweet_id>/
- List all tweets:
- Retweets:
- List all retweets:
/api/v1/retweets/
- Retrieve a retweet:
/api/v1/retweets/<int:tweet_id>/
- List all retweets:
- Reply Tweets:
- List all reply tweets:
/api/v1/reply_tweets/
- Retrieve a reply tweet:
/api/v1/reply_tweets/<int:tweet_id>/
- List all reply tweets:
- Quote Tweets:
- List all quote tweets:
/api/v1/quote_tweets/
- Retrieve a quote tweet:
/api/v1/quote_tweets/<int:tweet_id>/
- List all quote tweets:
- Likes:
- List all likes:
/api/v1/likes/
- Retrieve likes for a tweet:
/api/v1/likes/<int:tweet_id>/
- List all likes:
- Profiles:
- List all profiles:
/api/v1/profiles/
- List all profiles:
- JWT Token:
- Obtain token:
/api/v1/token/
(POST) - Refresh token:
/api/v1/token/refresh/
(POST) - Verify token:
/api/v1/token/verify/
(POST)
- Obtain token: