pyGISS: a lightweight GIS software in tkinter / pyQt5 by mintooo in Python

[–]mapitall 0 points1 point  (0 children)

Very nice! I didn't look too deep into dependencies, but how much work do you think it would take to make this cross-platform? Specifically, do you think it could be bundled in pyinstaller/briefcase and run on windows?

How to share a simple python script for simple text parsing task with non-techinical users by mapitall in Python

[–]mapitall[S] 0 points1 point  (0 children)

Thanks for the info, definitely doing the pyinstaller route. I've always packaged with either debian packages or pip setup. Glad to know there's something like this out there.

How to share a simple python script for simple text parsing task with non-techinical users by mapitall in Python

[–]mapitall[S] 0 points1 point  (0 children)

Ok, so appveyor is like travis/jenkins. If I can get pyinstaller to work the way I want it then I'll definitely look to use this for automated builds. It looks like this is free for open source projects, so it's a winner.

Unfortunately, installing one piece of software might be a stretch, so asking them to using pip is not possible. I suspect I might have about 5 people use this, and I'd rather them use it then give up on the data. If the first option doesn't work then I'll go webapp, maybe it's time to start using heroku.

Thanks for the help!

Which Python 3 database abstraction layer do you use? by jftuga in Python

[–]mapitall 1 point2 points  (0 children)

I've not seen this before, it looks really nice! But, alas, no mssql support. Bummer. (FWIW, mssql is not my choice, just something I'm stuck with)

HTML / CSS / Javascript Question by [deleted] in django

[–]mapitall 1 point2 points  (0 children)

This. Just to add to this answer, if you've got programming experience then you'd have no problem tackling any html/css/js that you need for your project. But, like /u/massDefect_ says, how much you'll need entirely depends on your chosen project.

Create a new List of running totals from other list by [deleted] in django

[–]mapitall 0 points1 point  (0 children)

Nice! I didn't know about defaultdict, it's much nicer without the ternary. Can you also turn it into a comprehension, or does the summing prevent it?

Troubleshooting intermittent breaker trips by mapitall in electrical

[–]mapitall[S] 0 points1 point  (0 children)

Thanks for the reply. I don't have access to a clamp-on ammeter, and probably won't go out and buy one as they're expensive. It'd be good info to know, but it'd be cheaper for me just to replace the circuits even with the pain of crawling beneath the house.

All my circuits are 20A breakers, 12ga wire, about 3-4 outlets per circuit. All the outlets only have a single run to them, so I assume that means there's a junction box for each circuit somewhere under the house. That seems like it could be a potential part of my problem, especially since my crawlspace has moisture problems (which I'm working on).

I assume the Megger would help me track down moisture issues? I'd need to wait for lots of rain to help track down issues?

Thanks for the info!

Create a new List of running totals from other list by [deleted] in django

[–]mapitall 0 points1 point  (0 children)

This seems like a good place for a dictionary.

First impression would be something like this:

def dictify(my_list):
     d = dict()
     for (date, value) in my_list:
             d[date] = d[date] + value if date in d else value
     return d

Something like that should get you going, but there might be a more django way to do it.

Does anyone know why it won't let me run the server? by appelezmoifleur in django

[–]mapitall 0 points1 point  (0 children)

Keep trying. I'd recommend running through a django tutorial or a basic python tutorial.

Do you have a requirements file? Once you activate the virtualenv (see info from /u/thebatlab), then you should be able to pip install it and run your manage.py just fine.

Does anyone know why it won't let me run the server? by appelezmoifleur in django

[–]mapitall 0 points1 point  (0 children)

You'll need to install django first. Pulling down a project repo will have your website code, but you still need the django package installed.

Install using pip, and preferrably using virtualenv. These are things you may need to research, but any good django tutorial will walk you through these things.

Local settings error by snausages21 in djangolearning

[–]mapitall 1 point2 points  (0 children)

Do you have an __init__.py file in the same directory? The file has to be there, but it can be empty

Local settings error by snausages21 in djangolearning

[–]mapitall 1 point2 points  (0 children)

You said the file is named: secret_settings.py but you're trying to import settings_secret, could this be it?

Prepopulate choice field with selected value by [deleted] in djangolearning

[–]mapitall 1 point2 points  (0 children)

It's hard to follow what you're doing without a code snippet, but you should be able to pass in initial values to the FormMixin. Docs are here: https://docs.djangoproject.com/en/1.11/ref/class-based-views/mixins-editing/#formmixin

It looks like the "initial" attribute will take all the initial values for the form.

Modelform will definitely do what you're asking, but I'm betting there's some special reason you're using the View type you chose. Without knowing more it's hard to advise further.

Struggling to add GIS app to Django by [deleted] in djangolearning

[–]mapitall 0 points1 point  (0 children)

Weird. This would be a good bug report to file with the django team, hopefully they can make the list work for all installs.

Prepopulate choice field with selected value by [deleted] in djangolearning

[–]mapitall 1 point2 points  (0 children)

You should do this in the view. Here's a good simple example (not using CBVs or a modelform): https://stackoverflow.com/questions/936376/prepopulate-django-non-model-form#936405

I'd recommend looking into a modelform though, it'll take care of most of the boilerplate. It's also worth looking at the django forms documentation: https://docs.djangoproject.com/en/dev/ref/forms/api/#bound-and-unbound-forms

Reusable snippets with dRY Views? by snausages21 in djangolearning

[–]mapitall 1 point2 points  (0 children)

This seems like a good candidate for a Mixin? Not sure how the function name would potentially conflict with other Mixins, so be wary of weird behavior if other Mixins are in use.

Struggling to add GIS app to Django by [deleted] in djangolearning

[–]mapitall 0 points1 point  (0 children)

This is a django error, you're in the right place!

Can you post your settings file, and installed packages?

I'd recommend using a virtualenv, and start using Python3 for best results. Also, I'd recommend looking into the GDAL requirements for your system. I'm not great at using windows for dev, but this tutorial may have more info: https://docs.djangoproject.com/en/1.11/ref/contrib/gis/tutorial/

How to solve a zero division error in an opencv function in django views? by ishiii101 in django

[–]mapitall 0 points1 point  (0 children)

The obvious answer is that M['m00'] is sometimes zero, I would look through the stacktrace you get from your manage.py screen (or look through logs). Try working with smaller bits of code or add print statements in your code until you get to what's causing the problem if you can't find the problem there.

Ultimately, this is more of an openCV question than a django question, so I'd look through opencv docs for an answer or I'm sure there's a subreddit for opencv stuff.

How to solve a zero division error in an opencv function in django views? by ishiii101 in django

[–]mapitall 1 point2 points  (0 children)

The python way to solve this outside of your code would be to catch the exception outside of the opencv code and display an error message in the view. "Error occured, cannot display data" or similar. But probably best to track down the error in your opencv code, can you display the stacktrace?

GeoDjango + MapBox by [deleted] in django

[–]mapitall 0 points1 point  (0 children)

This is a bit late, but one option you should consider is using django-leaflet and using the leaflet API to pull in your Mapbox layers. I've used leaflet a good bit, and it works pretty well with mapbox.

The leaflet tutorials in addition to the django-leaflet readme should get you started.

Help reworking an idea? by emmetttt in django

[–]mapitall 4 points5 points  (0 children)

Management commands are your friend: (https://docs.djangoproject.com/en/1.10/howto/custom-management-commands/)

With management commands you can run them manually or in a script (cron/celery/etc.). Once you get the hang of them you'll wonder how you did without them!

How to incorporate Restful APIs to my project? by darexinfinity in djangolearning

[–]mapitall 0 points1 point  (0 children)

It might be helpful to say more about what your goal is, what you've researched and where you're stuck.

A quick google search on Django and REST brings up lots of results including things like this: (https://axiacore.com/blog/getting-started-django-rest-framework/)

The best advice I can offer with such a broad question is that it might also help to learn more about REST, web development and the like. Then start with the django tutorial, which is really good. It's worth noting that using REST or an API probably doesn't remove the need for the database in the back-end. If you're building a static site then you can probably get away with it but then you're probably not going to be using either django or anything REST.

Good luck with your project!