GithubHelp home page GithubHelp logo

holohup / yatube_subscriptions_en Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.51 MB

Simple social network with images, subscriptions and good test coverage

License: MIT License

Shell 0.12% Python 66.03% HTML 33.85%
blog-platform django django-orm django-orm-crud django-testing jinja-templates social-network test-coverage testcase custom-server-errors

yatube_subscriptions_en's Introduction

YaTube Social Network / Blog Platform educational project

Welcome to my Python 3.7 / Django 2.2.19 educational project. It's a social network with all the required functionality, including subscriptions. It's got 30 custom tests to check everything is working as planned.

This product features:

  • SQL request optimization using Django ORM's select_related directive
  • Subscriptions to other user's posts
  • 30 custom tests using Django TestCase: forms, models, URLs and views, and site functionality
  • Custom server errors templates
  • Pagination and caching

Installation, testing, and launching

git clone https://github.com/holohup/yatube_subscriptions_en.git && cd yatube_subscriptions_en && ./install_yatube.sh

Virtual environment activation

To proceed, we need to activate our virtual environment once again if it is not active:

source venv/bin/activate && cd yatube

Pre-launch tests

The tests are located in the yatube/posts/tests folder. They're implemented using the Django TestCase library. To run the tests, make sure you're in your virtual environment and enter a command:

python manage.py test

And away we go!

python manage.py runserver

The website will be accessible by the address http://127.0.0.1:8000/. The Django web server can be stopped by pressing Ctrl+C.

If you want to check out the admin panel, be sure to create a superuser before starting the server:

python manage.py createsuperuser

Then launch the server and enter your credentials at http://127.0.0.1:8000/admin/

Fixtures

For testing purposes and your convenience, a set of prepopulated data is available to be uploaded to the database. It also comes with an admin account tester/tester. To load the data, make sure you're in the project virtual environment in the yatube folder and execute the following command:

python manage.py loaddata ../fixtures/fixtures.json && mkdir media && mkdir media/posts/ && cp ../fixtures/*.jpg media/posts/

Final notes

  • This version is supplied with Django Debug Toolbar installed to check the database queries efficiency. It is turned off by setting DEBUG = False in the settings.py file.
  • The project doesn't include an e-mail server. All the e-mails (needed for registration, password restoration/reset, etc) are saved as files in yatube/sent_emails folder.

yatube_subscriptions_en's People

Contributors

holohup avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.