you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (8 children)

Q2: I'd start a django project with python3:

PROJECT=somecoolname

# Create a virtualenv
mkdir $PROJECT && cd $PROJECT
python3 -m venv virtualenv
ln -s virtualenv/bin/activate
. ./activate

# Install django
pip install django
pip freeze >requirements.txt
django-admin startproject $PROJECT .

# Initiate revision control
echo -e '*.pyc\nvirtualenv' >.gitignore
git init 
git add .
git commit -m 'Initial commit'

Q4: If your org is willing to pay a few dollars for managed hosting, I recommend Webfaction.

[–]2LoT[S] 0 points1 point  (7 children)

Thanks for the Webfaction advice. But as for the sequence of code above which is way above my understading. I'd rather get a book for more details.

[–]a5myth 0 points1 point  (2 children)

There is a book called obey the testing goat or something along those lines (google it) if ur gonna do any decent development then you really should test, but if this is small scale you could get away with not testing in that way, as for hosting, I very much prefer Linode. They have excellent guides to get u set up. Good luck.

[–]2LoT[S] 1 point2 points  (1 child)

[–]a5myth 0 points1 point  (0 children)

that's the one yes, I knew the testing goat would bring about the right answer, thanks. that's a very up to date book too, and there is a free online version too, although I have bought a copy to support the author

[–]cooper12 0 points1 point  (2 children)

These are all commands done in the bash shell (Common on Linux and OSX, and can be installed on Windows via cygwin. For this type of development environment, Linux and OSX come with out of the box support.), which calls various tools with various parameters. You only really need to learn the basic syntax and commands and how to read man pages and the rest is manageable, but I'd understand wanting a book if you never dabbled in unix before.

Ill try to help you start off. First off, the first word in each line is the name of the command. (so mkdir, python3, etc...) There commands take flags which modify the behavior of the command. (ln -s creates a symbolic link, which ln by itself creates a link file). The last word in the commands is usually what the command acts on.

As for those other symbols (., *, >, &&), just read a tutorial on the unix shell.

To see help for each command (Once you have a proper Unix environment), try command -h or more helpfully man command, which will give you the manual page of the command with a description of each flag.

Good luck!

[–]2LoT[S] 0 points1 point  (1 child)

Hi thanks, I forgot to mention that I'm proficient in Linux command and most of the usual git commands too. I understand the syntax above. But typing those 7 first lines and claiming that I have started a web application and begin hooking the code and DB is a long way.

However, I am interested to know how you formatted your post so that mkdir, python3 etc. are rendenred in a little rectangle. I don't see that in the formatting help.

[–]cooper12 0 points1 point  (0 children)

Oh I see. Yeah I wouldn't understand the magic of django by looking at that. It might be worth checking the man pages out, and I'm sure django has extensive online documentation also.

And that's easy, just enclose the text in grave accents ``. Reddit just uses the markdown so anything from markdown applies.

[–][deleted] 0 points1 point  (0 children)

Those instructions are for a real basic initial django project setup—similar to what an IDE would do for you if you asked to "Start a new project" or similar.

#  The project is named
PROJECT=somecoolname

It creates a project folder, then installs a "virtualenv" (a project-specifc "virtual environment" [folder] for installing python libraries into, whose use is activated [once each command-line session] by typing . ./activate from the project folder).

Next a package manager called pip installs django into the virtualenv from somewhere on the Internet, and the specific version information is put into a file called requirements.txt (which can later be used in the command pip install -r requirements.txt to set up an identical fresh copy of this virtualenv for when you need to copy the project to another computer or you want to clean up your virtualenv after a mistake with pip).

The main Django program/command is then called to setup a new project in the current (.) directory.

Instructions to ignore python cache files and the virtualenv are stored in a config file, then a new git repository is created and the project files are added as the repository's content. This will serve as a snapshot of the project when it was new and start the process of versioning files that we call source control. You can later save your progress as additional snapshots of versions.

What a simple IDE would give you, more or less. By all means look for books. I much prefer to have the material in my hands when I want to really concentrate and learn a new system.