Setup Django Project:

  • update pipenv for python:

    1. [root@localhost Python]# python -m pip install pipenv
    2. [root@localhost Python]# python3 -m pip install pipenv

    (if I input “pipenv” in the terminal, I would see a bunch of commands of pipenv)

  • in the directory, use python 3.6 to create pip virtual environment,

  • and install django 2.2: ```bash [root@localhost Python]# mkdir reactjs/ [root@localhost Python]# cd reactjs/

[root@localhost reactjs]# pipenv install —python 3.6 django==2.1.5

  1. - get into the virtual env:
  2. ```bash
  3. [root@localhost reactjs]# pipenv shell
  • we can use django-admin and a series of subcommands: ```bash (reactjs) [root@localhost reactjs]# django-admin

Type ‘django-admin help ‘ for help on a specific subcommand.

Available subcommands:

[django] check compilemessages createcachetable dbshell diffsettings dumpdata flush inspectdb loaddata makemessages makemigrations migrate runserver sendtestemail shell showmigrations sqlflush sqlmigrate sqlsequencereset squashmigrations startapp startproject test testserver Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.).

  1. we actually need "startproject":
  2. ```bash
  3. (reactjs) [root@localhost reactjs]# django-admin startproject Twittme
  4. (reactjs) [root@localhost reactjs]# tree
  5. .
  6. ├── Pipfile
  7. ├── Pipfile.lock
  8. └── Twittme
  9. ├── manage.py
  10. └── Twittme
  11. ├── __init__.py
  12. ├── settings.py
  13. ├── urls.py
  14. └── wsgi.py
  15. 2 directories, 7 files

so now we have some more files(I just realized my directory name and project name are typos, but that’s not matter)

  • furthermore we need a git repository for this project: ```bash (reactjs) [root@localhost reactjs]# git init Initialized empty Git repository in /root/SourceCode/Python/reactjs/.git/ (reactjs) [root@localhost reactjs]# git status

    On branch master

    #

    Initial commit

    #

    Untracked files:

    (use “git add …” to include in what will be committed)

    #

    Pipfile

    Pipfile.lock

    Twittme/

    nothing added to commit but untracked files present (use “git add” to track)

(reactjs) [root@localhost reactjs]# git add —all

(reactjs) [root@localhost reactjs]# git commit -m “Initial Commit” [master (root-commit) ac802b4] Initial Commit Committer: root root@localhost.localdomain Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly:

  1. git config --global user.name "Your Name"
  2. git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

  1. git commit --amend --reset-author

7 files changed, 234 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock create mode 100644 Twittme/Twittme/init.py create mode 100644 Twittme/Twittme/settings.py create mode 100644 Twittme/Twittme/urls.py create mode 100644 Twittme/Twittme/wsgi.py create mode 100755 Twittme/manage.py

  1. - runserver:
  2. ```bash
  3. (reactjs) [root@localhost Twittme]# ./manage.py runserver

and the default path is localhost:8000
image.png
so the preparation is successful.
(and this step also initialized db.sqlite3)

  • also, install pylint for checking:

    1. (reactjs) [root@localhost Twittme]# pipenv install pylint --dev

    Our Roadmap:

  • create a todo.md to list our plan: ```bash (reactjs) [root@localhost Twittme]# tree . ├── db.sqlite3 ├── manage.py ├── todo.md └── Twittme ├── init.py ├── settings.py ├── urls.py └── wsgi.py

1 directory, 7 files

  1. ```
  2. 1. Tweets
  3. -> Creating
  4. -> Text
  5. -> Image
  6. -> Delete
  7. -> Retweeting
  8. -> Liking
  9. 2. Users
  10. -> Register
  11. -> Login
  12. -> Logout
  13. -> Profile
  14. -> Image?
  15. -> Text?
  16. -> Follow Button
  17. -> Feed
  18. -> User's feed only?
  19. -> User + who they follow?
  20. 3. Following / Followers
  21. Long term todos
  22. - Notifications
  23. - DM
  24. - Explore -> finding hashtags