A simple blog application built with the Django web framework. It allows users to create, publish, and view blog posts.
- User authentication (via Django's built-in auth) for authors.
- Post creation, editing, and deletion (likely managed via the Django admin interface).
- Publication workflow (posts have a
published_dateand apublishmethod). - Display of a list of posts.
- Display of individual post details.
- Django ~= 5.1.2
Follow these steps to get the project running locally:
-
Clone the repository: Replace
<repository-url>with the actual URL of the repository and<repository-directory>with the name of the project directory.git clone <repository-url> cd <repository-directory>
-
Create and activate a virtual environment:
python -m venv myvenv source myvenv/bin/activate # On Windows use `myvenv\Scripts\activate`
-
Install dependencies: Make sure you have a
requirements.txtfile in your project root.pip install -r requirements.txt
-
Run database migrations: This will apply the database schema changes.
python manage.py migrate
-
Create a superuser (for admin access): You will be prompted to create a username, email, and password.
python manage.py createsuperuser
-
Run the development server: The application will typically be available at
http://127.0.0.1:8000/.python manage.py runserver
Here's how to interact with the running application:
-
Accessing the Blog:
- Once the development server is running (after
python manage.py runserver), the main blog page, which lists published posts, can typically be accessed athttp://127.0.0.1:8000/.
- Once the development server is running (after
-
Admin Panel:
- The Django admin interface is available at
http://127.0.0.1:8000/admin/. - Log in using the superuser credentials you created during the setup process (
python manage.py createsuperuser).
- The Django admin interface is available at
-
Managing Posts:
- Creation, Editing, Deletion: Through the admin panel, you can create new blog posts, modify existing ones, and remove posts. Look for the "Posts" section (or a similar name) after logging into the admin interface.
- Publishing: Posts typically have a title and text content. To make a post visible on the main blog, it needs to be published. This usually involves setting a
published_datefor the post. The exact mechanism for publishing (e.g., a specific "publish" action in the admin or simply setting the date and saving) might vary based on the project's specific admin configuration. Once published, the post will appear on the main blog page.
This section details important configuration settings found in mysite/settings.py.
-
Internationalization:
- The project is configured for Spanish:
LANGUAGE_CODE = 'es-es'. - The timezone is set to:
TIME_ZONE = 'America/Mazatlan'.
- The project is configured for Spanish:
-
Development Settings:
- DEBUG Mode:
DEBUG = Trueis currently active. This is suitable for development but must be set toFalsein a production environment for security reasons. - Allowed Hosts:
ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']. This list defines which host/domain names the Django site can serve. You may need to add your specific domain or IP address here when deploying to a new environment.
- DEBUG Mode: