Hi all,
I have to work on a small Python project using Django. Given what I have seen, it shouldn't be too difficult. But I haven't really used either product and have a few, relatively easy questions.
Currently, I am using Microsoft Code (although I could use Visual Studio, PyCharm, or some other IDE) on a windows platform.
I can write a simply python app and have it run without issue. But trying to get Python running inside a virtual environment and getting Django configured correctly is giving me a head ache. I know what I need to do, just not where to set the values I need to set.
Anyway, if anyone out there is available for Skype chat, Google hangout, or even an old fashioned phone call, I would really appreciate it.
Thanks,
Fletcher
Fletcher Johnson
mailto:FletcherSJohnson@Yahoo.com FletcherSJohnson@Yahoo.com
http://linkedin.com/in/FletcherJohnson LinkedIn.com/in/FletcherJohnson
twitter.com/fletcherJ
https://www.strava.com/athletes/fletcherjohnson strava.com/athletes/fletcherjohnson
408-946-0960 - work
408-781-2345 - cell
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
FWIW I'd probably (based on my limited experience playing around with Python and Django) use PyCharm over VS Code for it.
Also I found the DjangoGirls tutorials good if slightly outdated at the time.
What you'll find also is that the vast bulk of Django and a lot of Python learning material assumes you are Mac or Linux based.
Alan,
I agree about the Mac/Linux thing.... As I have a Pycharm license, I will try that (and DjangoGirls) out.
Appreciate the tips,
Fletcher
Fletcher Johnson FletcherSJohnson@Yahoo.com LinkedIn.com/in/FletcherJohnson twitter.com/fletcherJ strava.com/athletes/fletcherjohnson 408-946-0960 - work 408-781-2345 - cell
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Alan Bourke Sent: Thursday, January 24, 2019 3:48 AM To: profoxtech@leafe.com Subject: Re: [NF] Looking for a little Python/Django help
What you'll find also is that the vast bulk of Django and a lot of Python learning material assumes you are Mac or Linux based.
On Jan 23, 2019, at 8:29 PM, Fletcher Johnson FletcherSJohnson@yahoo.com wrote:
I can write a simply python app and have it run without issue. But trying to get Python running inside a virtual environment and getting Django configured correctly is giving me a head ache. I know what I need to do, just not where to set the values I need to set.
I haven’t played much with Django, so I wouldn’t be of any help with Django-specific settings/questions. But feel free to ping me with questions, either to my personal email, or the near-moribund ProPython email list
-- Ed Leafe
Ed,
Actually, the Djangogirls link that Alan provided is amazingly good. While it is geared to beginners (this is what a variable is, etc.) it doesn't waste time on details and you can actually get a working model up rather quickly. I wish I could find more tutorials like that. Most would have used 3-4 days to get to what they do in an hour or so.....
My most interesting python question is related to the "file... import ..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments. Then the other part of the environments question is how to know if the code (or whatever) is coming from the main system or from the environment. I know I will get this figured out soon, but getting Django working first is a much higher priority as I need to write a backend demo system using it....
Thanks,
Fletcher
Fletcher Johnson FletcherSJohnson@Yahoo.com LinkedIn.com/in/FletcherJohnson twitter.com/fletcherJ strava.com/athletes/fletcherjohnson 408-946-0960 - work 408-781-2345 - cell
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Ed Leafe Sent: Thursday, January 24, 2019 8:53 AM To: ProFox Mailing List Subject: Re: [NF] Looking for a little Python/Django help
On Jan 23, 2019, at 8:29 PM, Fletcher Johnson FletcherSJohnson@yahoo.com wrote:
I can write a simply python app and have it run without issue. But trying to get Python running inside a virtual environment and getting Django configured correctly is giving me a head ache. I know what I need to do, just not where to set the values I need to set.
I haven’t played much with Django, so I wouldn’t be of any help with Django-specific settings/questions. But feel free to ping me with questions, either to my personal email, or the near-moribund ProPython email list
-- Ed Leafe
[excessive quoting removed by server]
On Jan 24, 2019, at 5:07 PM, Fletcher Johnson FletcherSJohnson@yahoo.com wrote:
My most interesting python question is related to the "file... import ..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments.
You can't specify operating system paths in the import command; those modules need to be in known locations where Python can find them. When you install something (usually with `pip install`), it is placed in the 'site-packages' directory of your environment. I started to write a big long explanation here, but decided that it would be better as a blog post:
https://blog.leafe.com/using-a-python-virtual-environment/
Of course, if you have any questions about that, let me know.
-- Ed Leafe
As I said previously I have to do things as my lecturers want until June 8th so Advanced Databases, creating a model for international crowdfunding..
I have the following three tables:
Project ----------- projectID <<Primary Key>> title catagory <<Foreign Key>>
customer -------------- personID <<Primary Key>> forename country <<Foreign Key>>
restrictions --------------- country <<composite Primary Key>> category <<Composite Primary Key>> ageRestricted genderRestricted
My lecturer is saying that the composite primary key must be accessible without needing reference to two tables..
In ERD/UML is there anything wrong with having a look up table referenced from two other tables?
Thanks for any pointers google has let me down as has the databases groups on facebook...
Adam.
Adam:
Not a UML expert, but it seems like the restrictions tables has a "Many-To-Many" relationship with Country and Category. By having no unique PK of it's own, it's implied that there is only one record for each combination of country and category. So you can define add, edit, update, delete instructions "WHERE Country=XXX and Category = YYY" which will work all the time. That's proper relational integrity and 4th normal form.
The problem happens if you start adding attributes (fields) to the record where a combination of country/category could have more than one record, say, and agerestriction for gender male but no age restriction for gender female where you now have two records with identical primary keys. Which means they're no longer primary keys, since they do not uniquely identify records. So, you'd have to add another field or two to the composite key, or finally break down and add a unique PK field.
To avoid this kind of refactoring later in the process, my rule has always been that every table has a unique, non-data-bearing PK which uniquely identifies the record from birth to death. You will never have to deal with all the RI code involved in changing primary keys because the data values (category or country codes) change, and avoid intricate and bothersome code.
jomo.
On Sat, Jan 26, 2019 at 2:55 AM Adam Buckland dev@thebucklands.co.uk wrote:
As I said previously I have to do things as my lecturers want until June 8th so Advanced Databases, creating a model for international crowdfunding..
I have the following three tables:
Project
projectID <<Primary Key>> title catagory <<Foreign Key>>
customer
personID <<Primary Key>> forename country <<Foreign Key>>
restrictions
country <<composite Primary Key>> category <<Composite Primary Key>> ageRestricted genderRestricted
My lecturer is saying that the composite primary key must be accessible without needing reference to two tables..
In ERD/UML is there anything wrong with having a look up table referenced from two other tables?
Thanks for any pointers google has let me down as has the databases groups on facebook...
Adam.
[excessive quoting removed by server]
On 2019-01-26 12:22, Ted Roche wrote:
Adam:
Not a UML expert, but it seems like the restrictions tables has a "Many-To-Many" relationship with Country and Category. By having no unique PK of it's own, it's implied that there is only one record for each combination of country and category. So you can define add, edit, update, delete instructions "WHERE Country=XXX and Category = YYY" which will work all the time. That's proper relational integrity and 4th normal form.
The problem happens if you start adding attributes (fields) to the record where a combination of country/category could have more than one record, say, and agerestriction for gender male but no age restriction for gender female where you now have two records with identical primary keys. Which means they're no longer primary keys, since they do not uniquely identify records. So, you'd have to add another field or two to the composite key, or finally break down and add a unique PK field.
To avoid this kind of refactoring later in the process, my rule has always been that every table has a unique, non-data-bearing PK which uniquely identifies the record from birth to death. You will never have to deal with all the RI code involved in changing primary keys because the data values (category or country codes) change, and avoid intricate and bothersome code.
jomo.
Excellent logic, Ted. Purists be damned! lol
I'm actually going to read your Blog post - since, if you can believe it - I'm actually starting to teach a class to kids, in an after school type program. One class is 3D Design/3D Printing - but, the other class is Python based. Am also going to look around at some older threads here talking about Python - so I can truly get a quick jump start in Python. Of course, needless to say - I need only stay 1 or 2 steps ahead of the kids!
And - if ANYONE has a suggestion for something Cool I could teach the kids in Python - feel free to give me a shout out!
Fletcher - sorry to Hi-Jack your thread. At least its not a total hi-jacking and steering it into a wrong direction...
I give you back the steering wheel now!
-K-
On 1/24/2019 4:55 PM, Ed Leafe wrote:
On Jan 24, 2019, at 5:07 PM, Fletcher Johnson FletcherSJohnson@yahoo.com wrote:
My most interesting python question is related to the "file... import ..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments.
You can't specify operating system paths in the import command; those modules need to be in known locations where Python can find them. When you install something (usually with `pip install`), it is placed in the 'site-packages' directory of your environment. I started to write a big long explanation here, but decided that it would be better as a blog post:
https://blog.leafe.com/using-a-python-virtual-environment/
Of course, if you have any questions about that, let me know.
-- Ed Leafe
[excessive quoting removed by server]
Hi On the french Foxpro groups site Mike poster a procedure to find the distance between two Google adresses. If you cant find I might be able to upload a zip Koen
Op ma 28 jan. 2019 om 17:49 schreef Kurt @ Gmail kurthwendt@gmail.com
I'm actually going to read your Blog post - since, if you can believe it
- I'm actually starting to teach a class to kids, in an after school
type program. One class is 3D Design/3D Printing - but, the other class is Python based. Am also going to look around at some older threads here talking about Python - so I can truly get a quick jump start in Python. Of course, needless to say - I need only stay 1 or 2 steps ahead of the kids!
And - if ANYONE has a suggestion for something Cool I could teach the kids in Python - feel free to give me a shout out!
Fletcher - sorry to Hi-Jack your thread. At least its not a total hi-jacking and steering it into a wrong direction...
I give you back the steering wheel now!
-K-
On 1/24/2019 4:55 PM, Ed Leafe wrote:
On Jan 24, 2019, at 5:07 PM, Fletcher Johnson <
FletcherSJohnson@yahoo.com> wrote:
My most interesting python question is related to the "file... import
..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments.
You can't specify operating system paths in the import command; those
modules need to be in known locations where Python can find them. When you install something (usually with `pip install`), it is placed in the 'site-packages' directory of your environment. I started to write a big long explanation here, but decided that it would be better as a blog post:
https://blog.leafe.com/using-a-python-virtual-environment/
Of course, if you have any questions about that, let me know.
-- Ed Leafe
[excessive quoting removed by server]
Thanks Koen.
I will email you directly - and then you can pass it to me - if You're OK with that...
-K-
On 1/28/2019 1:57 PM, Koen Piller wrote:
Hi On the french Foxpro groups site Mike poster a procedure to find the distance between two Google adresses. If you cant find I might be able to upload a zip Koen
Op ma 28 jan. 2019 om 17:49 schreef Kurt @ Gmail kurthwendt@gmail.com
I'm actually going to read your Blog post - since, if you can believe it
- I'm actually starting to teach a class to kids, in an after school
type program. One class is 3D Design/3D Printing - but, the other class is Python based. Am also going to look around at some older threads here talking about Python - so I can truly get a quick jump start in Python. Of course, needless to say - I need only stay 1 or 2 steps ahead of the kids!
And - if ANYONE has a suggestion for something Cool I could teach the kids in Python - feel free to give me a shout out!
Fletcher - sorry to Hi-Jack your thread. At least its not a total hi-jacking and steering it into a wrong direction...
I give you back the steering wheel now!
-K-
On 1/24/2019 4:55 PM, Ed Leafe wrote:
On Jan 24, 2019, at 5:07 PM, Fletcher Johnson <
FletcherSJohnson@yahoo.com> wrote:
My most interesting python question is related to the "file... import
..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments.
You can't specify operating system paths in the import command; those
modules need to be in known locations where Python can find them. When you install something (usually with `pip install`), it is placed in the 'site-packages' directory of your environment. I started to write a big long explanation here, but decided that it would be better as a blog post:
https://blog.leafe.com/using-a-python-virtual-environment/
Of course, if you have any questions about that, let me know.
-- Ed Leafe
[excessive quoting removed by server]
Kurt,
Ok, to summary:
You want to use virtual environments. Microsoft Code and PyCharm both support them as well. Not sure about Visual Studio.
Microsoft Code appears to be pretty good debugging server side code (running locally.)
The Django (if you use that) environment is really "interesting". It's a complete framework including the back end data access, server side code, and UI. You can create restful interfaces or write the html out directly.. That said, it does take quite a bit of buy in. And, you can write your code using functions or classes. Classes mean less work and repetition, but having both approaches used does make finding answers sometimes a little confusing.
Python uses classes, but the implementation will make your brain hurt. And python supports multiple inheritance, which is also a mind twist. The rational is cool, but you want to be careful playing with it.
The DjangoGirls tutorial really is a good (and fast) way to get started. They also have a forum where you can post more novice questions and not be shot down like you might on StackOverflow.
Feel free to ping me directly if you have any questions. Don't know if I will have the answer, but I might... :)
And if I stumble on something that the kids might like, I will let you know.
Fletcher
Fletcher Johnson FletcherSJohnson@Yahoo.com LinkedIn.com/in/FletcherJohnson twitter.com/fletcherJ strava.com/athletes/fletcherjohnson 408-946-0960 - work 408-781-2345 - cell
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Kurt @ Gmail Sent: Monday, January 28, 2019 8:49 AM To: profox@leafe.com Subject: Re: [NF] Looking for a little Python/Django help
I'm actually going to read your Blog post - since, if you can believe it - I'm actually starting to teach a class to kids, in an after school type program. One class is 3D Design/3D Printing - but, the other class is Python based. Am also going to look around at some older threads here talking about Python - so I can truly get a quick jump start in Python. Of course, needless to say - I need only stay 1 or 2 steps ahead of the kids!
And - if ANYONE has a suggestion for something Cool I could teach the kids in Python - feel free to give me a shout out!
Fletcher - sorry to Hi-Jack your thread. At least its not a total hi-jacking and steering it into a wrong direction...
I give you back the steering wheel now!
-K-
On 1/24/2019 4:55 PM, Ed Leafe wrote:
On Jan 24, 2019, at 5:07 PM, Fletcher Johnson FletcherSJohnson@yahoo.com wrote:
My most interesting python question is related to the "file... import ..." command. Apparently, you can't specify a parent folder in the file portion, just the current one. But there is a way to designate where other files may be found, I just haven't figured out where that gets set, especially when using environments.
You can't specify operating system paths in the import command; those modules need to be in known locations where Python can find them. When you install something (usually with `pip install`), it is placed in the 'site-packages' directory of your environment. I started to write a big long explanation here, but decided that it would be better as a blog post:
https://blog.leafe.com/using-a-python-virtual-environment/
Of course, if you have any questions about that, let me know.
-- Ed Leafe
[excessive quoting removed by server]