Skip to main content

Prerequisites

Before installing Proyecto, ensure you have the following installed on your system:

Python 3.8+

Required for running Django and the application

PostgreSQL

Database system for data persistence

pip

Python package manager for installing dependencies

Git

Version control system for cloning the repository

Verify Prerequisites

Check that you have the correct versions installed:
python --version  # Should be 3.8 or higher
psql --version    # PostgreSQL installation
pip --version     # pip package manager
On some systems, you may need to use python3 and pip3 instead of python and pip.

Installation Steps

1

Clone the Repository

Clone the Proyecto repository to your local machine:
git clone <repository-url>
cd proyecto
2

Create Virtual Environment

Create and activate a Python virtual environment to isolate dependencies:
python -m venv venv
source venv/bin/activate
You should see (venv) prefix in your terminal prompt when the virtual environment is active.
3

Install Dependencies

Install all required Python packages from requirements.txt:
pip install -r requirements.txt
This will install:
  • Django 3.2.18: Web framework
  • psycopg2 2.9.5: PostgreSQL database adapter
  • asgiref 3.4.1: ASGI specification implementation
  • pytz 2022.7.1: Timezone support
  • sqlparse 0.4.3: SQL parsing library
  • typing_extensions 4.1.1: Type hints support
Installation may take a few minutes depending on your internet connection.
4

Create PostgreSQL Database

Create a new PostgreSQL database for Proyecto:
# Login to PostgreSQL
psql -U postgres

# Create database
CREATE DATABASE Proyecto;

# Exit PostgreSQL
\q
The database name must match the NAME field in your Django settings configuration.
5

Configure Database Settings

Update the database configuration in proyecto/settings.py:
proyecto/settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'Proyecto',
        'USER': 'postgres',
        'PASSWORD': 'your_password',
        'HOST': 'localhost',
        'PORT': '5432',
        'ATOMIC_REQUESTS': True,
    }
}
Replace 'your_password' with your PostgreSQL password.
For security, consider using environment variables for sensitive credentials instead of hardcoding them.
6

Update Secret Key (Production)

For production deployments, generate a new secret key:
# In Python shell
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
Update SECRET_KEY in proyecto/settings.py with the generated value.
Never commit your secret key to version control. The default key in the repository should only be used for development.
7

Configure Allowed Hosts

Update ALLOWED_HOSTS in proyecto/settings.py for your environment:
proyecto/settings.py
# Development
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']

# Production - add your domain
ALLOWED_HOSTS = ['yourdomain.com', 'www.yourdomain.com']
8

Run Database Migrations

Apply all database migrations to create the necessary tables:
python manage.py migrate
You should see output confirming the migration of Django’s built-in apps and the CTP application:
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying CTP.0001_initial... OK
  ...
9

Create Superuser Account

Create an admin account to access the Django admin interface:
python manage.py createsuperuser
Follow the prompts to set:
  • Username
  • Email address
  • Password
This account will have full administrative access to the system.
10

Collect Static Files (Production)

For production deployments, collect all static files:
python manage.py collectstatic
This gathers static files from all applications into a single directory for serving.
11

Verify Installation

Run the development server to verify everything is working:
python manage.py runserver
Open your browser and navigate to http://127.0.0.1:8000/
If you see the Proyecto interface, congratulations! Your installation is successful.

Directory Structure

After installation, your project directory should look like this:
proyecto/
├── CTP/                    # Main application
│   ├── migrations/         # Database migrations
│   ├── models.py          # Data models
│   ├── views.py           # View logic
│   ├── forms.py           # Form definitions
│   └── urls.py            # URL routing
├── proyecto/              # Project configuration
│   ├── settings.py        # Django settings
│   ├── urls.py            # Root URL config
│   └── wsgi.py            # WSGI application
├── templates/             # HTML templates
├── static/                # Static files (CSS, JS)
├── media/                 # User uploads
├── manage.py              # Django management script
├── requirements.txt       # Python dependencies
└── db.sqlite3            # Development database (if using SQLite)

Configuration Options

Session Settings

Proyecto includes session timeout configuration in settings.py:
SESSION_COOKIE_AGE = 300  # 5 minutes (in seconds)
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
Adjust SESSION_COOKIE_AGE to set how long users remain logged in.

Static Files

Static files configuration:
STATIC_URL = '/static/'
STATICFILES_DIRS = (BASE_DIR / 'static',)

Media Files

Media files for uploads and generated PDFs:
MEDIA_URL = '/media/'
MEDIA_ROOT = BASE_DIR / 'media'

Troubleshooting

Common Issues

Make sure your virtual environment is activated and Django is installed:
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
On some systems, you may need to install PostgreSQL development headers:
# Ubuntu/Debian
sudo apt-get install postgresql-dev python3-dev

# macOS
brew install postgresql

# Then retry
pip install psycopg2
Verify PostgreSQL is running and credentials are correct:
# Check PostgreSQL status
sudo service postgresql status

# Start PostgreSQL if stopped
sudo service postgresql start
Verify your DATABASES settings in settings.py match your PostgreSQL configuration.
If migrations fail, try:
# Check migration status
python manage.py showmigrations

# Fake initial migration if needed
python manage.py migrate --fake-initial

# Or reset migrations (CAUTION: data loss)
python manage.py migrate CTP zero
python manage.py migrate

Getting Help

If you encounter issues not covered here:
  1. Check the Django documentation
  2. Review the PostgreSQL documentation
  3. Open an issue in the project repository
  4. Check existing issues for similar problems

Next Steps

Quick Start Guide

Learn how to create your first project and tasks

Core Features

Explore project management features

Workflow Guide

Learn the complete workflow

Configuration

Configure settings for your environment

Build docs developers (and LLMs) love