Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Task/Command Execution Best Practice/Understanding
I've got a little problem with understanding the django management commands. I've got an Webapplication which displays some network traffic information through eth0. Therefore I've created a python class which analyse the traffic and create/update the specific data in the database. Something like this: class Analyzer: def doSomething(self): #analyze the traffic create/update data in db def startAnalyzing(self): while 1: self.doSomething() Then i create a management command which creates this class instance and runs startAnalyzing(). Now my question: Is this the correct way to do that over management command because the task is not terminating (run the whole time) and not started/stopped via webapplication? Or what is the correct way? Is it probably better to start the "Analyzer" not via django? Im new to django and wan't to do it the right way. Is it possible to start sniffing the traffic when i run: manage.py runserver 0.0.0.0:8080? Many thanks in advance. -
Master user creation in django
I was trying to create a user that can login into any account [ atleast for development server ] from the link [ http://pydigger.com/pypi/django-master-password ] but seems that something is missing its not working. Anyidea how to fix this or any other way to achieving this -
Chosen JS : Django Multiselect with ModelForm
Is there any better way to add multiple select as options from drop down as tags in chosenJS Field box. I have ModelForm and tried to add the multiple attr to Model field as widget but seems to like I am doing something wrong. models.py class Relation(models.Model): # I want to select multiple to_users as tags in forms from_user = models.ForeignKey(AUTH_USER_MODEL, related_name='from_user') to_user = models.ForeignKey(AUTH_USER_MODEL, related_name='to_user') forms.py class RelationForm(forms.ModelForm): class Meta: model = Relation fields = '__all__' widgets ={ 'to_user': forms.TextInput(attrs={'multiple':'multiple'}) } The fields works with no problem, $(".select").chosen(); is working in making the drowdown box to chosen box, but unable to make the same field to have multiple tags. Any help would be much appreciated, thank you. -
I have an error with enable_voting_on of django-secretballot
I'm running django 1.10 Model: from django.db import models from django.contrib.auth.models import User import secretballot class Casa(models.Model): propietario = models.ForeignKey(User, blank=True,null=True) precio = models.IntegerField(blank=True, null=True) amueblada = models.BooleanField(default=True) servicios = models.CharField(max_length=140) dirección = models.CharField(max_length=140) cochera = models.BooleanField(max_length=140) secretballot.enable_voting_on(Casa) Traceback: File "/home/topi/.virtualenvs/myvenv/lib/python3.5/site-packages/secretballot/init.py", line 78, in enable_voting_on cls.add_to_class('_default_manager', VotableManager()) File "/home/topi/.virtualenvs/myvenv/lib/python3.5/site-packages/django/db/models/base.py", line 316, in add_to_class value.contribute_to_class(cls, name) File "/home/topi/.virtualenvs/myvenv/lib/python3.5/site-packages/django/db/models/manager.py", line 120, in contribute_to_class setattr(model, name, ManagerDescriptor(self)) AttributeError: can't set attribute -
Backend architecture for SaaS product in django
I'm writing the backend for a SaaS application in django. Need some advise on the architecture. The product will have 2 offerings: a general one where all users will share the same database and a premium one with a dedicated database. How I'm planning to translate this to django is the following: Within the django project, there'll be one app for the general offering. For every premium client, there'll be a separate app. Each app has the same models. Every app communicates with a separate database. Achieved this using: stackoverflow post and django documentation I'll write views for all the APIs in the project's views.py, not inside any app and decide on the basis of a token which app's models to communicate to. The problems I see right now with this architecture: In all of the views, I'll have to write a lot of conditional statements once the number of premium clients increases. Onboarding of new premium clients requires quite a bit of code change. Code duplication in models.py of all the different apps. But it's almost similar to writing statements for creating tables in a new database every time a premium client signs up. Comments? Please advise me on … -
How can I play a static mp3 file on static Javacript on a Django application?
In my Django Application, I am trying to play a mp3 file in a function in my javascript file. This JS file is loaded statically by command collectstatic from Django. I couldn't find a way to reference this mp3 file. Both are in the same folder in server-side. I'm thinking that I can only reference this file if it was upload in the page like other image, js or css file. There is a way to load this file to the browser in a Django application with its templates organization? -
Why isn't this element visible (Selenium + Python/Django 1.9)
I am using webdriver to fill out a form in Django. The first field, name, is found and filled out. But the second field is somehow not being found. Here's the script I'm using... name = browser.find_element_by_id("name") value = browser.find_element_by_id("value") submit = browser.find_element_by_id("offer-submit") name.send_keys(address) name.send_keys(Keys.TAB) # I tried having the browser press tab to see if it becomes visible. no luck. value.send_keys(random.randrange(1, 100, 2)) Here's the error traceback: Traceback (most recent call last): File "populate_map.py", line 71, in <module> value.send_keys(random.randrange(1, 100, 2)) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 320, in send_keys self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': keys_to_typing(value)}) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 461, in _execute return self._parent.execute(command, params) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute self.error_handler.check_response(response) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with Stacktrace: at fxdriver.preconditions.visible (file:///c:/users/owner/appdata/local/temp/tmprd4j_t/extensions/fxdriver@googlecode.com/components/command-processor.js:10092) at DelayedCommand.prototype.checkPreconditions_ (file:///c:/users/owner/appdata/local/temp/tmprd4j_t/extensions/fxdriver@googlecode.com/components/command-processor.js:12644) at DelayedCommand.prototype.executeInternal_/h (file:///c:/users/owner/appdata/local/temp/tmprd4j_t/extensions/fxdriver@googlecode.com/components/command-processor.js:12661) at fxdriver.Timer.prototype.setTimeout/<.notify (file:///c:/users/owner/appdata/local/temp/tmprd4j_t/extensions/fxdriver@googlecode.com/components/command-processor.js:625) and the python: from selenium import webdriver from selenium.webdriver.common.keys import Keys import re for address in geolocations: browser.get("http://127.0.0.1:8000/app") browser.implicitly_wait(2) offer = browser.find_element_by_id("offer") offer.click() name = browser.find_element_by_id("name") value = browser.find_element_by_id("value") description = browser.find_element_by_id("description") tags = browser.find_element_by_id("tags") code = browser.find_element_by_id("code") location = browser.find_element_by_id("location") service = browser.find_element_by_id("id_service") submit = browser.find_element_by_id("offer-submit") name.send_keys(location) value.send_keys(random.randrange(1, 100, 2)) description.send_keys("internet service at {}".format(location)) service.click() … -
email send with celery don't arrive but the task execute, can you help me?
Im using Python 3.5, Django 1.10, celery 3.1.18 and I'm developing on Windows 8 Hello everyone. I'm following the book Django by example and I finish chapter 7 I made a Online Shop when you finish the Order the app must send an Email to the customer. The problem is that im using celery and rabbitmq also I installed flower to check all the tasks. The tasks execute correctly but the Email nerver arrive Heres my tasks.py from celery import task from django.core.mail import send_mail from .models import Pedido @task def pedido_creado(pedido_id): pedido = Pedido.objects.get(id=pedido_id) subject = 'Pedido nro. {}'.format(pedido.id) message = 'Querido {}, \n\nTu pedido fue exitosamente registrado. El id de tu pedido es {}.'.format(pedido.nombre,pedido.id) mail_sent = send_mail(subject, message, 'admin@TiendaManualidades.com', [pedido.email], fail_silently=False,) return mail_sent My views.py from django.shortcuts import render from .models import ItemPedido from .forms import FormCreaPedido from carro_compras.carro_compras import Carro from .tasks import pedido_creado def crear_pedido(request): carro = Carro(request) if request.method == 'POST': form = FormCreaPedido(request.POST) if form.is_valid(): pedido = form.save() for item in carro: ItemPedido.objects.create(pedido=pedido, producto=item['producto'], precio=item['precio'], cantidad=item['cantidad']) carro.limpiar() pedido_creado.delay(pedido.id) return render(request, 'pedidos/pedido/creado.html', {'pedido':pedido}) else: form = FormCreaPedido() return render(request, 'pedidos/pedido/crear.html', {'carro':carro, 'form':form}) My celery.py import os from celery import Celery from django.conf import settings os.environ.setdefault('DJANGO_SETTINGS_MODULE', … -
PostgreSQL: could not connect to server: Connection refused
Someone could help me, because I have a project in Django, I'm in the final stage, and I don't want to use SQLite anymore, so i installed PostgreSQL. After installation, it's impossible for me to connect to psql from the command prompt. (On Windows 10) Here is the error displayed: psql: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? -
Run Python code in a single thread
I need to run some Python code in single process/thread maximum. (That is either 0 or 1 threads of this code should be running at every given point of time.) The code may be started from a Web HTTP request or from another source (such as command line request). Code running started from a HTTP request should continue to run after the Web requests finishes. (That is I need something like fork. The requests should be ordered into a queue, so that the next request runs after the previous one finishes.) How to do this? Should I use some kind of semaphores? Where to read (probably introductory level material, as my problem seems not to be very complex) about threading in Python? We use Python 3 + Django. -
Best way to add a form to multiple pages?
I'm working on a project, that has a bunch of views with corresponding templates and forms. Every template contains a link to a login page (inherits it from the main template): <ul class="options"> ... <li id="login"> <a class="button" href="{% url 'forum:login' %}?next={{ request.path }}">Sign in</a> </li> </ul> And it leads to a separate login page, that renders standard django login form. I want to use jQuery to create or make visible that form on the same page where login link was clicked. What is the best way to add a form to multiple pages? I've tried to get html and build a form dynamically with ajax: view: class Login(FormView): ... def get(self, request, *args, **kwargs): if request.is_ajax(): form = self.get_form().as_ul() return HttpResponse(form) else: return super(Login, self).get(request, *args, **kwargs) script: $(document).ready(function() { $('#login').on('click', 'a', function(event) { var loginUrl = $(this).attr('href'); $.ajax({ url: loginUrl, type: 'GET'}) .done(function(html) { var newForm = $('<form/>', {action: loginUrl, method: 'post'}); newForm.insertAfter('ul.options'); newForm.append($('<input/>', {type: 'hidden', name: 'csrfmiddlewaretoken', value: csrftoken})); var newList = $('<ul/>'); newForm.append(newList); newList.append(html); newList.append($('<li><input type="submit" value="Sign in"/></li>')); }); event.preventDefault(); }); }); But I wonder, if there any better ways to complete such task? Also I'm new to jQuery, so I'd appreciate any remarks on the … -
Why isn't my Model Query set working properly?
I'm building a Q&A style community with categories containing forums which contain Topics and each topic has posts. On the landing page, I want popular Topics across all categories and when inside a category, I want all popular Topics within that category. I've defined template filters to do this but they aren't displaying anything at the category or home levels. They kind of work at the forum level i.e., inside a particular forum it is able to fetch all the topics in that forum. Inside a category, it is supposed to fetch all Topics from each of the forum in that category, currently, it just returns a list of the forums in that category rather than the list of all topics. At the home level, it is supposed to return a list of topics across all categories and contained forums but I get nothing. Can someone please help me figure out whats happening here:? Thanks My TOPICSFORALL.HTML: {% block card_body %} {% for topic in topic_list %} {% include "subjectcard.html" with topic=topic %} {% endfor %} {% endblock %} My SUBJECTCARD.HTML: {% block card_body %} {% for topic in topic_list %} {% include "subjectcard.html" with topic=topic %} {% endfor %} … -
Do all models in Django basically have init constructors that assign to object variables
Suppose I have something like this class Album(models.Model): artist = models.CharField(max_length=128, unique=True) title = models.CharField(max_length=128, unique=True) Now I can do this inst = Album(artist="Shania Twain",title="blah") Since I have not studied how model classes are created under the hood , I am curious do all the model classes have an init constructor as well ? For instance class Album(models.Model): artist = models.CharField(max_length=128, unique=True) title = models.CharField(max_length=128, unique=True) def __init__(self,artist): Album.artist = artist .......... .......... Please let me know if this makes sense. -
"cannot import name import_string" while using "rest_framework_docs"
I installed drfdocs by following the steps as mentioned here. But I am getting cannot import name import_string. Below is the stacktrace: ImportError at / cannot import name import_string Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.6.5 Exception Type: ImportError Exception Value: cannot import name import_string Exception Location: /usr/local/lib/python2.7/dist-packages/rest_framework_docs/api_docs.py in <module>, line 4 Python Executable: /usr/bin/python I am using Django 1.6.5 and django-rest-framework-docs==0.1.7 Below is the list of pip packages installed on my system: moin@moin-pc:~/workspace/my_project$ pip freeze adium-theme-ubuntu==0.3.4 boto==2.42.0 coreapi==2.0.0 dateutils==0.6.6 Django==1.6.5 django-cors-headers==1.1.0 django-countries==4.0 django-debug-toolbar==1.5 django-rest-framework-docs==0.1.7 django-rest-swagger==2.0.5 django-storages==1.5.1 django-tastypie==0.13.3 django-tastypie-swagger==0.1.4 djangorestframework==2.3.13 drfdocs==0.0.11 itypes==1.1.0 jsonpickle==0.9.3 mysqlclient==1.3.7 openapi-codec==1.0.0 Pillow==3.3.1 psycopg2==2.6.2 pygeocoder==1.2.5 python-dateutil==2.5.3 python-mimeparse==1.5.2 pytz==2016.6.1 PyYAML==3.12 requests==2.11.1 simplejson==3.8.2 six==1.10.0 sqlparse==0.2.1 ua-parser==0.7.1 unity-lens-photos==1.0 uritemplate==3.0.0 user-agents==1.0.1 I am sure it is due to any conflict between package version. Any help will be appreciated. -
Django rest_framework permissions how to use in view that has object
I am trying to build my own IP address blacklist blocker. I found theDjango DRF and associated SO questions and answers but struggling to implement this. My IpTable model has ip_address field. I modified the documentation example as follows: from rest_framework import permissions class BlacklistPermission(permissions.BasePermission): """ Global permission check for blacklisted IPs. """ def has_permission(self, request, view): ip_address = request.META['REMOTE_ADDR'] blacklisted = IpTable.objects.filter(ip_address=ip_address).exists() return blacklisted ## (if ip address in table returns True) The question is this being used by views where I want to block the user? Is the idea to create a decoration that is before the view? Or does a call to the global permission check go inside the view before rest of code? In either of these options, there has to be logic to do something eg redirect to a 403 page or custom page. Where does this logic go? -
Creating points subsets in django-models
I am looking for a scalable way to create new user points subsets without migrating each time a new subset is created. For example, say I have a users app with a model where total_points is the sum of pts_1, pts_2, and pts_3 for each user. I have also created a campaigns app that enables users to earn points by performing an action (say, clicking a button for simplicity). I can add new campaigns to the platform through the Django admin and set it up so that when users complete the campaigns, they are credited with points such that (campaign, pk=n) credits that user's pts_n. However, in order to do this, I need to manually add pts_n to models.py and migrate to the database. Is there a better solution? The only thing that I can think of is pre-populating pts_n in batches to avoid migrating every time I add a new campaign. Am I thinking about this the wrong way? I am pretty new to this. -
Unexplained Syntax Error in Html
Hey I've been having a problem with my HTML code where I keep getting syntax errors and can't figure out what is wrong with it. <input type="date" name="DueDate" value="{{task.due_date|date:"Y-m-d" }}"> The editor I am using is pyCharm and it keeps giving me an error under ":" and "" }". The purpose of this input is to display the date represented by task.due_date in the correct format. task.due_date is datefield created within the model using django. When trying to fix the error pyCharm states that I need to put in }} where the error is. Any help? -
Adding work inside UpdateView before template is rendered
I'm using UpdateView as discussed here. I'd like to extend the class below so that some object specific calculations can be performed before the html page is rendered. For example, some dummy code below, do_some_cal() will add three numbers and the result will be stored in the object/instance of MyModel. Is there a preferred approach? class UpdateMyModelView(UpdateView): model = MyModel template_name='data_form.html' fields = ['A', 'B', 'C'] def do_some_calc(self, a, b, c): # self is an instance of MyModel val = a+b+c self.save() return (val) def get_success_url(self): return self.request.POST.get('next', '/default-url/') -
Getting JWT token after Django rest framework login
Im not sure i understand it correctly, I'm using Django rest framework to let user do Login (Among many other thing obviously), after user Login From IOS App in my case i want to get a token and to work with the token from there on. so they need to login only once as long as the token is valid. I got both parts working, the login with username or email and the get token working with curl (like in the JWT manual shows). How do i combine the both, So if the login is successful, before the response of the login, I will call the JWT, create token and then return it to the response of the login, and the app will get the token with the response. I'm not sure it is suppose to be done like that, and i would like to do it in one call to the API, not Two (It seem very simple with two, but any call that is not needed shouldn't be sone in my eyes). class UserLoginSerializer(ModelSerializer): user_id = IntegerField(read_only=True) token = CharField(allow_blank=True, read_only=True) username = CharField(required=False, allow_blank= True) email = EmailField(label='Email Address', required=False, allow_blank= True) class Meta: model = User … -
Django - TypeError: 'genre' is an invalid keyword argument for this function
I’m using Django and I'm having a problem running a Python script that uses Django models The script that I'm using takes data from an api and loads it into my database, however, I'm getting a TypeError while trying to run it: >>> exec(open('load_from_api.py').read()) Traceback (most recent call last): File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\core\managem ent\commands\shell.py", line 69, in handle self.run_shell(shell=options['interface']) File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\core\managem ent\commands\shell.py", line 61, in run_shell raise ImportError ImportError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\qu ery.py", line 465, in get_or_create return self.get(**lookup), False File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\qu ery.py", line 387, in get self.model._meta.object_name movies.models.DoesNotExist: Movie matching query does not exist. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<console>", line 1, in <module> File "<string>", line 24, in <module> File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\ma nager.py", line 122, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\qu ery.py", line 467, in get_or_create return self._create_object_from_params(lookup, params) File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\qu ery.py", line 499, in _create_object_from_params obj = self.create(**params) File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\qu ery.py", line 399, in create obj = self.model(**kwargs) File "C:\Program Files (x86)\Python35-32\lib\site-packages\django\db\models\ba se.py", line 443, in __init__ raise TypeError("'%s' … -
Django get info in the same web without show pk in url
Hello guys I'm trying to get info from a model but without move the url, let me explain by myself when I access to for example: /list It shows the info and if I just make a clic in there i can access to the complete info of this user, or book or something and the url change to detail/8/ Is there any way to get the information without show the id of the database in the url? for example list/ I have some code but I d no have any idea how to do it, I hope you guys can help me. urls: url(r'^detalle/(?P<pk>[0-9]+)/$', views.detalle_id, name="detalle_id"), url(r'^detalle/(?P<nombre>.*)/$', views.detalle_nombre), views: def detalle_id(request, pk): detalle = Pregunta.objects.get(pk=pk) Pregunta.objects.filter(id=pk).update(comentario='1') return render(request, 'detalle.html', {'detalle': detalle}) def detalle_nombre(request, nombre): detalle = Pregunta.objects.get(nombre=nombre) return render(request, 'detalle.html', {'detalle': detalle}) def lista(request): listadb = Pregunta.objects.all() return render(request, 'lista.html', {'listadb':listadb}) Any idea or example? -
How to optimise django-haystack elasticsearch index? 30mil records
I have a django-haystack model index with around 30 million records in it, here's the index: class MoviePeopleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.NgramField(document=True, use_template=False) person_imdb_id = indexes.CharField(model_attr='people__imdb_id') token = indexes.CharField(model_attr='token', null=True) in_summary = indexes.CharField(model_attr='in_summary') movie_imdb_id = indexes.CharField(model_attr='movie__imdb_id') movie_type = indexes.CharField(model_attr='movie__type') movie_votes = indexes.IntegerField(model_attr='movie__votes', null=True) movie_rating = indexes.DecimalField(model_attr='movie__rating', null=True) movie_certification = indexes.CharField(model_attr='movie__certification', null=True) movie_genres = indexes.MultiValueField(null=True) def prepare_movie_genres(self, obj): return tuple(obj.movie.genres.all().values_list('name', flat=True)) def get_model(self): return MoviePeople def get_updated_field(self): return 'modified_on' The purpose of the index was so that I could query elasticsearch rather than postgres doing alot of joins. Here's an example query: SearchQuerySet().filter( person_imdb_id__in=primary_cast_imdb_ids, in_summary=True, movie_certification__in=['PG', '12'], movie_type__in=['some-type'], movie_genres__in=['genre-1', 'genre-2'], token=Raw('[* TO *]') ).exclude(movie_imdb_id__in=exclude_ids).models(MoviePeople) The problem is, queryies like the above are taking between 3000 and 4000 milliseconds to run. What can I do to improve this? The django-haystack docs don't say much on performance. Thanks in advance -
How to return result from a function in Django html form?
Basically I have this form right here <form method="POST" action="."> <input type="text" name="fcal" value="{{F}}" /> <p> <input type="submit" name="fibo" value="Fibonacci" /> </p> </form> I would like the user to input a number and after that this number to be calculated and printed in a Fibonacci sequence. This is my Fibonacci function def fibo(n): if n == 0: return 0 elif n == 1: return 1 else: result = fibo(n - 1) + fibo(n - 2) return result I believe my problem is coming from the views.py file because I am not sure how to create the result to be rendered back. from django.template import Context, loader, RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.forms import ModelForm from django.http import HttpResponse, Http404, HttpResponseRedirect, HttpResponseNotFound import fibonacci def fibocal(request): if request.method == 'POST': fb = request.POST['fcal'] cal = fibonacci.fibo(fb) return render_to_response('fibb/fibb.html', context_instance=RequestContext(request, cal)) else: print('Wrond input type') I would highly appreciate if someone can at least explain how to get the result from a function and print it out on the same page. -
How can I delete a model in django?
I'm installing a new app (social) on my django project. When I enter python manage.py runserver 0.0.0.0:8000 I get the following error Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x971d56c>> Traceback (most recent call last): ... django.core.management.base.CommandError: One or more models did not validate: social.socialall: "client_name": CharFields require a "max_length" attribute that is a positive integer. social.socialall: "customer_name": CharFields require a "max_length" attribute that is a positive integer. social.socialall: "publisher_id": CharFields require a "max_length" attribute that is a positive integer. social.socialall: "currency": CharFields require a "max_length" attribute that is a positive integer. I created a social model a while back but never used it so deleted it from the code. I'm trying to figure out where does social.socialall this lives. I'm assuming django.db.models but I'm querying my SQL database and can't find anything. -
django runserver can't find django
I'm creating a Django application and I've compiled my own Python then used buildout to manage my dependencies. I'm at the point where I want to run manage.py runserver but I can get an ImportError for django Digging a little deeper it appears that actually it can find django - if I just run manage.py it lists all available commands (so obviously it imported django), but it appears that manage.py runserver calls manage.py again, and I guess this must be calling Python without the overloaded path that buildout provides. So, how can I get manage.py runserver to work with my given setup? Other tutorials I see all say to use virtualenv but I've gone down the path of compiling my own Python so I'd like to stick with that.