Home > Mobile >  Running a django project with documentation based in linux on windows
Running a django project with documentation based in linux on windows

Time:06-09

I want to run this project enter image description here

CodePudding user response:

I'm on Windows 10. If you're not opposed to using Windows Command Prompt, here are the steps to running this project. I don't use Powershell but if you must, see Powershell note at bottom of my answer.

  1. Go here: https://github.com/sajib1066/django-event-management
  2. Grab this clone link: https://github.com/sajib1066/django-event-management.git
  3. Open Windows CMD prompt.
  4. Change directory to a place on your computer. Ex: cd "C:\Users\<your_user>\Downloads"
  5. Make new directory: mkdir SO72525733 && cd SO72525733
  6. git clone https://github.com/sajib1066/django-event-management.git
 Output:
 C:\Users\Jarad\Downloads\SO72525733>git clone https://github.com/sajib1066/django-event-management.git
 Cloning into 'django-event-management'...
 remote: Enumerating objects: 2838, done.
 remote: Counting objects: 100% (32/32), done.
 remote: Compressing objects: 100% (30/30), done.
 remote: Total 2838 (delta 5), reused 15 (delta 0), pack-reused 2806
 Receiving objects: 100% (2838/2838), 18.75 MiB | 6.82 MiB/s, done.
 Resolving deltas: 100% (1141/1141), done.
  1. cd django-event-management
  2. virtualenv venv
 Output:
 C:\Users\Jarad\Downloads\SO72525733\django-event-management>virtualenv venv
 created virtual environment CPython3.7.3.final.0-64 in 10271ms
   creator CPython3Windows(dest=C:\Users\Jarad\Downloads\SO72525733\django-event-management\venv, clear=False, no_vcs_ignore=False, global=False)
   seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\Jarad\AppData\Local\pypa\virtualenv)
     added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1
   activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
  1. venv\Scripts\activate
  2. You should see your terminal add (venv) to the path. That's how you know your virtual environment is activated in the terminal. Ex: (venv) C:\Users\Jarad\Downloads\SO72525733\django-event-management>
  3. pip install -r requirements.txt
  4. python manage.py migrate (or just manage.py migrate works too if you're in the root directory)
  5. python manage.py createsuperuser
  6. python manage.py runserver

If you must use Powershell, activating the virtual environment is no different.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> cd C:\Users\Jarad\Downloads\SO72525733\django-event-management
PS C:\Users\Jarad\Downloads\SO72525733\django-event-management> ls


    Directory: C:\Users\Jarad\Downloads\SO72525733\django-event-management


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          6/7/2022  10:09 AM                .idea
d-----          6/7/2022  10:15 AM                events
d-----          6/7/2022  10:15 AM                event_management
d-----          6/7/2022  10:09 AM                static
d-----          6/7/2022  10:09 AM                templates
d-----          6/7/2022  10:10 AM                venv
-a----          6/7/2022  10:09 AM           1972 .gitignore
-a----          6/7/2022  10:16 AM         294912 db.sqlite3
-a----          6/7/2022  10:09 AM            657 manage.py
-a----          6/7/2022  10:09 AM            692 README.md
-a----          6/7/2022  10:09 AM            336 requirements.txt


PS C:\Users\Jarad\Downloads\SO72525733\django-event-management> venv\Scripts\activate
(venv) PS C:\Users\Jarad\Downloads\SO72525733\django-event-management>
  • Related