A Django-based web application that helps manage newspapers, topics, and editors. The project includes content creation and management features, as well as Bootstrap integration for a user-friendly interface.
git clone git@github.com:GGsosna/newspaper-agency-service.git
cd newspaper-agency-service
-
For Windows:
python -m venv venv venv\Scripts\activate
-
For macOS/Linux:
python3 -m venv venv source venv/bin/activate
Run the following command to install all required packages:
pip install -r requirements.txt
Create a .env
file in the root directory of the project and add the required environment variables:
SECRET_KEY=your-secret-key
DATABASES_URL = "here is the URL of your database"
You can generate a secret key for Django using Python:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
Copy the generated key and add it to the .env
file:
SECRET_KEY="your-generated-secret-key"
Run the migrations to initialize the database:
python manage.py migrate
Once the database is set up, run the development server:
python manage.py runserver
After starting the server, go to http://127.0.0.1:8000 in your browser. Log in or register to access the application’s features.
To run tests in your Django project, use the following command:
python manage.py test
link: https://newspaper-agency-service.onrender.com
Username: test
Password: test123
Tools for ensuring code quality:
-
mccabe, pycodestyle, pyflakes – used for linting and identifying errors in the code. Run the linter with the following command:
pycodestyle <your-python-files>