Skip to content

A django CRUD website that provides python tutorials for beginners in various learning paths

License

Notifications You must be signed in to change notification settings

aayushsiwa/python-tutorials

Repository files navigation

Project Title

Python Tutorials

Description

This is a Django web application that allows users to browse python tutorials categorized into various series. Users can register, log in, and manage their accounts. The project is connected to a PostgreSQL database hosted on Render.

Features

  • User authentication (registration, login, logout)
  • Browse tutorials by categories and series
  • Detailed tutorial pages
  • User account management
  • Error handling pages

Technologies Used

  • Python 3.7+
  • Django
  • PostgreSQL
  • Render for hosting
  • HTML, CSS for front-end

Prerequisites

  • Python 3.7+
  • PostgreSQL
  • Pip (Python package installer)

Installation

  1. Clone the repository:

    git clone https://github.com/senaditya/python-tutorials.git
    cd yourproject
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the dependencies:

    pip install -r requirements.txt
  4. Set up the database: Ensure you have PostgreSQL installed and create a new database. Update your DATABASE_URL environment variable with your database details in the format:

    postgres://USER:PASSWORD@HOST:PORT/DBNAME
    
  5. Run database migrations:

    python manage.py migrate
  6. Create a superuser:

    python manage.py createsuperuser
  7. Collect static files:

    python manage.py collectstatic

Running the Application

  1. Start the development server:

    python manage.py runserver
  2. Open your browser and go to http://127.0.0.1:8000 to see the application running.

Deployment

To deploy this project to Render.com:

  1. Create a new web service on Render.com and connect your GitHub repository.

  2. Add environment variables in the Render.com dashboard:

    • DATABASE_URL: Your PostgreSQL database URL
    • Any other necessary environment variables
  3. Specify the build and start commands in the Render.com settings:

    • Build Command: pip install -r requirements.txt && python manage.py collectstatic --noinput && python manage.py migrate
    • Start Command: gunicorn yourproject.wsgi:application
  4. Deploy the service and Render.com will automatically build and start your application.

Usage

  • Visit the homepage to see a list of tutorial categories.
  • Click on a category to see the series within it.
  • Click on a series to view the tutorials in that series.
  • Register or log in to manage your account.
  • Log out when you are done.

Contributing

  1. Fork the repository.
  2. Create a new branch.
    git checkout -b feature/your-feature
  3. Make your changes.
  4. Commit your changes.
    git commit -m "Add your feature"
  5. Push to the branch.
    git push origin feature/your-feature
  6. Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contact

For any questions or feedback, please reach out to me or create an issue on GitHub.


Feel free to customize the above template according to your project's specific details and requirements.