Django Pinax-Project-Account github setup - python

So I am fairly new to Github and Django for that matter, I was digging around for a template of a website using Django offering user authentication and cam across this
pinax-project-account
I setup django and python for use within my cmd and using a virtual env and I stepped through the setup list but I'm stuck using:
chmod +x manage.py
I understand this is for use in Unix just wondering how I get the same desired function in windows? as if I skip this step it won't work at all

You don't need to do that, as Windows has no executable bit. Instead of running
./manage.py whatever
just run
python manage.py whatever
making sure that python.exe is on your PATH.

Related

how to run existing Django project

I'm new with python(don't know anything about it), and also in Django... so question is, what and how, step by step, I need to launch existing Django project which I got from github...
so, what I have done already:
installed python
created virtual environment
run python mange.py migrate, but it showed many errors(and I don't know what to do with it and how to fix them), because I can't even connect to DB(previously I worked with MySQL where I can connect by myself and do selects to check something in DB), but now this project uses SQLite3, and I don't know how I can check this database
run python manage.py runserver and I can see my webapp at localhost...
So, main question is, how to properly launch existing Django project?

Setting up VS Code for use with Django, Apache, virtualenv on a remote server

we have a django project on a development server which is running within a virtual environment. I was hoping to be able to use VS Code for development from my local PC, but I am not sure if I am able to or not. It seems like something that would make sense to do!
I think I have managed to set the interpreter as the virtualenv on the server using UNC paths and have activated it, but when I try to run manage.py to create a new app, I get No module named 'django' which perhaps suggested the virtualenv hasn't activate properly?
Is it possible to use VS Code in this way?
thanks,
Phil
You can try extension named "Remote-SSH"
You can edit and debug on a remote machine with VS Code just like you could if the source code was local.
You can alos refer to the document of vscode for more details.

Intellij complains of incorrect configuration for django project

Whenever I run my python django application in Intellij, it shows me a dialog box saying configuration is incorrect and gives me an option to edit or run anyway.
Following is the screenshot of my configuration. Not sure what is it that I am missing.
Update: It does show intermittently in the same configuration dialog box that Django project root is not configured and I am not sure how I can do that. Also, when I run the project anyway, it says,
No manage.py file specified in Settings->Django Support
I am not sure how is the above issue fixable directly but after pressing run on manage.py to create a new configuration and providing it script parameters runserver 127.0.0.1:8000, it worked without errors.
In the above older configuration, Intellij was running a different command
python3.5 /Users/myuser/.virtualenvs/myorg/bin/django-admin.py runserver 8000

Is it possible to build a homepage with python on virtual server when the sudo command is disabled?

I've studied Python and Django, building a homepage.
And I've been using a virtual memory on Ubuntu server(apache2 2.4.18/ php-7.0/ MariaDB 10.0.28 with phpMyAdmin/ FTP) offered for developers.
The server hadn't allowed users to use python, but I asked the server administrator to give me a permission and I got it.
The problem was, however, that I was not allowed to use not only any sudo command line but also basic commands like apt-get and python.
The only administrator can do so, therefore it seems that I cannot install any neccessary things-virtualenv, django, and so on- by myself.
Just to check whether .py file works or not, I added <?php include_once"test.py" ?> on the header of index.php about the test.py where only print "python test"(meaning only python 2 is installed on this server) is written. It works. That is, I guess, all I can do is uploading .py file with Filezilla.
In this case, can I make a homepage with Python on this server efficiently? I was thinking about using Bottle Framework, but also not sure.
I am confused with wondering whether I should use PHP on this server and using Python on PythonAnywhere in the end.
I am a beginner. Any advice will be appreciated :)
Have you thought about asking the admin to start a virtualenv for you and give you permissions to work in that environment?

Profiling Django with PyCharm

My app is pretty slow even in a dev environment so I would like to figure out what's slowing it down so I can try and fix it.
I know about the debug toolbar and according to what it reports neither the database queries nor the downloaded sources are the issue, so it must be the business logic.
However, I cannot run the PyCharm profiler with the Django server because, well, it's not like running a script.
How may I profile Django with PyCharm?
You should probably set configuration properly.
Then click on Edit Configurations...
The main thing is to set Interpreter (your virtual environment). You don't have to set Custom Run Command if you use python manage.py runserver
Then you can run Django server directly from PyCharm ann Profiler too.

Categories

Resources