Loading repository dataβ¦
Loading repository dataβ¦
Hazrat-Ali9 / repository
π Django πͺ Online π Newspaper π is a full π featured π news π¦ publishing π₯ and π° content π management π system built β with Django π It allows π admins π editors and πΈ contributors πΆ to manage β± articles π categories π and users π while providing π readers with π« a smooth π« and π« responsive π newsπΏconsumption π₯£ experience
A modern, feature-rich online newspaper platform built with Django. This application allows users to read news articles, rate them, and provides an editorial system for content management.
Clone the repository
git clone <repository-url>
cd django-online-newspaper-main
Run the setup script
python setup.py
Start the server
python run.py
Clone and navigate to the project
git clone <repository-url>
cd django-online-newspaper-main
Create a virtual environment (recommended)
python -m venv newspaper_env
source newspaper_env/bin/activate # On Windows: newspaper_env\Scripts\activate
Install dependencies
pip install -r requirements.txt
Run database migrations
python manage.py makemigrations
python manage.py migrate
Collect static files
python manage.py collectstatic
Create a superuser account
python manage.py createsuperuser
Start the development server
python manage.py runserver
django-online-newspaper-main/
βββ π accounts/ # User management app
β βββ π migrations/ # Database migrations
β βββ π templates/ # Account-related templates
β βββ models.py # User and Editor models
β βββ views.py # Account views
β βββ forms.py # User forms
β βββ urls.py # Account URLs
βββ π posts/ # News articles app
β βββ π migrations/ # Database migrations
β βββ π templates/ # Post-related templates
β βββ models.py # Post, Category, Rating models
β βββ views.py # Post views
β βββ forms.py # Post forms
β βββ urls.py # Post URLs
βββ π Newspaper_Site/ # Main project settings
β βββ settings.py # Django settings
β βββ urls.py # Main URL configuration
β βββ views.py # Main views
β βββ wsgi.py # WSGI configuration
βββ π templates/ # Global templates
βββ π static/ # Static files (CSS, JS, images)
βββ π media/ # User uploaded files
βββ π staticfiles/ # Collected static files
βββ db.sqlite3 # SQLite database
βββ manage.py # Django management script
βββ requirements.txt # Python dependencies
βββ setup.py # Automated setup script
βββ run.py # Quick run script
βββ README.md # This file
/accounts/register//accounts/login//admin/ with superuser credentialsCreate a .env file based on .env.example:
cp .env.example .env
Edit the .env file with your specific configuration:
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
SQLite (Default)
db.sqlite3PostgreSQL (Production)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'newspaper_db',
'USER': 'your_username',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}
static/css/style.csstemplates/base.htmlaccounts/templates/posts/templates/python manage.py runserver
DEBUG = Falsegit checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is open source and available under the MIT License.
Migration Errors
python manage.py makemigrations --empty accounts
python manage.py makemigrations --empty posts
python manage.py migrate
Static Files Not Loading
python manage.py collectstatic --clear
Permission Errors
chmod +x setup.py run.py
For support and questions:
Happy Coding! π
Built with β€οΈ using Django and Bootstrap