Giter Club home page Giter Club logo

django3_blog_application's Introduction

Django3_blog_application

This is a basic blog app.

Navigate to the project root directory and create an isolated environment with the following command: python3 -m venv my_env

This will create a my_env/ directory, including your Python environment. Any Python libraries you install while your virtual environment is active will go into the my_env/lib/python3.8/site-packages directory.

Run the following command to activate your virtual environment: source my_env/bin/activate

Run the following command at the shell prompt to install the dependencies with pip: pip install -r requirements.txt

If you are using Linux, install PostgreSQL with the following command: sudo apt-get install postgresql postgresql-contrib

If you are using macOS or Windows, download PostgreSQL from https://www.postgresql.org/download/ and install it.

You also need to install the psycopg2 PostgreSQL adapter for Python. Run the following command in the shell to install it: pip install psycopg2-binary==2.8.4

Create a user for your PostgreSQL database. Open the shell and run the following commands:

su postgres
createuser -dP blog

You will be prompted for a password for the new user. Enter the desired password and then create the blog database and give ownership to the blog user you just created with the following command: createdb -E utf8 -U blog blog

Then, edit the settings.py file of your project and modify the DATABASES setting to make it look as follows:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'blog',
        'USER': 'blog',
        'PASSWORD': '*****',
    }
}

Replace the preceding data with the database name and credentials for the user you created. The new database is empty. Run the following command to apply all database migrations: python manage.py migrate

Finally, create a superuser with the following command: python manage.py createsuperuser

You can now run the development server and access the administration site at http://127.0.0.1:8000/admin/ with the new superuser. python manage.py runserver

You should see something like this:

Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
January 01, 2020 - 10:00:00
Django version 3.0, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Now open http://127.0.0.1:8000/blog in your browser. You should see a blog app.

Screenshot 2020-05-16 at 8 53 41 PM Screenshot 2020-05-16 at 8 53 56 PM Screenshot 2020-05-16 at 8 54 04 PM Screenshot 2020-05-16 at 8 54 13 PM Screenshot 2020-05-16 at 8 54 34 PM Screenshot 2020-05-16 at 8 54 46 PM Screenshot 2020-05-16 at 8 54 54 PM

django3_blog_application's People

Contributors

dependabot[bot] avatar dpthegrey avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

django3_blog_application's Issues

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.