Giter Club home page Giter Club logo

firstdjangoproject's Introduction

To get this project running after downloading it follow these steps:

if you get stuck during installation this site has great instructions:
    https://djangobook.com/installing-django/

==========INITIAL SETUP============
1: Install python version 3.6.5: https://www.python.org/downloads/

if you just want to copy paste from this point type the following:
    ---word of warning, you will need to press enter several times, without prompting
       if it appears nothing is happeneing just press enter for the first thing you
       copy paste

    1. python -m venv venv; source venv/Scripts/activate; pip install -r requirements.txt
    
    ---be careful when choosing the credintials for the admin, it will be used for your access
       to the admin section of the website

    2. rm db.sqlite3; find user/migrations/ -type f -not -name '__init__.py' -print0 | xargs -0 rm --; python manage.py makemigrations user; python manage.py migrate; python manage.py createsuperuser; python manage.py runserver


2: Install a python virtual environment in the root of the project, then also add the projects requirements: https://docs.python.org/3.6/library/venv.html#module-venv
    i.   python -m venv venv
    ii.  source venv/Scripts/activate (start your virtual enviromnet. Do this anytime you want to run this project)
    iii. pip install -r requirements.txt (press enter whenever the download gets to 100%)

4: From the root of the project (in the firstDjangoWebsite folder)
    (short-cut to step 4) in console paste:
         rm db.sqlite3; find user/migrations/ -type f -not -name '__init__.py' -print0 | xargs -0 rm --; python manage.py makemigrations user; python manage.py migrate; python manage.py createsuperuser; python manage.py runserver
    i.    delete db.sqlite3
    ii.   delete everything in the folder firstDjangoWebsite/user/migrations except for __init__.py
    iii.  int the console from the root directory type in the following
            a. python manage.py makemigrations user
            b. python manage.py migrate
            c. python manage.py createsuperuser
                i. for this fill in what ever you want. It will give you access to the admin side of the site
                   reachable now by typing localhost:8000/admin note that the 8000 after localhost may change
                   depending on how you set everything up, but when you run the project the number will be shown
                   in the console.
            d. python manage.py runserver
                i. in the console you will see: "Starting development server at http://127.0.0.1:XXXX/"
                   the url shown will go in the address bar of your chosen web browser to access your website.
                   The ip address can be replaced with localhost. eg. localhost:XXXX.
    iiii. Type in the localhost:(your_port_numbr) to access the site in your browser of choice

=======EVERYTIME YOU DO WORK=======
1. cd to root folder of the project
2. git pull; source venv/Scripts/activate; pip install -r requirements.txt
3. do any work that you need to do
    i. if you change the database
        a. python manage.py makemigrations (name_of_changed_app)
        b. python manage.py migrate
4. test it: python manage.py runserver
5. if you are done working: 
    i.    pip freeze > requirements.txt
    ii.   deactivate
    iii.  git commit -am "changes"
    iiii. git push

=========TODO=========
Things that we need to do, feel free to add to this:
    -Photo uploading, in the social media sense
        -privacy managment of each photo
        -a browse view that will show all photos you have the ability to see
    -Implementation of sessions
    -user privacy settings
    -ability to have a friend
        -use relational mapping
            -this will be difficult given the way django handles forms.
            
            
=====TROUBLE SHOOTING=====
if you have any database errors text the shortcut from above to solve them, here it is again if you missed it:
    rm db.sqlite3; find user/migrations/ -type f -not -name '__init__.py' -print0 | xargs -0 rm --; python manage.py makemigrations user; python manage.py migrate; python manage.py createsuperuser; python manage.py runserver

firstdjangoproject's People

Contributors

kepatotorica avatar devankarsann avatar

Watchers

James Cloos avatar Pradeep Murukannaiah avatar

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.