|
Is Getting started with Django a good place to learn? Is there a trick to viewing answers on their forums? I get an error at the beginning, when running vagrant up. (ArgumentError: wrong number of argumnets) There are a number of posts about this on the front page of the forum, but the replies/answers are not loading, only the question. Example. Any ideas?
Dominoes fucked around with this message at 03:36 on Jun 2, 2013 |
# ¿ Jun 2, 2013 03:31 |
|
|
# ¿ Apr 29, 2024 16:05 |
|
bonds0097 posted:I don't think it's a good way to start. Its reliance on the Vagrant stuff is unfortunate because you'll probably get stuck there due to mismatch in Ruby/Chef versions. You'll basically be defeated before you even start messing around with Django. :p Someone just posted an identical problem to to mine on the getting started with Django forum - He has vagrant up issues, sees multiple threads about it with answers, but can't see the answers. Dominoes fucked around with this message at 00:15 on Jun 3, 2013 |
# ¿ Jun 3, 2013 00:07 |
|
MonkeyMaker posted:Since I don't have SSL on the site, maybe try dropping the 's' on the URL? Works for me.
|
# ¿ Jun 3, 2013 18:45 |
|
etcetera08 posted:I'm working with MonkeyMaker to provide a fully compatible package you can use but if you want to use his VM download from the first lesson as he describes it you can just comment out line 41 of the Vagrantfile and bring up the VM. You may have to remove your old VM from Virtualbox, or you can just move out the .vagrant stuff in the directory if you don't care about having an orphaned VM sitting on your machine.
|
# ¿ Jun 5, 2013 04:21 |
|
etcetera08 posted:Ah, ok, I'll keep looking into it. Should have an update tomorrow.
|
# ¿ Jun 7, 2013 17:21 |
|
etcetera08 posted:So, that's your problem. Go in and delete the VM from Virtualbox and then remove all .vagrant artifacts (I think it will be a directory for your version of Vagrant). Then do `vagrant up` again and you should be golden.
|
# ¿ Jun 8, 2013 00:18 |
|
I successfully ran Vagrant up, installed Putty, and successfully (I think) entered Vagrant with SSH, ran 'sudo ./postinstall.sh'. It seemed to complete, with a few messages about not being able to delete directories. Based on going ahead at this point and things not working in the steps after, I think the note on the GSWD page about not seeing shared folders applies. (Was running sudo ./postinstall.sh supposed to dump some files/folders in my directly that has Cheffile and Vagrantfile?) I followed the steps of exiting the SSH, and running 'vagrant halt' and 'vagrant up' from a non-putty terminal. When I ran vagrant up, it showed chef-11.4.4. again, and errored out with 'wrong number of arguments' as before.
Dominoes fucked around with this message at 16:22 on Jun 8, 2013 |
# ¿ Jun 8, 2013 01:34 |
|
Do you pronounced it "earl"?
|
# ¿ Jun 10, 2013 23:30 |
|
I'm following the Getting Started With Django tutorial. I tried a few months ago, but gave up after vagrant/virtualbox/chef issues. I'm trying again, but can't forgot how to do the SSH step. Using Windows. I've run vagrant.up, converted my insecure_private-key to a .ppk using Puttygen, run Putty per the instructions, and logged in as "vagrant" in Putty's terminal. I think I need to cd to my gswd vagrant directory I ran vagrant up in, but I don't know how to do it, since now I'm cding from a fake Ubuntu putty box. Any ideas? Vagrant up in the main (non putty) terminal seemed to work, which is promising. On an experimental adventure: I tried typing vagrant ssh as the first command, and it prompted me to run sudo apt-get install vagrant. I did that, tried again, and was prompted to do vagrant init. Did that, tried again, and was told I have the wrong version of virtualbox and need 4.0 or 4.1. I'm not sure if it's referring to the version of vagrant I downloaded on my real computer, or the one apt-get installed. I tried uninstalling virtualbox and installing 4.1.26, but I get the same error. Do I need a specific version of 4.1? Overall, I'm just confused and am looking for instructions that leave nothing to the imagination. Is it possible to dive in to Django without this extra stuff? It's frustrating and unrewarding - opposite of Python. Dominoes fucked around with this message at 06:42 on Sep 30, 2013 |
# ¿ Sep 30, 2013 05:58 |
|
Did it a few months back, but couldn't hurt to do it again. ATM I'm reading ahead in GSWD to see if it's possible to work through it without the extra software.
|
# ¿ Sep 30, 2013 06:41 |
|
Thanks dude - I think I'll take your advice and give it a shot on my Ubuntu laptop.
|
# ¿ Sep 30, 2013 07:09 |
|
Hey dudes, thanks for the help with Getting Started With Django. I took your try it on Ubuntu and skip Vagrant advice; it's working, and I'm learning. One of the reasons it was so confusing, is that initially it's not so much a Django tutorial as a complex web development tutorial. GSWD introduces several big concepts together, and for someone new, the distinctions aren't obvious: -Virtualization -Heroku / web-app servers -Unix command line -Postgresql and databases -Django/Python -Git and versioning After understanding this breakdown and looking up basic tutorials for each, it's starting to click. Dominoes fucked around with this message at 22:11 on Oct 20, 2013 |
# ¿ Oct 20, 2013 22:08 |
|
The March Hare posted:This just popped up on HN, I skimmed it and it looks like a pretty good resource for newcomers.
|
# ¿ Oct 22, 2013 15:21 |
|
The March Hare posted:This just popped up on HN, I skimmed it and it looks like a pretty good resource for newcomers.
|
# ¿ Oct 24, 2013 12:22 |
|
I'm a beginner to web development; I've done the polls tutorial, and most of Tango with Django. I'm trying a simple project, and am struggling to apply what I've learned. I'm trying to automate a dull task at work using a webapp, since I can't install programs on work computers. I have a simple Python script that takes a block of text (I've set it up to accept files, or lists of strings, ie each line is an item), regexes latlong coords out of it, change their format and output a skyvector.com get URL. So, takes multi-line text as an input, outputs a string. I've set up a basic Django framework using Tango With Django as a template, but can't figure out how to 1: Get the input text field to show up and 2: accept that input, run it through my script, and display the output. For now, just displaying it as text will work. Relevant bits - views.py Python code:
Python code:
HTML code:
Dominoes fucked around with this message at 22:54 on Nov 6, 2013 |
# ¿ Nov 6, 2013 22:21 |
|
Maluco Marinero posted:You don't need a model, you just need to actually load the form in the view, at the moment you aren't doing that. Have a read, haven't done everything inside form.is_valid, but this should be a start for you. It should now render in the template.
|
# ¿ Nov 8, 2013 20:16 |
|
Has anyone gotten Django working on OpenShift? The tutorials I find lead to HTTP 403 errors. For example, if I follow this tutorial, the rhc tail dump is as follows: code:
The resulting tail dump: code:
New tail dump: code:
code:
edit a Dominoes fucked around with this message at 21:49 on Nov 12, 2013 |
# ¿ Nov 12, 2013 20:20 |
|
Suspicious Dish posted:Have you looked at https://github.com/openshift/django-example ? Dominoes fucked around with this message at 14:59 on Nov 13, 2013 |
# ¿ Nov 13, 2013 13:37 |
|
Suspicious Dish posted:Try #openshift on Freenode? TangoWithDjango demonstrates cwd, which is what was screwing it up. It has to do with Openshift's nested directory structure. Here's an example working application file: Python code:
|
# ¿ Nov 16, 2013 10:48 |
|
I'd like to allow a user to add additional fields by pressing a button. I've set up a basic system for having multiple fields, and am already having trouble. I have a loop to add additional fields and store them in a list, but storing them in a list doesn’t add them to the form's visible fields attribute, which I'm looping over in the template. The fields are implicitly added when simply stored to a variable within the class, but I can't figure out how to do that with a loop. Stripped down code: Python code:
Python code:
Dominoes fucked around with this message at 14:21 on Dec 7, 2013 |
# ¿ Dec 7, 2013 14:18 |
|
Skip the virtual environment stuff for now; you don't need it to do TWD. You don't need the specific version they run either.
|
# ¿ Dec 10, 2013 18:01 |
|
Anyone know how to run South? I did 'from south.db import db', and was greeted with "ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings." I tried south.settings.configure() and django.settings.confgure(), but neither are valid commands.
|
# ¿ Jan 14, 2014 21:42 |
|
I was going off this Stack overflow thread I'm trying to rename a column. I don't understand why Databases (and therefore Django models) are so finicky about changing things, but apparently South is the solution. I want to run this: 'db.rename_column('app', 'old', 'new')', which requires importing db. I don't need to migrate anything, I just want to be able to change database columns without starting from scratch each time. Dominoes fucked around with this message at 22:17 on Jan 14, 2014 |
# ¿ Jan 14, 2014 22:15 |
|
Thanks fletcher - got it sorted using the first two lines you linked, after adding south to my installed apps, and running convert_to_south.
|
# ¿ Jan 15, 2014 17:04 |
|
I've got an Openshift/Django issue: I'm having difficulty getting stylesheets and my SQLite database working in Openshift. When attempting to access a page that uses the database, I get the following Django debug message: "no such table: mytable". I get the same in rhc tail. Everything else appears to work. My local file setup: code:
code:
Python code:
Dominoes fucked around with this message at 18:49 on Jan 16, 2014 |
# ¿ Jan 16, 2014 18:26 |
|
Cowabanga posted:Yeah, I'm really paranoid I'm gonna have a hard time with a tutorial that's crazy outdated, so these should do. Thanks!
|
# ¿ Jan 19, 2014 12:02 |
|
Another tip: While you'll be fine with the official Django tutorial and TWD, if you're reading a tutorial that involves multiple third-party tools that are not working and/or confusing you, run.
|
# ¿ Jan 19, 2014 17:43 |
|
Megaman posted:I'm using aws for my django application, and I'm getting timeouts when uploading large files. Does anyone have an elegant solution for doing django uploads that don't timeout? I think the timeout is something to do with s3 not contacting the django app to say "there is still a connection, don't timeout for the user".
|
# ¿ Jan 26, 2014 01:04 |
|
Muslim Wookie posted:I'm looking at creating an intranet page of sorts, that needs to be able to auth users against AD, read data from a DB and create .docx documents using, in part, information provided by users via forms on the intranet page.
|
# ¿ Mar 31, 2014 09:32 |
|
Ahz posted:Pycharm is a pretty nifty Javascript debugger. It hooks right into a firefox/chrome instance and gives you some pretty great debug tools, breakpoints etc. Dominoes fucked around with this message at 18:46 on Apr 27, 2014 |
# ¿ Apr 27, 2014 18:36 |
|
I'm using the paid version.
|
# ¿ Apr 27, 2014 20:29 |
|
Example where PyCharm doesn't do magic on JS It does magic on the HTML and Django in the file, and does magic on everything for the file it extends.
|
# ¿ Apr 28, 2014 10:25 |
|
Thermopyle posted:I won't be on my PyCharm-havin' PC until tomorrow, but I bet you it's because it's not wrapped in script tags in that file. You may have them in the base file/block, but PyCharm doesn't introspect templates deeply enough to figure that out. Hey, that was it. I'll figure out how to rearrange the file to make it work, if appropriate. Ideally the JS would be in a separate static file, but the host I'm using, Openshift, doesn't play nice with those. Dominoes fucked around with this message at 10:16 on Apr 29, 2014 |
# ¿ Apr 29, 2014 10:12 |
|
Is there a recommended project structure for current versions of Django? Searching shows several different layouts. Mostly, I'm confused about where to put static/(staticfiles/?) and templates/. Current setup: code:
|
# ¿ May 6, 2014 19:43 |
|
Thanks - why do many deployment guides, such as this, recommend referring to the project path as this:? PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) With the layout I described, this is required instead, which I found out by trial and error: PROJECT_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir) For the initial line to work, wouldn't static/, templates/ etc have to be in the project/project directory?
|
# ¿ May 6, 2014 20:57 |
|
Thermopyle posted:Why do you think you require the second line? What exactly goes wrong if you use the first? ie: in the guide I linked: Python code:
Dominoes fucked around with this message at 21:20 on May 6, 2014 |
# ¿ May 6, 2014 21:16 |
|
Thanks - I redid my settings.py according to the 1.6 default. It looks like its method of 'BASE_DIR = os.path.dirname(os.path.dirname(__file__))' does the same as my parent method. I think the deployment guides I was referencing were outdated or nonstandard. I like how in Monkey's example, the app-specific templates are in project/app/templates, instead of project/templates/app. Using the latter, you'd reference a template like so: code:
Do you add add 'BASE_DIR' to TEMPLATE_DIRS in settings, then reference the template as 'app/templates/index.html'? That seems to work. It looks like not adding to TEMPLATE_DIRS, and not adding '/template', but nesting the templates in an additional app folder, ie project/app/templates/app/index.html works too. Cleaner in some ways, but unnecessarily buried. Dominoes fucked around with this message at 18:43 on May 8, 2014 |
# ¿ May 7, 2014 20:05 |
|
MonkeyMaker posted:My usual layout is something like: Thermopyle posted:The reason you should nest an extra app directory inside templates is because all of the template directories throughout your project are namespaced together by the app_directories.Loader. So, if you had project/app1/templates/index.html and project/app2/templates/index.html, project/templates/index.html and then you referenced index.html, Django doesn't know which one you want.
|
# ¿ May 10, 2014 14:16 |
|
Looking for wisdom on moving from Sqlite to Postgres. I have a webapp that helps track things at work. It uses a Sqlite database, and is running on Openshift. Openshift has been a pain in the rear end. It works, but I have multiple issues, ie no static files, convoluted directory structure/update process, and wrong system time. These issues might be fixable, but no there's no documentation or support available, so it's a lost cause. I'm moving to Heroku, which doesn't support SQlite. I've got Postgres working on Heroku, and on my personal computer. I need to migrate my database, which has 1000s of records. With Sqlite, it was easy to just upload/download the file - I don't think I can do that with Postgres. Locally, I've been able to use Django's dumpdata and load data to export the data as json. I can't seem to do that on Heroku. If I use 'heroku run python manage.py loaddata', it can't find the file. (the file's local) How should I approach this? Dominoes fucked around with this message at 20:50 on May 16, 2014 |
# ¿ May 16, 2014 20:47 |
|
|
# ¿ Apr 29, 2024 16:05 |
|
Thanks. I went with your second option, and it worked! Connecting directly seems like a pretty powerful and useful feature.
|
# ¿ May 16, 2014 22:24 |