This is a Django-based blog application that allows users to create, edit, delete, and like blog posts. Users can also sign up, log in, log out, and update their profiles.
- User Authentication (Sign Up, Log In, Log Out)
- Create, Edit, Delete Blog Posts
- Like/Unlike Blog Posts
- View User Profiles
- Update User Profiles
- Change Password
- Update Email
- Delete Account
-
Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git cd your-repo-name
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
Access the application: Open your web browser and go to
http://127.0.0.1:8000/
.
To deploy this Django application on PythonAnywhere, follow these steps:
-
Create an account on PythonAnywhere: Go to PythonAnywhere and sign up for an account.
-
Create a new web app: After logging in, go to the Dashboard, click on "Web" and then "Add a new web app". Follow the setup instructions and choose Django as your framework.
-
Upload your code: You can upload your project files using PythonAnywhere's built-in Bash console or via GitHub.
-
Set up your virtual environment: In the Bash console, create a virtual environment and install your project's dependencies:
mkvirtualenv myenv --python=/usr/bin/python3.8 workon myenv pip install -r requirements.txt
-
Configure the WSGI file: PythonAnywhere requires you to configure the WSGI file to point to your Django project. Update the WSGI configuration file to include your project settings.
-
Run database migrations:
python manage.py migrate
-
Collect static files:
python manage.py collectstatic
-
Reload your web app: Go back to the "Web" tab and hit "Reload" to apply the changes.
-
Visit your site: You can now access your site using the link provided by PythonAnywhere.
To run the tests for this Django application, execute the following command in your terminal:
python manage.py test
This command will execute all the tests in your project and display the results.
Haseeb Jan